Pkg - CLI package manager

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#81 Post by sc0ttman »

Updates to Pkg:

- fixes for LxPup64:
* added lxPup64 repo entries to ~/.pkg/sources-all, fixed some existing ones
* fixes in parsing the repo vars in ~/.packages/DISTRO_COMPAT_REPOS
* fixes in building the package download URL
* other related fixes

- fixes in `pkg_status` when finding a packages repo file
* this makes `pkg status <package-name>` return better info more often

- some fixes in the installer
* this may have fixed the installer bug mentioned earlier in the thread

See main post for download.
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
666philb
Posts: 3615
Joined: Sun 07 Feb 2010, 12:27
Location: wales ... by the sea

#82 Post by 666philb »

hi sc0ttman,

just wanted to say that pkg is brilliant. i'm using it in bionicpup64 in a number of ways. first off i have it update the repos every boot with a script in /root/Startup so that the PPM is always up-to date.
I'm also using it in /usr/local/petget/hacks-postinstall.sh to fix packages that don't install completely with the PPM, for instance openshot misses some deps when installed so pkg fires up and grabs the missing stuff

Code: Select all

 openshot-qt_*)
  if [ -f /usr/bin/openshot-qt ];then 
   yaf-splash -bg lightgreen -fg black -placement top -timeout 8 -text "installing missing deps for openshot" &
   urxvt -e pkg -f repo bionic-multiverse get python3-sip python3-requests python3-pkgconfig
  fi
 ;; 
and finally i've used it in some of bionics pet pinstall.sh scripts. gimp from quickpet for example

Code: Select all

