Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 13 Nov 2019, 07:05
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Pkg - CLI package manager
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 6 of 10 [139 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 Next
Author Message
sc0ttman


Joined: 16 Sep 2009
Posts: 2741
Location: UK

PostPosted: Wed 02 Jan 2019, 07:19    Post subject:  

New command available in latest Pkg:

pkg merge PKGNAME,PKGNAME,.. [--with-deps]

Code:
# pkg usage merge

Usage: pkg merge PKGNAME,PKGNAME,.. [--with-deps]

Merge multiple packages into a single package. The newly
created package file will a .PET.

If --with-deps is given, the dependencies of each listed
package will also be merged into the final package file.

PKGNAME(s) must be comma separated (no spaces)!


Examples:

Code:
pkg merge freeciv_2.5.6-2,freeciv-server,freeciv-client-gtk --with-deps


.. the above command will merge the 3 given packages, and all their dependencies into a single PET package - freeciv_2.5.6-2-MERGED.pet.

(You will be asked for a package name for the new package during creation..)

_________________
Pkg, mdsh, Woofy, Akita, VLC-GTK, Search

Last edited by sc0ttman on Wed 02 Jan 2019, 12:43; edited 1 time in total
Back to top
View user's profile Send private message 
mfb

Joined: 22 Mar 2016
Posts: 90

PostPosted: Wed 02 Jan 2019, 08:57    Post subject:  

Hi sc0ttman,

Your "merge" command in your post immediately above is of considerable interest to me.

Last month, foxpup expressed it is his understanding that this package is PPM compatible (I'm using radky's "Dpup Stretch 7.5 (RC3))".

I follow the command, but (because of my deficiencies) although I've skip-read the whole of this thread I haven't followed too much too well.

If you are able to confirm compatibility, could you also say what I need (e.g. devx etc.) so I can try the command.

Thank you.
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2741
Location: UK

PostPosted: Wed 02 Jan 2019, 12:40    Post subject:  

mfb wrote:
Hi sc0ttman,

Your "merge" command in your post immediately above is of considerable interest to me.

Last month, foxpup expressed it is his understanding that this package is PPM compatible (I'm using radky's "Dpup Stretch 7.5 (RC3))".

I follow the command, but (because of my deficiencies) although I've skip-read the whole of this thread I haven't followed too much too well.

If you are able to confirm compatibility, could you also say what I need (e.g. devx etc.) so I can try the command.

Thank you.

(I'm also using Dpup Stretch 7.5 RC3, so Pkg should work for you Wink but you only need the devx to use Git, or compile packages from source..)

You can install and use Pkg this way (without the devx):

1. Download the .tar.gz here: https://gitlab.com/sc0ttj/Pkg/-/archive/master/Pkg-master.tar.gz

^ that is always the latest version, whenever you download it..

2. Then unzip it somewhere ... open a terminal inside the unzipped directory, or cd into it...

3. Then in your terminal run:

./installer.sh

This will install Pkg Smile


..
...
.....


You can then start using it :

Code:
pkg welcome      # help msg


Code:
pkg update-sources  # set all available repos


Code:
pkg repo-update      # update all available repos


Code:
pkg repo-list    # list available repos


Code:
pkg repo NAME    # change to repo called NAME


Code:
pkg names PKGNAME   # list matching packages


Code:
pkg search TERM   # search all fields (name, descr, category, deps, etc)


... now about merging packages:

Code:
pkg merge PKGNAME,PKGNAME    # merge the give packages (not including their deps)


Code:
pkg merge PKGNAME,PKGNAME --with-deps    #  merge the given packages, including their deps


Please note: until Pkg can create .deb packages from directories (dir2deb),
and process DEB meta info better, the 'merge' (and 'split') commands will
not build 'perfect' packages yet...

_________________
Pkg, mdsh, Woofy, Akita, VLC-GTK, Search
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2741
Location: UK

PostPosted: Thu 10 Jan 2019, 18:28    Post subject:  

I've done some fixes on the `pkg merge` command, available in the latest Pkg..

- better error handling (of invalid/non/missing packages)
- completing the merge & build of the package works ok now, where found not to work before
- better output and info messages (now includes the deps added if using --with-deps)
- better suggested final package naming (includes -WITHDEPS in name if --with-deps was given)

Should now work ok for you mfb Wink (maybe...)

_________________
Pkg, mdsh, Woofy, Akita, VLC-GTK, Search
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2741
Location: UK

PostPosted: Sun 13 Jan 2019, 09:04    Post subject:  

I've done some fixes in adding Pkg created repos, listing repos, and some related stuff..

And some code clean ups .. (in case anyone wants to submit some PRs at GitLab, or post some fixes/diffs here.. hint, hint Wink )

.. If you had trouble creating and adding your own reps, re-download the latest Pkg,
and it might solve your problems.

Also added better support common32/common64 repos..

EDIT: also added some fixes and improvements to pkgdialog (the ncurses fontend)

_________________
Pkg, mdsh, Woofy, Akita, VLC-GTK, Search
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2741
Location: UK

PostPosted: Thu 24 Jan 2019, 19:36    Post subject:  

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.

_________________
Pkg, mdsh, Woofy, Akita, VLC-GTK, Search
Back to top
View user's profile Send private message 
666philb


Joined: 07 Feb 2010
Posts: 3495
Location: wales

PostPosted: Fri 25 Jan 2019, 14:02    Post subject:  

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:
 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:
#!/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
Back to top
View user's profile Send private message 
rockedge


Joined: 11 Apr 2012
Posts: 1281
Location: Connecticut, United States

PostPosted: Sat 26 Jan 2019, 12:51    Post subject:  

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.
Back to top
View user's profile Send private message Visit poster's website 
sc0ttman


Joined: 16 Sep 2009
Posts: 2741
Location: UK

PostPosted: Mon 28 Jan 2019, 08:10    Post subject:  

666philb wrote:
hi sc0ttman,

just wanted to say that pkg is brilliant.

Thanks very much Smile 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 .. Wink


666philb wrote:
BTW i've found that some apps need update-icon-caches /usr/share/icons/*
maybe worth adding

Noted, will do, thanks.

Quote:
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 Cool


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 Cool


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

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 Wink

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 ...

_________________
Pkg, mdsh, Woofy, Akita, VLC-GTK, Search
Back to top
View user's profile Send private message 
bigpup


Joined: 11 Oct 2009
Posts: 12828
Location: S.C. USA

PostPosted: Tue 29 Jan 2019, 02:05    Post subject:  

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/pet_packages-slacko14/updates_mgr-0.11.pet

It seems to use this to check what to update.
Code:
# 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:
# 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 Shocked
YaPI(any iso installer) http://www.murga-linux.com/puppy/viewtopic.php?t=107601
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2741
Location: UK

PostPosted: Tue 29 Jan 2019, 04:44    Post subject:  

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...

_________________
Pkg, mdsh, Woofy, Akita, VLC-GTK, Search
Back to top
View user's profile Send private message 
bigpup


Joined: 11 Oct 2009
Posts: 12828
Location: S.C. USA

PostPosted: Tue 29 Jan 2019, 22:49    Post subject:  

Quote:
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 Shocked
YaPI(any iso installer) http://www.murga-linux.com/puppy/viewtopic.php?t=107601
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2741
Location: UK

PostPosted: Wed 30 Jan 2019, 10:53    Post subject:  

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)...

_________________
Pkg, mdsh, Woofy, Akita, VLC-GTK, Search
Back to top
View user's profile Send private message 
belham2

Joined: 15 Aug 2016
Posts: 1694

PostPosted: Mon 11 Mar 2019, 04:45    Post subject:  

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:

Quote:
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:

Quote:

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.
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2741
Location: UK

PostPosted: Tue 12 Mar 2019, 14:20    Post subject:  

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 Wink )

_________________
Pkg, mdsh, Woofy, Akita, VLC-GTK, Search
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 6 of 10 [139 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0993s ][ Queries: 12 (0.0238s) ][ GZIP on ]