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 Mon 15 Oct 2018, 11:11
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 2 of 3 [38 Posts]   Goto page: Previous 1, 2, 3 Next
Author Message
sc0ttman


Joined: 16 Sep 2009
Posts: 2600
Location: UK

PostPosted: Mon 02 Apr 2018, 07:27    Post subject:  

I have moved Pkg to GitLab, people can contribute fixes here or there.

Thanks for the feedback ppl.. I have logged these issues on GitLab.

Issues: https://gitlab.com/sc0ttj/Pkg/issues


wiak:

As for better Woof integration, I think Pkg is a little rough around the edges yet, but yes, it's still my plan Wink

I have a fork of Woof locally, which I once customised a bit.. Can't remember what, but I will go back to it, keep at it, and hopefully re-write Woof to give it a CLI .. Then a dialog/ncurses frontend like buildroot, which uses Pkg/Pkgdialog as a backend ...

When I get time.... Rolling Eyes

EDIT: See example UI, with screenshot here: http://murga-linux.com/puppy/viewtopic.php?p=987466#987466


666philb:

Agreed on most points, have logged the issues in GitLab.. Would rather not rely on /usr/local/petget/postinstallhacks though, I want to remove Pkgs dependencies on PetGet where possible.

In fact, that just reminded me to log an Issue about updating the repos - Pkg currently calls /usr/local/petget/0setup to update the repos...

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search

Last edited by sc0ttman on Mon 02 Apr 2018, 15:34; edited 5 times in total
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2600
Location: UK

PostPosted: Mon 02 Apr 2018, 09:03    Post subject:  

Bugger... Can't do GitHub.. Will move to GitLab.... EDIT: Done.
_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 951
Location: not Bulgaria

PostPosted: Mon 02 Apr 2018, 20:23    Post subject:  

sc0ttman wrote:


EDIT: See example UI, with screenshot here: http://murga-linux.com/puppy/viewtopic.php?p=987466#987466


Yeah, that looks good - if all that will be incorporated in a new woof-CE that would be a big change in the Puppy world. A lot of work to implement all that functionality though - or have you made a start on that?

wiak
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 951
Location: not Bulgaria

PostPosted: Mon 02 Apr 2018, 20:23    Post subject:  

sc0ttman wrote:


EDIT: See example UI, with screenshot here: http://murga-linux.com/puppy/viewtopic.php?p=987466#987466


Yeah, that looks good - if all that will be incorporated in a new woof-CE that would be a big change in the Puppy world. A lot of work to implement all that functionality though - or have you made a start on that?

wiak
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2600
Location: UK

PostPosted: Sat 07 Apr 2018, 18:19    Post subject:  

It's just a demo, but I wanted something (slightly) concrete that represents the end goal ...
_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2600
Location: UK

PostPosted: Sun 08 Apr 2018, 18:31    Post subject:  

Updated on GitLab:

fixes and updates to Gpkgdialog:
- fixes packages not installing properly if not in WORKDIR
- fixes output and logging of installs, uninstalls etc
- uses new --quiet option added to Pkg
- added option to force (re-)install of package
- added option to install pkg at bottom of package status window


Will do some more fixes then post an updated PET later.

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2600
Location: UK

PostPosted: Sat 14 Apr 2018, 19:13    Post subject:  

Updated on GitLab:

Code:
  added new commands: `pkg add` and `pkg remove`:
    - `pkg add PKGNAME` is just an alias for `pkg get`, and works the same (installs a pkg and its deps)
    - `pkg remove PKGNAME` uninstalls a package, and its unused, left over deps
    - can also use `pkg rm PKGNAME` too
    - updated help info, usage docs and example commands to match
    - added some advanced example commands too

  fixes for --ask and --force options:
    - only ask user once at start to install/download a pkg
    - only ask user once at start to get a pkg and its deps
    - only ask user once at start to get pkg deps
    - fixed --force option with download command
    - so using --force to download will re-download a pkg, not skip it

  added support for blacklisted packages:
    - get PKG_NAME_IGNORE from /root/.packages/PKGS_MANAGEMENT
    - skip/ignore packages and deps in various places if found in $PKG_NAME_IGNORE
    - this fixes (for example) libglib2.0-0 being installed and breaking Gtk file choosers in Stretch