#!/bin/sh
yaf-splash -bg lightgreen -fg black -placement top -timeout 8 -text "installing missing dependencies" &
urxvt -e pkg repo bionic-universe get libamd2 libblas3 libcamd2,libccolamd2 libcholmod3 libcolamd2 libgexiv2-2 libgfortran4 libheif1 libilmbase12 liblapack3 libmetis5 libopenexr22 libraw16 libspiro0 libsuitesparseconfig5 libumfpack5 libwebpmux3 libwebpdemux2 mypaint-brushes
update-icon-caches /usr/share/icons/*
yaf-splash -bg lightgreen -fg black -placement top -timeout 4 -text "gimp installed"
BTW i've found that some apps need update-icon-caches /usr/share/icons/*
maybe worth adding

in bionicpup i've hidden the gui menu entries as i don't want to confuse new users. they are still there though and can be turned on in the menu manager.

now you asked for feature requests, and i think i have asked this before. my feature request is an option to check for updates to inbuilt packages and offer to install them.

anyway .. brilliant work and loving it!
Bionicpup64 built with bionic beaver packages http://murga-linux.com/puppy/viewtopic.php?t=114311
Xenialpup64, built with xenial xerus packages http://murga-linux.com/puppy/viewtopic.php?t=107331

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#83 Post by rockedge »

hello sc0ttman,
666philb,


pkg is excellent...huge potential.

I am close to a working (reliable) install script for a complete LAMP and ZoneMinder setup...one click. pkg is what makes this approach possible.
@sc0ttman... it's a master piece in my book.

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#84 Post by sc0ttman »

666philb wrote:hi sc0ttman,

just wanted to say that pkg is brilliant.
Thanks very much :) I like it too.
666philb wrote:i'm using it in bionicpup64 in a number of ways.
Given I've never booted bionicpup64, I'm glad to hear it is working...

BTW, if you call pkg as gpkg, you will get a graphical download progress bar..
Depending on your needs, you might be able to do away with the rxvt popups .. ;)

666philb wrote:BTW i've found that some apps need update-icon-caches /usr/share/icons/*
maybe worth adding
Noted, will do, thanks.
now you asked for feature requests, and i think i have asked this before. my feature request is an option to check for updates to inbuilt packages and offer to install them
A few weeks ago, I tried updating the `pkg update` command to also update builtins.. But hit some unintended snags and didn't have the time...

..And way back I looked into it, and it turns out the PPM merges the updated packages back into the main repo and
gets rid of the list containing updated packages only (IIRC)... Long story short, Pkg never gets a look at which 'new' and
'updated' packages are added to the repo - so it cant show you a list like "Here are packages you can update:" ...

Maybe some hacks to /usr/local/petget/0setup would do it .... Just need to save out the repo entries of the
new packages into their own text file before they get merged into the main repo files...

If the PPM saved a list of these newer versioned packages in /tmp/petget_repoupdate_newpkgs, then at boot Pkg can
update the repos as usual (to generate that file), then read that file and list for the user right away which updated packages
are available to install.

Or some other method... But the point is - if the PPM added the updated packages to a separate file, we could easily copy the
big boy distros and have a popup message in the terminal at first boot, or a pop GUI on running X (etc) that listed the
newly available package updates
.

(maybe it already has something to hook into, I don't know, couldn't find it, and 01micko said it would be a pain due to how
PPM works.. maybe mavrothal or someone can think of a good/easy solution?)
666philb wrote:anyway .. brilliant work and loving it!
Glad to hear it 8)

rockedge wrote:pkg is excellent...huge potential.

I am close to a working (reliable) install script for a complete LAMP and ZoneMinder setup...one click. pkg is what makes this approach possible.
@sc0ttman... it's a master piece in my book.
Thanks, glad it's of use for you!

One of the reasons for making Pkg was to make it easier to create GUIs that can download and install packages..
Things like QuickPet can be made much easier, with less code..

And I'm hoping that users catch on to the potential of creating their own repos, full of custom/merged/combined
packages and SFS files - of all which is now easy to do using Pkg... It just needs a few fixes here and there when
combining and merging packages..

And more generally I'm happy to see Pkg being used for a variety of things... Pretty cool 8)


------------------------------------------

On another note,

I did a mini tutorial on busybox httpd and Bash CGI scripts ...
Or, "web-based GUIs for command line programs" as it could be called ;)

It seems very possible to make a website that can create custom puppy ISOs:

* choose the ISO from a dropdown list

* click 'Begin' button

* ISO and main SFS is unpacked

* a list of all installed packages is presented, uncheck the ones you wanna remove, click 'Next'

* choose a repo from dropdown, it will list all its packages, check/tick the packages you wanna include, click 'Next'

* show a list of extra SFS files that can be added to the ISO, check the ones you want, click 'Next'

* show a form so user can choose themes and default options from dropdowns, input boxes etc

* click 'Build' button

* the SFS and then the ISO are rebuilt and offered for download


...something like that anyway... Basically a remaster tool, but from a webpage... Salix had one, other distros too...
No reason why Puppy can't have one, hosted at ibiblio, smokey01, or sdf.org somewhere ...
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#85 Post by bigpup »

About the update packages needed info.

What about using the info provided in /var/packages

The files:
user-installed-packages
woof-installed-packages

There is Updates_mgr program in some Slacko versions that looks at the Slackware updates repository for updates.
http://distro.ibiblio.org/puppylinux/pe ... r-0.11.pet

It seems to use this to check what to update.

Code: Select all

# check if we already have the latest $SELECTION
	grep -q "$1" $PKGINFODIR/woof-installed-packages
	[ "$?" = 0 ] && INSTWOOF=yes
	grep -q "$1" $PKGINFODIR/user-installed-packages
	[ "$?" = 0 ] && INSTUSER=yes
	if [[ "$INSTWOOF" || "$INSTUSER" ]];then
	  MSGINSTALLED=$(eval_gettext "$1 seems already to be installed. Exiting now.")
	  gtkdialog-splash -bg pink -close box -timeout 6 -text "$MSGINSTALLED"
	  exit
	fi
Later in the code it makes a list of what to update.

Code: Select all

# show only patches of installed apps #add firefox and seamonkey
#get rid of dep info, can bork
[ -f /tmp/update_slack_database ] && rm /tmp/update_slack_database
while read PLINE
  do XLINE=$(echo $PLINE|cut -d '|' -f1,2,3,6,8,10)
  echo "$XLINE" >> /tmp/update_slack_database
  done <$PKGINFODIR/Packages-slackware${X}-$DISTRO_COMPAT_VERSION-patches
while read line
  do PKGNAME=$(echo $line|cut -d '|' -f2)
     PKGNAMEVER=${PKGNAME}-
     PKGVER=$(echo $line|cut -d '|' -f1)
     if [ "$PKGNAME" = "mozilla-firefox" ];then
       echo "$line" >> /tmp/updates_slack.lst
     fi
     if [ "$PKGNAME" = "seamonkey" ];then
       echo "$line" >> /tmp/updates_slack.lst
     fi
     # filter if a default or user installed package
     INSTALLEDWOOF=$(grep $PKGNAMEVER $PKGINFODIR/woof-installed-packages)
     INSTALLEDUSER=$(grep $PKGNAMEVER $PKGINFODIR/user-installed-packages)
     if [ "$INSTALLEDWOOF" ]||[ "$INSTALLEDUSER" ];then
        # filter if it is up to date, assuming we don't roll back
        CURINWOOF=$(grep $PKGVER $PKGINFODIR/woof-installed-packages) 
        CURINUSER=$(grep $PKGVER $PKGINFODIR/user-installed-packages)
        if [ ! "$CURINWOOF" ]&&[ ! "$CURINUSER" ];then
          echo "$line" >> /tmp/updates_slack.lst
        fi
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#86 Post by sc0ttman »

bigpup wrote:About the update packages needed info.

What about using the info provided in /var/packages ?
Thanks for the link, I hadn't seen that before..

But, Pkg already does this, somewhat - just run `pkg update [pkgname]` and it will compare the
installed version to the latest repo versions..

The only issues at the moment being that Pkg refuses to update the built-ins, and Pkg has no
access to a ready made list of available updates - you must give a package name, or loop
through all packages..

About the updates_mgr script:

So, in general it does this:

1. downloads the latest repo (containing the new packages)
2. goes through the list of new packages
3. gets the latest version of each new package (from 'patches' or 'updates' repo files)
4. compares the versions to installed versions
5. if installed version is older than repo version, offers to update

..but this is Slackware only, and won't work for non-slack pups.

(01mickos updates_mgr is essentially a re-write of some repo update code that already exists in the PPM,
... the fact he wrote a separate script and doesn't just cat a file, kinda proves my point.)

Therefore, IMHO, the method I described is still probably best - to patch the PPM to leave a list
of the available package updates somewhere for other programs to make use of
..

IMHO, the code for listing available updates should live in one place - the PPM - and not be re-written for
each Pup that gets made .. Also, we don't wanna re-update the repos just to generate or grab the list of
new packages if the PPM already updated the repos - cos the PPM should/could have generated it already.

And we certainly don't wanna have to loop through all packages just to find a few updates after they
were merged in with the rest (as is the current situation).

Having a separate list means at boot you just cat a file to get the list of available updates, cos the info is
always available, and you won't have run a slow script and make the user wait to get it...

Even better is making 2 lists: one for security updates, one for other updates. Not sure how easy that
would be - Slackware repo structures would allow for it, dunno about other distros though...

....

About removing/updating built-in packages using Pkg:

Currently it's not possible, but I think allowing *only* the `install` and `uninstall` commands to
affect built-ins should be enough.. Users would then be able to download, install or remove
built-ins, using `pkg download`, `pkg install` and `pkg uninstall` with the -F option...
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#87 Post by bigpup »

About removing/updating built-in packages using Pkg:

Currently it's not possible, but I think allowing *only* the `install` and `uninstall` commands to
affect built-ins should be enough.. Users would then be able to download, install or remove
built-ins, using `pkg download`, `pkg install` and `pkg uninstall` with the -F option...
A Puppy frugal install has built-ins in a read only .sfs file.
Usually the Puppy version main .sfs file.
It will not let you uninstall them.
What the Remove Builtin Packages program does is white list a program so it is no longer seen by the OS.
The program is still in the .sfs file.
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#88 Post by sc0ttman »

bigpup wrote:A Puppy frugal install has built-ins in a read only .sfs file....What the Remove Builtin Packages program does is white list a program so it is no longer seen by the OS.
I know - I'm aware remaster would still be needed to properly remove them...

That is why Pkg doesn't handle them the same as regular packages..
(it currently refuses to touch them)

When I say Pkg should be able to 'uninstall' built-ins, I mean in the same
way the "Remove Builtin Packages" tool does it (as in hides them with
whiteout files)...
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

belham2
Posts: 1715
Joined: Mon 15 Aug 2016, 22:47

#89 Post by belham2 »

Hi Sc0ttman,

Just wanted to say this creation of yours is the best thing to happen in a long time here. Was in Radky's RC3, have now went to RC4, and everything still goes when I'm experimenting.

Something you wrote a few messages above hit me between the eyes with the proverbial anvil:
It seems very possible to make a website that can create custom puppy ISOs:
4-5 years ago (back in my original Belham iteration) I had posted here on murga ruminating---after having using Porteus and their "build-your-ISO" website, which let you choose some, not all, but some things like browser, word processors, etc----if this would ever be possible in Puppy-land. Even using Pkg, it didn't dawn on me it could actually do this.

I think if what you wrote ever comes to pass:
It seems very possible to make a website that can create custom puppy ISOs:

* choose the ISO from a dropdown list

* click 'Begin' button

* ISO and main SFS is unpacked

* a list of all installed packages is presented, uncheck the ones you wanna remove, click 'Next'

* choose a repo from dropdown, it will list all its packages, check/tick the packages you wanna include, click 'Next'

* show a list of extra SFS files that can be added to the ISO, check the ones you want, click 'Next'

* show a form so user can choose themes and default options from dropdowns, input boxes etc

* click 'Build' button

* the SFS and then the ISO are rebuilt and offered for download
....then the world of Puppy definitely takes its [i]next step of evolution[/i].


Anyway, much kudos all around to you for getting Pkg this far. I stumbled around with it at first, but now it is mostly successes, which brings no end of delight to me.

I figure if a dunderhead like me can understand it and get it to work most of the time, then this thing has--in my old eyes--passed a major, major, MAJOR test/threshold.

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#90 Post by sc0ttman »

Thanks for the kind words belham, glad Pkg is (mostly!) working for you.

I still plan to keep working on it, but I'm sidetracked at the mo...

Currently working on Mdsh - a static website (and documentation/manpage) generator..

When it's done, it will be a great way of building and hosting a 100% free blog, and of generating documentation across various distros/systems...

(It could be used to auto-generate wikis, docs & webpages for each Puppy release, for example ;) )
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
peebee
Posts: 4370
Joined: Sun 21 Sep 2008, 12:31
Location: Worcestershire, UK
Contact:

#91 Post by peebee »

ImageLxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#92 Post by wiak »

Hi sc0ttman,

I thought you might find XBPS package manager used in Void Linux interesting since it is an independently developed package management system (though not, in its present form, for Puppy, but who knows what might be done with it should devs here make a fork of it). I briefly describe my recent look at Void Linux here:

http://www.murga-linux.com/puppy/viewto ... 51#1022151

wiak

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#93 Post by s243a »

Hello S0ttman,

since you discovered my thread, I'll start reporting issues. I haven't reported any yet because my original plan was to troubleshoot first, since I don't know what errors might be due to me installing pkg wrong vs a bug in pkg.

In the following example pkg appears to download the pacakge (to /root/pkg) but some of the paths look worng,. They have a "//".

Code: Select all

pkg --download geany_1.29-1
wget --no-check-certificate --progress=dot -O /root/pkg/geany_1.29-1_i386.deb -4 -c http://deb.devuan.org/merged/pool/DEBIAN/main/g/geany/geany_1.29-1_i386.deb
...
Downloaded: /root/pkg/geany_1.29-1_i386.deb
...
+ case $1 in
++ func_list
++ '[' -f /tmp/pkg//func_list ']'
++ tr '\t' ' '
++ cat /tmp/pkg//func_list
++ cut -f2 '-d '
++ grep -m1 '^geany_1.29-1()'
++ sort
++ exit 0
...
++ user_pkgs_list=/root/.packages/user-installed-packages
++ '[' true '!=' true -a -f /root/.packages/devx-only-installed-packages ']'
++ '[' true '!=' true ']'
++ '[' '!' '' ']'
++ cut -f1 '-d|' /root/.packages/user-installed-packages
++ grep -vE '^\$|^pkg\-'
++ return 0
+ '[' yes = yes -a 'file_5.30-1+deb9u2_i386
libmagic1_5.30-1+deb9u2_i386
libsystemd0_232-25+deb9u11_i386' '!=' '' ']'
+ clean_pkgs
+ rm /tmp/pkg//PKGSDONE
+ LANG=en_CA.UTF-8
+ LC_ALL=
+ exit 0
+ cleanup 1 0
+ rm -f '/tmp/pkg/missing_dep*' '/tmp/pkg/installed_pkg*' '/tmp/pkg/all_dep*' /tmp/pkg/DEP_DONE /tmp/pkg/list_deps_busy /tmp/pkg/pkg_file_list /tmp/pkg//dependents_list /tmp/pkg/DEP_DONE /tmp/pkg/ldd_file_list
...
Find me on [url=https://www.minds.com/ns_tidder]minds[/url] and on [url=https://www.pearltrees.com/s243a/puppy-linux/id12399810]pearltrees[/url].

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#94 Post by s243a »

Now if I delete the downloaded file and do the following command:

Code: Select all

pkg --get geany_1.29-1
I get output like and an infinite loop.

Code: Select all

Install package geany_1.29-1_i386:  
cut: /root/.packages/Packages-puppy-noarch-official: No such file or directory
cut: /root/.packages/Packages-puppy-common-official: No such file or directory
cut: /root/.packages/woof-installed-packages: No such file or directory
cut: /root/.packages/Packages-puppy-noarch-official: No such file or directory
cut: /root/.packages/Packages-puppy-common-official: No such file or directory
cut: /root/.packages/woof-installed-packages: No such file or directory
cut: /root/.packages/Packages-puppy-noarch-official: No such file or directory
cut: /root/.packages/Packages-puppy-common-official: No such file or directory
cut: /root/.packages/woof-installed-packages: No such file or directory

I think what I see being printed is from these lines:

Code: Select all

      # get pkg size, category and description
      [ "$PKGCAT" = ''  ] && PKGCAT=`LANG=C  grep -m1 "|${PKGNAME_ONLY}|" "${HOME}/.packages/${REPOFILE}" 2>/dev/null | cut -f5 -d'|' | head -1`
      [ "$PKGCAT" = ''  ] && PKGCAT=`LANG=C  grep -m1 "^${PKGNAME}|" "${HOME}/.packages/${REPOFILE}" 2>/dev/null | cut -f5 -d'|' | head -1`
      [ "$PKGDESC" = '' ] && PKGDESC=`LANG=C grep -m1 "|${PKGNAME_ONLY}|" "${HOME}/.packages/${REPOFILE}" 2>/dev/null| cut -f10 -d'|' | head -1`
      [ "$PKGDESC" = '' ] && PKGDESC=`LANG=C grep -m1 "^${PKGNAME}|" "${HOME}/.packages/${REPOFILE}" 2>/dev/null| cut -f10 -d'|' | head -1`
      [ "$PKGSIZE" = '' ] && PKGSIZE=`LANG=C du -s -k ${CURDIR}/${PKG} 2>/dev/null | cut -f1`
      # get pkg version
      PKGVER="`LANG=C  echo "$PKGNAME" | sed -e 's/^[^0-9]*-//g'`"
https://gitlab.com/sc0ttj/Pkg/blob/mast ... /pkg#L4923

It looks like that one needs the package version to break the loop but the pkg version is in the file name. Also the download was sucesfull so it could look inside the package (i.e. the control file) to get the version.

The issue here might in part due to that in devian/devuan package names are seperated with an underscore character ("_") whereas in other pkg files package names are seperated by a dash ("-") in the file name. PKG should not need to look in the pkg database files for the version because the version is contained in the file name.

I also see that it is not looking in Packages-devuan-ascii-contrib and I see that I'm missing woof-installed-packages (I think I forgot to sync).

Anyway, I'll try syncing and see if I get the same error. I'll Also check why it isn't looking for files like "Packages-devuan-ascii-contrib"

Edit 1

/ # sync_pet_specs_fm_dpkg.sh

Code: Select all

...
/ # pkg --get geany_1.29-1
cut: /root/.packages/Packages-puppy-noarch-official: No such file or directory
cut: /root/.packages/Packages-puppy-common-official: No such file or directory
cut: /root/.packages/Packages-puppy-noarch-official: No such file or directory
cut: /root/.packages/Packages-puppy-common-official: No such file or directory
cut: /root/.packages/Packages-puppy-noarch-official: No such file or directory
cut: /root/.packages/Packages-puppy-common-official: No such file or directory
cut: /root/.packages/Packages-puppy-noarch-official: No such file or directory
cut: /root/.packages/Packages-puppy-common-official: No such file or directory
Package geany already installed.
Use the -f option to force installation: pkg add geany -f
P.S. I'll look into why sync_pet_specs_fm_dpkg.sh failed in my build script.
Find me on [url=https://www.minds.com/ns_tidder]minds[/url] and on [url=https://www.pearltrees.com/s243a/puppy-linux/id12399810]pearltrees[/url].

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#95 Post by s243a »

I think that pkg might be sourcing the wrong pkgrc file.

I see the following code;

here is what I have:

Code: Select all

  # get current repo ($REPOFILE)
  . ${PKGRC}
/usr/sbin/pkg#L2055

Here is what I have or /root/.pkg/pkgrc

Code: Select all

WORKDIR=/root/pkg
REPONAME=ascii-main
EX=deb
REPOFILE=Packages-devuan-ascii-main
REPOURL1=http://deb.devuan.org/merged/
REPOURL2=
REPOURL3=
REPOURL4=
PKGSEARCH="list_pkg_names"
PKGSEARCHEXACT="pkg -ne"
DEPSEARCH="list_all_pkg_names"
DEPSEARCHEXACT="pkg -nea"
REPOFALLBACKS="noarch common ascii ascii-backports ascii-contrib ascii-multimedia ascii-non-free stretch-main stretch-backports stretch-contrib stretch-multimedia dpup upup "
PKGSCOPE="one"
DEPSCOPE="all"
BLEDGE="no"
RDCHECK="yes"
AUTOCLEAN="yes"
BUILDTOOL=petbuild
Looking more at the code I see that PKGRC is set here:

Code: Select all

[ -z "$PKGRC" ] && export PKGRC=${HOME}/.pkg/pkgrc      # config file for this script
/usr/sbin/pkg#L46

This part looks relevant:

Code: Select all

  local all_supported_repofiles

  # all repo files, full paths
  all_supported_repofiles=`repo_file_list | sed "s#^#$HOME/.packages/#" | tr '\n' ' '`
/usr/sbin/pkg#L754

doing some more searching:

Code: Select all

repo_file_list(){                 # list available repo files, $1 optional FUNCLIST

  # we need to list these repos in the order defined in the RC file
  # so Pkg can 'fall back' to other repos in that order

  # get current config
  . ${PKGRC}

  # set vars for this func
  local list=''
  local repo_file=''
  local repo_files=`cut -f3 -d'|' ${HOME}/.pkg/sources`
  local current_fallback_list=`grep "^$REPONAME|" ${HOME}/.pkg/sources | cut -f8 -d'|' | grep -v "^\$"`

  # get current repo fallback list order.. note if repo not listed in fallback list, it will be appended after
  for line in $current_fallback_list
  do
    # get the repo file
    repo_file="`grep "^$line|" ${HOME}/.pkg/sources | cut -f3 -d'|'`"
    # add it to the list
    [ "$repo_file" != "" ] && list="$list$repo_file "
  done

  # now add all other avail repos to the end of fallback list
  for repo_file in $repo_files
  do
    #if not blank, not already in the repo list and not the current repo ($REPONAME from rc file) then add to list
    [ "$repo_file" != "" -a "`echo "$list" | grep "$repo_file "`" = ""  -a "$repo_file" != "$REPOFILE" ] && list="$list$repo_file "
  done

  # list the current repo first
  echo $REPOFILE
  # then the other repos
  echo "$list" | tr ' ' '\n' | grep -v "^\$"
}
/usr/sbin/pkg#L1178

I checked and my $HOME variable is valid. Here is my /root/.pkg/sources file:

Code: Select all

ascii-main|deb|Packages-devuan-ascii-main|http://deb.devuan.org/merged/||||noarch common ascii ascii-backports ascii-contrib ascii-multimedia ascii-non-free stretch-main stretch-backports stretch-contrib stretch-multimedia dpup upup 
noarch|pet|Packages-puppy-noarch-official|http://ftp.nluug.nl/os/Linux/distr/puppylinux/pet_packages-noarch/|http://distro.ibiblio.org/puppylinux/pet_packages-noarch/|||common32 common64 common quirky wary5 wary53x wary51x lucid dpup akita puppy5 puppy4 puppy3 puppy2 slacko slacko14
common|pet|Packages-puppy-common-official|http://ftp.nluug.nl/os/Linux/distr/puppylinux/pet_packages-common/|http://distro.ibiblio.org/puppylinux/pet_packages-common/|||noarch quirky wary5 wary53x wary51x lucid dpup akita puppy5 puppy4 puppy3 puppy2 slacko slacko14 saluki
ascii-contrib|deb|Packages-devuan-ascii-contrib|http://deb.devuan.org/merged/|http://|||noarch common common32 common64 ascii ascii-main ascii-backports ascii-multimedia ascii-non-free stretch-main stretch-backports stretch-contrib stretch-multimedia dpup upup 
ascii-non-free|deb|Packages-devuan-ascii-non-free|http://deb.devuan.org/merged/||||noarch common common32 common64 ascii ascii-main ascii-backports ascii-contrib ascii-multimedia stretch-main stretch-backports stretch-contrib stretch-multimedia dpup upup
anyway... I'm going to take a break for this issue from now and report a new issue.
Find me on [url=https://www.minds.com/ns_tidder]minds[/url] and on [url=https://www.pearltrees.com/s243a/puppy-linux/id12399810]pearltrees[/url].

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#96 Post by s243a »

reserved
Find me on [url=https://www.minds.com/ns_tidder]minds[/url] and on [url=https://www.pearltrees.com/s243a/puppy-linux/id12399810]pearltrees[/url].

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#97 Post by s243a »

Here is some output for a different issue:

Code: Select all

/ # pkg -f --get geany_1.29-1
cut: /root/.packages/Packages-puppy-noarch-official: No such file or directory
cut: /root/.packages/Packages-puppy-common-official: No such file or directory
cut: /root/.packages/Packages-puppy-noarch-official: No such file or directory
cut: /root/.packages/Packages-puppy-common-official: No such file or directory
cut: /root/.packages/Packages-puppy-noarch-official: No such file or directory
cut: /root/.packages/Packages-puppy-common-official: No such file or directory
cut: /root/.packages/Packages-puppy-noarch-official: No such file or directory
cut: /root/.packages/Packages-puppy-common-official: No such file or directory
cut: /root/.packages/Packages-puppy-noarch-official: No such file or directory
cut: /root/.packages/Packages-puppy-common-official: No such file or directory
Download geany from ascii-main repo:  
cut: /root/.packages/Packages-puppy-noarch-official: No such file or directory
cut: /root/.packages/Packages-puppy-common-official: No such file or directory
cut: /root/.packages/Packages-puppy-noarch-official: No such file or directory
cut: /root/.packages/Packages-puppy-common-official: No such file or directory
cut: /root/.packages/Packages-puppy-noarch-official: No such file or directory
cut: /root/.packages/Packages-puppy-common-official: No such file or directory
Downloading geany_1.29-1_i386.deb. Please wait: 100%
Downloaded: /root/pkg/geany_1.29-1_i386.deb
cut: /root/.packages/Packages-puppy-noarch-official: No such file or directory
cut: /root/.packages/Packages-puppy-common-official: No such file or directory
Install package geany_1.29-1_i386:  
cut: /root/.packages/Packages-puppy-noarch-official: No such file or directory
cut: /root/.packages/Packages-puppy-common-official: No such file or directory
Installed: geany_1.29-1_i386
cut: /root/.packages/Packages-puppy-noarch-official: No such file or directory
cut: /root/.packages/Packages-puppy-common-official: No such file or directory
Resolving dependencies..
Dependencies to get: geany-common libc6 
Download geany-common from ascii-main repo:  
Downloading geany-common_1.29-1_all.deb. Please wait: 100%
Downloaded: /root/pkg/geany-common_1.29-1_all.deb
Install package geany-common_1.29-1_all:  
Installed: geany-common_1.29-1_all
Download libc6 from ascii-main repo: 
Note that libc6 shouldn't be downloaded and we still have the issue with the pkg database files here.
Find me on [url=https://www.minds.com/ns_tidder]minds[/url] and on [url=https://www.pearltrees.com/s243a/puppy-linux/id12399810]pearltrees[/url].

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#98 Post by s243a »

Here is a different issue. PKG might have issues with redirects to mirrors

I think I"m wrong here:
...although this could be due to devuan using countermeasures to prevent people from scraping their site. I'm guessing this because we are using the --spider option in wget.
but I don't see the mirror url in the output:

Code: Select all

bash -x pkg -f --get leafpad 2>&1 | tee pkg_get_leafpad.log
...
++ wget -S --spider http://deb.devuan.org/merged/pool/DEBIAN/main/l/leafpad/leafpad_0.8.18.1-5_i386.deb
++ sort -u /tmp/pkg/all_deps_1
++ grep -m1 'HTTP/1.1 404 Not Found'
...
++ PKGNAME_ONLY=leafpad
++ '[' leafpad_0.8.18.1-5 = '' -o leafpad = '' ']'
+++ find /root/.packages/ -name leafpad_0.8.18.1-5.files
++ check=
++ '[' '' = '' ']'
+++ find /root/.packages/ -name 'leafpad_0.8.18.1-5_*.files'
++ check=/root/.packages/leafpad_0.8.18.1-5_i386.files
++ '[' /root/.packages/leafpad_0.8.18.1-5_i386.files = '' ']'
++ '[' /root/.packages/leafpad_0.8.18.1-5_i386.files = '' ']'
++ '[' /root/.packages/leafpad_0.8.18.1-5_i386.files = '' ']'
++ '[' /root/.packages/leafpad_0.8.18.1-5_i386.files = '' ']'
++ '[' /root/.packages/leafpad_0.8.18.1-5_i386.files = '' ']'
++ '[' /root/.packages/leafpad_0.8.18.1-5_i386.files = '' ']'
++ '[' /root/.packages/leafpad_0.8.18.1-5_i386.files '!=' '' ']'
++ echo true
...
++ get_pkg_name_only leafpad_0.8.18.1-5
+ local PKGNAME_ONLY=leafpad
++ is_builtin_pkg leafpad
+ local pkg_is_builtin=false
++ LANG=C
++ grep -m1 '^leafpad$' /tmp/pkg//PKGSDONE
+ local pkg_already_done=
++ is_blacklisted_pkg ''
+ local 'pkg_is_blacklisted=
Usage: [1mpkg installed PKGNAME[0m

Returns true if PKGNAME is user installed, 
or a builtin, or in the devx.

Returns false if package not installed.'
+ '[' false = true -a true = true ']'
+ '[' '
Usage: [1mpkg installed PKGNAME[0m

Returns true if PKGNAME is user installed, 
or a builtin, or in the devx.

Returns false if package not installed.' = true ']'
+ '[' '' '!=' '' -a true = false ']'
+ echo -n 'Resolving dependencies..'
Resolving dependencies..+ '[' -f /tmp/pkg/list_deps_busy ']'
+ echo

+ '[' -f /tmp/pkg//leafpad_0.8.18.1-5_dep_list ']'
++ cat /tmp/pkg//leafpad_0.8.18.1-5_dep_list
Here is the correct link to the mirror download:

http://cdn-fastly.deb.debian.org/debian ... 5_i386.deb

I get the correct link by copying the entire path except the file name and then I get redirected to the mirror.

Anyway, pkg seems to have installed leafpad and dependencies but it seems to fail at detecting that the package was installed.
Find me on [url=https://www.minds.com/ns_tidder]minds[/url] and on [url=https://www.pearltrees.com/s243a/puppy-linux/id12399810]pearltrees[/url].

mistfire
Posts: 1411
Joined: Wed 05 Nov 2008, 00:35
Location: PH

#99 Post by mistfire »

@sc0ttman I sent merge request to your gitlab. I filled some missing parts on your source code

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#100 Post by Lobster »

Is this packaging system compiled/available for 64bit eg Puppy8 BionicPup?

Sounds very useful 8)

Puppy Linux
Smaller, faster, Run Free
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

Post Reply