To install Pkg via GitLab, load the devx for your Puppy and simply run these commands:

Code:

# download and install Pkg from GitLab
cd ~
mkdir -p GitLab/Pkg
cd GitLab/Pkg
git clone https://gitlab.com/sc0ttj/Pkg.git .
./installer.sh

# setup Pkg
source /etc/bash_completion.d/pkg
pkg update-sources
pkg repo-update
pkg repo-list

# choose a repo.. for example
pkg repo stretch-main

# now your ready to use Pkg :)


If you installed Pkg using Git, you can update Pkg by doing this:

Code:
#update to latest git version
git pull origin master
./installer.sh


With the latest versions (commit 16e4d11e and later) you can now do these commands:

Code:
# download and install a package, and its deps
pkg add vlc

# uninstall a package, and uninstall its unused/left-over deps
pkg rm vlc


I will upload a new PET after a few more fixes and stuff...

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2600
Location: UK

PostPosted: Wed 18 Apr 2018, 10:52    Post subject: Promoting puppy around the web
Subject description: (using Pkg)
 

Promoting Puppy using Pkg

Many popular Linux packages/apps put easy install instructions on their project pages, in the form of copy and paste commands for popular package managers.

For example, many sites list apt-get, pacman, yum (etc) commands, so users of different distros can easily install stuff.

What's my point?

Puppy is never listed alongside the other distros, cos it doesn't have any command line package manager ... So no copy & paste stuff for Puppy users...

How to fix this?

If Pkg (or another CLI package manager) is included in most Puppys by default, we could

1. Request app and package developers update their pages with Puppy friendly, copy & paste install instructions.

2. Do pull requests on Github on popular projects, and add the setup/installation commands into their READMEs ourselves.

Why bother?

Puppy will then be listed alongside the other major distros on many popular software homepages and repos. Free advertising.

We can show off the "super simple, easy to use" nature of Puppy by having 1 simple command, like the other distros:

Code:
pkg add vlc

Puppys name will be out there more, letting people know Puppy is a valid alternative to the other distros listed - with all the same great apps available, and just as easy to use.

...The bottom line is, once we have an easy CLI way to install/remove packages, we can put those commands on popular software homepages and repos, and Puppy will be more visible online, sitting alongside the most well-known distros, offering easy installation of popular software, just like the big boys Smile

... just a thought...

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2600
Location: UK

PostPosted: Tue 01 May 2018, 08:41    Post subject:  

Latest changes (on GitLab):

1. Pkg should now support BionicPup and ArtfulPup out of the box.

2. Fixes to Xenial, Tahr, Precise and trusty repo settings.

3. Improvements to `pkg update [pkgname]` # find newer packages in the repos

4. Improvements to `pkg combine <pkgname>` # combine a package and its deps

5. Improvements to `pkg ldd <pkgname>` ' # check missing libs of given package, and its deps

6. Improvements to package compiling with Buildpet.

When using Buildpet as the compiling backend (not the default petbuild), Pkg now supports the following:

Code:
pkg build xarchiver --configure='--prefix=/usr/local --other-opts' --cflags='-D -02 -whatever'


This means, that you can now customise the packages you build on a per package basis.

You could also pass the options as ENVIRONMENT variables:

Code:
PKG_CONFIGURE="--prefix=/usr/local" PKG_CFLAGS='-02' pkg build xarchiver


Or, you could set and export them before calling Pkg, and use those options for all packages you build Smile

Code:
export PKG_CONFIGURE='(your opts)'
export PKG_CFLAGS='(your opts)'

pkg build xarchiver


NOTE: Only the xarchiver buildscript has been updated to support these features for now - use it as a test or example of how to update the other build scripts (in /usr/share/buildpet/).

Essentially, you just replace "/usr" with ${BASE_INSTALL_PREFIX} everywhere in the build script, and you should be good to go Smile

These buildpet scripts are included in Pkg by default, but need updating, and also fixing to support these new options.

TO USE THESE NEW BUILDPET FEATURES:

Set BUILDTOOL=buildpet in ~/.pkg/pkgrc, then run

Code:
pkg build xarchiver [your configure and CFLAG opts here]


To install the latest Pkg from GitLab, load the devx, and run these commands:

Code:
cd /root
rm -rf gitlab/pkg/
mkdir -p gitlab/pkg
cd gitlab/pkg
git clone https://gitlab.com/sc0ttj/Pkg.git .
./installer.sh

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search

Last edited by sc0ttman on Tue 01 May 2018, 15:54; edited 1 time in total
Back to top
View user's profile Send private message 
Dry Falls

Joined: 16 Dec 2014
Posts: 571
Location: Upper Columbia

PostPosted: Tue 01 May 2018, 11:16    Post subject:  

Quote:
To
install the latest Pkg from GitLab, load the devx, and run these
commands:

Code:
cd /root
rm -rf gitlab/pkg/
mkdir -p gitlab/pkg
cd gitlab/pkg
git clone https://gitlab.com/sc0ttj/Pkg.git .
./installer.sh

Since the clone command doesn't follow symlinks, to install into
lighthouse (which isn't a woofCE build) add this after running the
above:
Code:
cp -R /root/gitlab/pkg/usr/lib/pkg /usr/lib64

and everything works great!

Thanks, sc0ttman.

df
Back to top
View user's profile Send private message 
rockedge


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

PostPosted: Fri 08 Jun 2018, 11:18    Post subject:  

I have PKG installed..did it sort of wildcat....downloaded extracted ran install.sh...worked......on Bionic 18.05 kernel 4.17 woof-CE built yesterday.

will do more extensive tests....this will really help in the installation instructions for running a LAMP or LHMP with zoneminder on puppy linux.
Back to top
View user's profile Send private message Visit poster's website 
sc0ttman


Joined: 16 Sep 2009
Posts: 2600
Location: UK

PostPosted: Tue 14 Aug 2018, 21:34    Post subject:  

Most recent updates on GitLab (since May 01, my last post):

- fix for 64-bit systems: moved /usr/lib/pkg to /usr/share/pkg
- fixed setup of TAB completion on first run
- fixed `pkg LI <search-term>` not filtering the list
- fixed `pkg update [pkgname]` listing malformed package names
- fixes in `pkg contents <pkgname>` make it more reliable
- fixes in Petbuild initialisation
- fixes in Buildpets parsing of the Pkg --configure option when it contains quotes
- fixed buildpet & all build scripts to correctly support --configure and --cflags params (see previous posts)
- added /usr/share/pkg/command_not_found_handle.sh (can replace default "Command not found" message with package suggestions, like apt-get)
- added available ENV vars to help output and READMEs
- added more examples to READMEs

To update, or install, see previous posts. Basically:

Code:
rm -rf ~/Gitlab/Pkg
mkdir -p ~/Gitlab/Pkg
git clone http://gitlab.com/sc0ttj/Pkg ~/Gitlab/Pkg
cd ~/Gitlab/Pkg
./installer.sh



Then, to get started, run this command and follow instructions:

Code:
pkg welcome



To replace the default 'Command not found' message with package suggestions,
add the following to your ~/.bashrc file, or type it into the console and hit ENTER:

Code:
source /usr/share/pkg/command_not_found_handle.sh


To get the default 'Command not found' message back:

Code:
unset command_not_found_handle

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
aaaaa


Joined: 22 May 2018
Posts: 25

PostPosted: Mon 03 Sep 2018, 22:06    Post subject:  

Woofce will get rid of the multi arch symlink soon
This will cause a conflict with external scripts and stuff
...but this patch fixes compatibility with woofce:

pkg-woofce_no_multiarch_symlink.patch
Code:

--- pkg-orig   2018-09-03 19:35:36.000000000 +0800
+++ pkg   2018-09-03 19:43:26.000000000 +0800
@@ -3215,22 +3215,27 @@
                   dpkg-deb --contents ${CURDIR}/${PKGNAME}.deb | grep -v '/$' | tr -s ' ' | cut -f6 -d' ' | sed -e 's/^.//g' | grep -v '^$' > $HOME/.packages/${PKGNAME}.files
                fi
 
-               pkg_has_archdir="$(grep -m1 "$DISTRO_ARCHDIR" "$HOME/.packages/${PKGNAME}.files")"
-
-               # Workaround to avoid overwriting the $DISTRO_ARCHDIR symlink. 
-               if [ "$DISTRO_ARCHDIR" != "" -a -f $HOME/.packages/${PKGNAME}.files -a "$pkg_has_archdir" != "" ]; then
-                  mkdir -p /tmp/$PKGNAME
-                  rm -rf /tmp/$PKGNAME/*
-                  dpkg-deb -x ${CURDIR}/${PKGNAME}.deb /tmp/$PKGNAME/ 2> $TMPDIR/$SELF-cp-errlog
-                  for f in $(find /tmp/$PKGNAME \( -type f -o -type l \))
-                  do
-                   xpath=$(echo "$f" |  cut  -f 4-30 -d "/" | sed "s/$DISTRO_ARCHDIR\///")
-                   mkdir -p ${DIRECTSAVEPATH}/$(dirname "$xpath")
-                   cp -a "$f" ${DIRECTSAVEPATH}/$(dirname "$xpath")/
-                 done
-                 rm -rf /tmp/$PKGNAME &>/dev/null
+               # woofce: NO_MULTIARCH_SYMLINK=1 (DISTRO_SPECS)
+               if [ -z "$NO_MULTIARCH_SYMLINK" ] ; then
+                  pkg_has_archdir="$(grep -m1 "$DISTRO_ARCHDIR" "$HOME/.packages/${PKGNAME}.files")"
+
+                  # Workaround to avoid overwriting the $DISTRO_ARCHDIR symlink. 
+                  if [ "$DISTRO_ARCHDIR" != "" -a -f $HOME/.packages/${PKGNAME}.files -a "$pkg_has_archdir" != "" ]; then
+                     mkdir -p /tmp/$PKGNAME
+                     rm -rf /tmp/$PKGNAME/*
+                     dpkg-deb -x ${CURDIR}/${PKGNAME}.deb /tmp/$PKGNAME/ 2> $TMPDIR/$SELF-cp-errlog
+                     for f in $(find /tmp/$PKGNAME \( -type f -o -type l \))
+                     do
+                      xpath=$(echo "$f" |  cut  -f 4-30 -d "/" | sed "s/$DISTRO_ARCHDIR\///")
+                      mkdir -p ${DIRECTSAVEPATH}/$(dirname "$xpath")
+                      cp -a "$f" ${DIRECTSAVEPATH}/$(dirname "$xpath")/
+                    done
+                    rm -rf /tmp/$PKGNAME &>/dev/null
+                  else
+                     dpkg-deb -x ${CURDIR}/${PKGNAME}.deb ${DIRECTSAVEPATH}/ 2> $TMPDIR/$SELF-cp-errlog
+                  fi
                else
-                  dpkg-deb -x ${CURDIR}/${PKGNAME}.deb ${DIRECTSAVEPATH}/ 2> $TMPDIR/$SELF-cp-errlog
+                  dpkg-deb -x ${CURDIR}/${PKGNAME}.deb ${DIRECTSAVEPATH}/ 2> $TMPDIR/$SELF-cp-errlog
                fi
 
                if [ "`cat $TMPDIR/$SELF-cp-errlog | grep 'tar: Exiting with failure status due to previous errors'`" != "" ];then
@@ -3451,34 +3456,37 @@
           fi
          done
 
-         #121217 it seems that this problem is occurring in other modes (13 reported)...
-         #121123 having a problem with multiarch symlinks in full-installation...
-         #it seems that the symlink is getting replaced by a directory.
-         if [ "$DISTRO_ARCHDIR" ];then #in /etc/rc.d/DISTRO_SPECS. 130112 change test from DISTRO_ARCHDIR. 130114 revert DISTRO_ARCHDIR_SYMLINKS==yes.
-           if [ -d /usr/lib/${DISTRO_ARCHDIR} ];then
-            if [ ! -h /usr/lib/${DISTRO_ARCHDIR} ];then
-            cp -a -f --remove-destination /usr/lib/${DISTRO_ARCHDIR}/* /usr/lib/
-            sync
-            rm -r -f /usr/lib/${DISTRO_ARCHDIR}
-            ln -s ./ /usr/lib/${DISTRO_ARCHDIR}
-            fi
-           fi
-           if [ -d /lib/${DISTRO_ARCHDIR} ];then
-            if [ ! -h /lib/${DISTRO_ARCHDIR} ];then
-            cp -a -f --remove-destination /lib/${DISTRO_ARCHDIR}/* /lib/
-            sync
-            rm -r -f /lib/${DISTRO_ARCHDIR}
-            ln -s ./ /lib/${DISTRO_ARCHDIR}
-            fi
-           fi
-           if [ -d /usr/bin/${DISTRO_ARCHDIR} ];then
-            if [ ! -h /usr/bin/${DISTRO_ARCHDIR} ];then
-            cp -a -f --remove-destination /usr/bin/${DISTRO_ARCHDIR}/* /usr/bin/
-            sync
-            rm -r -f /usr/bin/${DISTRO_ARCHDIR}
-            ln -s ./ /usr/bin/${DISTRO_ARCHDIR}
-            fi
-           fi
+         # woofce: NO_MULTIARCH_SYMLINK=1 (DISTRO_SPECS)
+         if [ -z "$NO_MULTIARCH_SYMLINK" ] ; then
+            #121217 it seems that this problem is occurring in other modes (13 reported)...
+            #121123 having a problem with multiarch symlinks in full-installation...
+            #it seems that the symlink is getting replaced by a directory.
+            if [ "$DISTRO_ARCHDIR" ];then #in /etc/rc.d/DISTRO_SPECS. 130112 change test from DISTRO_ARCHDIR. 130114 revert DISTRO_ARCHDIR_SYMLINKS==yes.
+              if [ -d /usr/lib/${DISTRO_ARCHDIR} ];then
+               if [ ! -h /usr/lib/${DISTRO_ARCHDIR} ];then
+               cp -a -f --remove-destination /usr/lib/${DISTRO_ARCHDIR}/* /usr/lib/
+               sync
+               rm -r -f /usr/lib/${DISTRO_ARCHDIR}
+               ln -s ./ /usr/lib/${DISTRO_ARCHDIR}
+               fi
+              fi
+              if [ -d /lib/${DISTRO_ARCHDIR} ];then
+               if [ ! -h /lib/${DISTRO_ARCHDIR} ];then
+               cp -a -f --remove-destination /lib/${DISTRO_ARCHDIR}/* /lib/
+               sync
+               rm -r -f /lib/${DISTRO_ARCHDIR}
+               ln -s ./ /lib/${DISTRO_ARCHDIR}
+               fi
+              fi
+              if [ -d /usr/bin/${DISTRO_ARCHDIR} ];then
+               if [ ! -h /usr/bin/${DISTRO_ARCHDIR} ];then
+               cp -a -f --remove-destination /usr/bin/${DISTRO_ARCHDIR}/* /usr/bin/
+               sync
+               rm -r -f /usr/bin/${DISTRO_ARCHDIR}
+               ln -s ./ /usr/bin/${DISTRO_ARCHDIR}
+               fi
+              fi
+            fi
          fi
 
          #flush unionfs cache, so files in pup_save layer will appear "on top"...


How to apply the patch.. place the file in the same location as pkg and run:

Code:

patch pkg < pkg-woofce_no_multiarch_symlink.patch
pkg-woofce_no_multiarch_symlink.patch_fake.gz
Description 
gz

 Download 
Filename  pkg-woofce_no_multiarch_symlink.patch_fake.gz 
Filesize  4.89 KB 
Downloaded  11 Time(s) 
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2600
Location: UK

PostPosted: Sun 09 Sep 2018, 17:37    Post subject:  

Thanks mate.. I will integrate it into Pkg soon Smile
_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2600
Location: UK

PostPosted: Sat 15 Sep 2018, 12:05    Post subject:  

Hi aaaaa,

I have added your patch, but had to do it manually as the latest Pkg had some changes in that area of the script..

Please could you grab the latest version from Gitlab (https://gitlab.com/sc0ttj/Pkg/-/archive/master/Pkg-master.tar.gz) and test it is OK (at some point, no rush...) ..

(I already installed a few more packages since applying the changes, seems OK.. )

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 3 [38 Posts]   Goto page: Previous 1, 2, 3 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.2432s ][ Queries: 13 (0.0205s) ][ GZIP on ]