LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   slackpkg+ 1.8 (https://www.linuxquestions.org/questions/slackware-14/slackpkg-1-8-a-4175669481/)

zerouno 02-16-2020 04:00 PM

Created a test branch on github to experiment that patches
https://raw.githubusercontent.com/zu...lackpkgplus.sh

phenixia2003 02-17-2020 03:44 AM

1 Attachment(s)
Hello,

Quote:

Originally Posted by zerouno (Post 6090868)
Created a test branch on github to experiment that patches
https://raw.githubusercontent.com/zu...lackpkgplus.sh

The patch below (also attached) should solve the issue :

Code:

--- slackpkgplus.sh.orig        2020-02-17 10:52:12.134150217 +0100
+++ slackpkgplus.sh        2020-02-17 10:52:12.134150217 +0100
@@ -1101,9 +1101,14 @@
 
    for i in ${PRIORITY[@]}; do
      DIR="$i"
+      PAT=""
      if [[ "$DIR" =~ ^[-_[:alnum:]]+[:] ]] ; then  # was  if echo "$DIR" | grep -q "[a-zA-Z0-9]\+[:]" ; then
        DIR=${i/:*/}                                # was DIR=$(echo "$i" | cut -f1 -d":")
-        PAT=${i/*:/}
+
+        # extract the pattern from $i, if and only if "$i" is to the syntax <repo>:<pattern>. Without
+        # this, PAT would be set to $DIR when $i is to the syntax <repo>.
+        #
+        [[ "$DIR" =~ [:][:alnum:]+ ]] && PAT=${i/*:/}
 
        # when the current priority is of kind <REPO>:<PATTERN>, the loop must be short-circuited
        # when SEARCHSTR does not match PATTERN, otherwise, some packages could be mistakenly
@@ -1258,7 +1263,7 @@
              echo "  $STATUS#    $REPO#    $CINSTPKG"
            else
 
-              INSTPKG_REPO=$(grep -m 1 "$CINSTPKG" ${WORKDIR}/pkglist | cut -f1 -d" " | sed "s/SLACKPKGPLUS_//")
+              INSTPKG_REPO=$(grep -m 1 " $CINSTPKG " ${WORKDIR}/pkglist | cut -f1 -d" " | sed "s/SLACKPKGPLUS_//")
 
              if [ ! -z "$INSTPKG_REPO" ] && [ "$INSTPKG_REPO" != "$REPO" ] ; then
                CINSTPKG="$INSTPKG_REPO:$CINSTPKG"

Below some test I've done on a VM with default ffmpeg installed, ie. :
Code:

$ ls /var/log/packages/ffmpeg-4*
/var/log/packages/ffmpeg-4.2.2-x86_64-1



1. slackware64 has precedence over all other repository with a version of ffmpeg:

Code:

$ grep "^PKGS_PRIORITY=" /etc/slackpkg/slackpkgplus.conf
PKGS_PRIORITY=( slackpkgplus ktown testing slackware64 restricted alienbob ponce )

$ slackpkg search "ffmpeg-4"
Looking for ffmpeg-4 in package list. Please wait... DONE

The list below shows all packages with name matching "ffmpeg-4".

[ Status              ] [ Repository  ] [ Package                    ]
  installed              slackware64    ffmpeg-4.2.2-x86_64-1     
  uninstalled(masked)    alienbob        ffmpeg-4.2.1-x86_64-1alien
  uninstalled(masked)    extra          ffmpeg-4.2.2-x86_64-1_alsa
  uninstalled(masked)    ponce          ffmpeg-4.2.2-x86_64-1ponce
  uninstalled(masked)    restricted      ffmpeg-4.2.1-x86_64-1alien

2. restricted has precedence over all other repository with a version of ffmpeg:

Code:

$ grep "^PKGS_PRIORITY=" /etc/slackpkg/slackpkgplus.conf
PKGS_PRIORITY=( slackpkgplus ktown testing restricted slackware64 alienbob ponce )

$ slackpkg search "ffmpeg-4"
The list below shows all packages with name matching "ffmpeg-4".

[ Status              ] [ Repository ] [ Package                                                          ]
  uninstalled(masked)    alienbob      ffmpeg-4.2.1-x86_64-1alien                                     
  uninstalled(masked)    extra          ffmpeg-4.2.2-x86_64-1_alsa                                     
  uninstalled(masked)    ponce          ffmpeg-4.2.2-x86_64-1ponce                                     
  upgrade                restricted    slackware64:ffmpeg-4.2.2-x86_64-1 --> ffmpeg-4.2.1-x86_64-1alien

3. ponce has precedence over all other repository with a version of ffmpeg:

Code:

$ grep "^PKGS_PRIORITY=" /etc/slackpkg/slackpkgplus.conf
PKGS_PRIORITY=( slackpkgplus ktown testing ponce restricted slackware64 alienbob )

$ slackpkg search "ffmpeg-4"
The list below shows all packages with name matching "ffmpeg-4".

[ Status              ] [ Repository ] [ Package                                                          ]
  uninstalled(masked)    alienbob      ffmpeg-4.2.1-x86_64-1alien                                     
  uninstalled(masked)    extra          ffmpeg-4.2.2-x86_64-1_alsa                                     
  uninstalled(masked)    restricted    ffmpeg-4.2.1-x86_64-1alien                                     
  upgrade                ponce          slackware64:ffmpeg-4.2.2-x86_64-1 --> ffmpeg-4.2.2-x86_64-1ponce

4. extra has precedence over all other repository with a version of ffmpeg:

Code:

$ grep "^PKGS_PRIORITY=" /etc/slackpkg/slackpkgplus.conf
PKGS_PRIORITY=( slackpkgplus ktown testing extra ponce restricted slackware64 alienbob )

$ slackpkg search "ffmpeg-4"
The list below shows all packages with name matching "ffmpeg-4".

[ Status              ] [ Repository ] [ Package                                                          ]
  uninstalled(masked)    alienbob      ffmpeg-4.2.1-x86_64-1alien                                     
  uninstalled(masked)    ponce          ffmpeg-4.2.2-x86_64-1ponce                                     
  uninstalled(masked)    restricted    ffmpeg-4.2.1-x86_64-1alien                                     
  upgrade                extra          slackware64:ffmpeg-4.2.2-x86_64-1 --> ffmpeg-4.2.2-x86_64-1_alsa


--
SeB

zerouno 02-17-2020 04:15 AM

pushed on test branch

@all, ask for tests

Code:

wget -O /usr/libexec/slackpkg/functions.d/slackpkgplus.sh https://raw.githubusercontent.com/zuno/slackpkgplus/test/src/slackpkgplus.sh

chrisretusn 02-17-2020 05:27 AM

Quote:

Originally Posted by zerouno (Post 6090769)
please, try to comment row 1146

Code:

          #grep ${GREPOPTS} -q " $PKGFULLNAME " ${TMPDIR}/tmplist && continue
in /usr/libexec/slackpkg/functions/slackpkgplus.sh

That works.
Code:

The list below shows all packages with name matching "ffmpeg-4".

[ Status              ] [ Repository  ] [ Package                    ]
  installed              restricted      ffmpeg-4.2.1-x86_64-1alien
  uninstalled(masked)    alienbob        ffmpeg-4.2.1-x86_64-1alien
  uninstalled(masked)    extra          ffmpeg-4.2.2-x86_64-1_alsa
  uninstalled(masked)    slackware64    ffmpeg-4.2.2-x86_64-1     

slackpkgplus.conf:
PKGS_PRIORITY=( nonslack slackpkgplus multilib ktown testing restricted slackware64:id3lib alienbob )
REPOPLUS=( nonslack slackpkgplus multilib ktown restricted alienbob )

====== Edit, Added.

I installed the slackwre64 version "ffmpeg-4.2.2-x86_64-1" again here is the result of a search after that. This is a correct listing based on my PKGS_PRIORITY settings. Telling me that the installed ffmpeg-4.2.2 slackware64 package needs an upgrade to the restricted package ffmpeg-4.4.1 which is what my PKGS_PRIORITY setting are telling it to do.
Code:

The list below shows all packages with name matching "ffmpeg-4".

[ Status              ] [ Repository  ] [ Package                                              ]
  uninstalled(masked)    alienbob        ffmpeg-4.2.1-x86_64-1alien                         
  uninstalled(masked)    extra          ffmpeg-4.2.2-x86_64-1_alsa                         
  uninstalled(masked)    slackware64    ffmpeg-4.2.2-x86_64-1                               
  upgrade                restricted      ffmpeg-4.2.2-x86_64-1 --> ffmpeg-4.2.1-x86_64-1alien

If I modify my PKGS_PRIORITY to force the slackware64 package I get this listing.
Code:

The list below shows all packages with name matching "ffmpeg-4"; which I consider correct.

[ Status              ] [ Repository  ] [ Package                    ]
  installed              slackware64    ffmpeg-4.2.2-x86_64-1     
  uninstalled(masked)    alienbob        ffmpeg-4.2.1-x86_64-1alien
  uninstalled(masked)    extra          ffmpeg-4.2.2-x86_64-1_alsa
  uninstalled(masked)    restricted      ffmpeg-4.2.1-x86_64-1alien

slackpkgplus.conf:
PKGS_PRIORITY=( nonslack slackpkgplus multilib ktown testing slackware64:ffmpeg restricted slackware64:id3lib alienbob )


zerouno 02-17-2020 05:50 AM

Quote:

please, try to comment row 1146
this is not a solution.

Are you trying latest commit from test branch?
Code:

wget -O /usr/libexec/slackpkg/functions.d/slackpkgplus.sh https://raw.githubusercontent.com/zuno/slackpkgplus/test/src/slackpkgplus.sh
md5: 8d5387b26abcb46262b7c1696350b185

chrisretusn 02-17-2020 06:36 AM

Quote:

Originally Posted by zerouno (Post 6091013)
this is not a solution.

Are you trying latest commit from test branch?
Code:

wget -O /usr/libexec/slackpkg/functions.d/slackpkgplus.sh https://raw.githubusercontent.com/zuno/slackpkgplus/test/src/slackpkgplus.sh
md5: 8d5387b26abcb46262b7c1696350b185

That comment out was to a version I downloaded from the test; belay that; it was from the master branch last night. I will refer to the test branch for now.

I downloaded the version you just gave me. It works as well. Listing with slackware64 installed and having version priority.
Code:

PKGS_PRIORITY=( nonslack slackpkgplus multilib ktown testing slackware64:ffmpeg restricted slackware64:id3lib alienbob )

The list below shows all packages with name matching "ffmpeg-4".

[ Status              ] [ Repository  ] [ Package                    ]
  installed              slackware64    ffmpeg-4.2.2-x86_64-1     
  uninstalled(masked)    alienbob        ffmpeg-4.2.1-x86_64-1alien
  uninstalled(masked)    extra          ffmpeg-4.2.2-x86_64-1_alsa
  uninstalled(masked)    restricted      ffmpeg-4.2.1-x86_64-1alien

Listing with slackware64 version installed and restricted having priority (my preferred setup).
Code:

PKGS_PRIORITY=( nonslack slackpkgplus multilib ktown testing restricted slackware64:id3lib alienbob )

The list below shows all packages with name matching "ffmpeg-4".

[ Status              ] [ Repository ] [ Package                                                          ]
  uninstalled(masked)    alienbob      ffmpeg-4.2.1-x86_64-1alien                                     
  uninstalled(masked)    extra          ffmpeg-4.2.2-x86_64-1_alsa                                     
  upgrade                restricted    slackware64:ffmpeg-4.2.2-x86_64-1 --> ffmpeg-4.2.1-x86_64-1alien

Ha! That looks perfect. More clear than just:
Code:

  upgrade                restricted    ffmpeg-4.2.2-x86_64-1 --> ffmpeg-4.2.1-x86_64-1alien
Which was still understandable to me at least.

When running 'slackpkg -dialog=off upgrade ffmpeg' I get the following, which is the desired result based on my PKGS_PRIORITY setting.
Code:

Checking local integrity... DONE
Looking for ffmpeg in package list. Please wait... DONE

[ Repository              ] [ Package                                  ]
  restricted                  ffmpeg-4.2.1-x86_64-1alien.txz

After upgrading to the restricted version I get this, also corrected.
Code:

The list below shows all packages with name matching "ffmpeg-4".

[ Status              ] [ Repository  ] [ Package                    ]
  installed              restricted      ffmpeg-4.2.1-x86_64-1alien
  uninstalled(masked)    alienbob        ffmpeg-4.2.1-x86_64-1alien
  uninstalled(masked)    extra          ffmpeg-4.2.2-x86_64-1_alsa
  uninstalled(masked)    slackware64    ffmpeg-4.2.2-x86_64-1

Looking good to me. :hattip:

zerouno 02-17-2020 06:56 AM

Thankyou

zerouno 02-17-2020 07:02 AM

pushed on master branch

zerouno 02-17-2020 09:20 AM

Pushed in 'test' a version to manage

Code:

# Enable TERSE to use a smaller output in installpkg/upgradepkg
USETERSE=on

# Use proxy. Leave commented to use system settings.
#PROXY=off
#PROXY=<host>:<port>

in config file

zerouno 02-18-2020 02:24 AM

slackpkg+-1.7.0d1-noarch-7mt released

Code:

Tue Feb 18 08:30:10 CET 2020
pkg/slackpkg+-1.7.0d1-noarch-7mt.txz
  - Replace SPINNING with PROGRESS status
  - Small fix the Cached Downloader output
  - Added USETERSE option to enable --terse on pkgtools
  - Added PROXY to use a proxy
  - Fix for servers using HTTP/2 on checkrepos.sh
  - Fix search where there are duplicated packages (thanks phenixia2003)
  - Improved upgrade info on search (thanks phenixia2003)
  - Added Added /usr/libexec/slackpkg/zlookkernel.sh tool. Edit it to see instructions.

also test slackpkg 2.84 since slackpkg+ have to with all slackpkg-2.82.2 (slackware 14.2) slackpkg-2.83.0 (slackware current) slackpkg 2.84.0beta6 (stable at slackware 15.0 ??)

https://www.linuxquestions.org/quest...ed-4175643527/
https://slackpkg.org/beta/slackpkg-2...arch-1_rlw.txz

chrisretusn 02-18-2020 09:50 AM

Quote:

Originally Posted by zerouno (Post 6091321)
slackpkg+-1.7.0d1-noarch-7mt released

also test slackpkg 2.84 since slackpkg+ have to with all slackpkg-2.82.2 (slackware 14.2) slackpkg-2.83.0 (slackware current) slackpkg 2.84.0beta6 (stable at slackware 15.0 ??)[/url]

With these versions:
slackpkg - version 2.84.0_beta6 / slackpkg+ 1.7.0

When I run 'slackpkg search kernel' I get the following list:
Code:

[ Status          ] [ Repository              ] [ Package                                  ]
  installed              slackware64                  kernel-firmware-20200207_6f89735-noarch-1 
  installed              slackware64                  kernel-generic-5.4.20-x86_64-1           
  installed              slackware64                  kernel-headers-5.4.20-x86-1             
  installed              slackware64                  kernel-modules-5.4.20-x86_64-1           
  installed              slackware64                  kernel-source-5.4.20-noarch-1           
  uninstalled              slackware64                  kernel-huge-5.4.20-x86_64-1             
  upgrade                  slackware64                  kernel-generic-5.4.19-x86_64-1 --> kernel-generic-5.4.20-x86_64-1 
  upgrade                  slackware64                  kernel-headers-5.4.19-x86-1 --> kernel-headers-5.4.20-x86-1 
  upgrade                  slackware64                  kernel-modules-5.4.19-x86_64-1 --> kernel-modules-5.4.20-x86_64-1 
  upgrade                  slackware64                  kernel-source-5.4.19-noarch-1 --> kernel-source-5.4.20-noarch-1 

/etc/slackpkg/blacklist
kernel-generic
kernel-huge
kernel-modules
kernel-source
kernel-headers

This is what I am used to. I have two sets of kernels installed. Search used to ignore /etc/slackpkg/blacklist

With these vesions:
slackpkg - version 2.84.0_beta6 / slackpkg+ 1.7.0d1

When I run 'slackpkg search kernel' I get the following list:
Code:

[ Status    ] [ Repository  ] [ Package                                    ]
  installed    slackware64    kernel-firmware-20200207_6f89735-noarch-1

Is it possible to get this ignoring the "blacklist" for searches back?

phenixia2003 02-18-2020 10:05 AM

Hello,

Quote:

Originally Posted by chrisretusn (Post 6091411)
This is what I am used to. I have two sets of kernels installed. Search used to ignore /etc/slackpkg/blacklist

With these vesions:
slackpkg - version 2.84.0_beta6 / slackpkg+ 1.7.0d1

When I run 'slackpkg search kernel' I get the following list:
Code:

[ Status    ] [ Repository  ] [ Package                                    ]
  installed    slackware64    kernel-firmware-20200207_6f89735-noarch-1

Is it possible to get this ignoring the "blacklist" for searches back?

you can enable/disable blacklist using variable USEBL on the command line, as below :
Code:

$ USEBL=off slackpkg search kernel
The list below shows all packages with name matching "kernel".

[ Status    ] [ Repository  ] [ Package                                    ]
  installed    slackware64    kernel-firmware-20200207_6f89735-noarch-1
  installed    slackware64    kernel-generic-5.4.20-x86_64-1           
  installed    slackware64    kernel-headers-5.4.20-x86-1             
  installed    slackware64    kernel-huge-5.4.20-x86_64-1             
  installed    slackware64    kernel-modules-5.4.20-x86_64-1           
  installed    slackware64    kernel-source-5.4.20-noarch-1           

$ slackpkg search kernel

The list below shows all packages with name matching "kernel".

[ Status    ] [ Repository  ] [ Package                                    ]
  installed    slackware64    kernel-firmware-20200207_6f89735-noarch-1
  installed    slackware64    kernel-headers-5.4.20-x86-1             

You can search specific files using "slackpkg file-search file".

--
SeB

chrisretusn 02-18-2020 10:10 AM

Yes I know that. It worked before without doing that. So I'm guessing the answer to my question is no?

phenixia2003 02-18-2020 11:52 AM

Hello,

Quote:

Originally Posted by chrisretusn (Post 6091416)
Yes I know that. It worked before without doing that.

Which version of slackpkg+ ?

--
SeB

zerouno 02-18-2020 12:03 PM

slackpkg+ 1.7.0 ignore the blacklist due a bug (introduced 4 years ago), not as a feature.

starts from commit e2a831b918b62ad27bc8cd91ba679f27d8bde6f2 (slackpkg+-search-duplicate-packages-fix-V7.patch.txt)
Code:

@@ -1127,7 +1128,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
          }' l_dir=${DIR} > $PKGINFOS
 
      else # -- CMD==search
-        grep -h ${GREPOPTS} "^$DIR" ${WORKDIR}/pkglist ${TMPDIR}/pkglist-pre|grep -E ${GREPOPTS} "/SLACKPKGPLUS_$SEARCHSTR/|/$SEARCHSTR/|/$SEARCHSTR | [^ /]*$SEARCHSTR[^ /]* " > $PKGINFOS
+        grep -h ${GREPOPTS} "^$DIR" ${TMPDIR}/pkglist ${TMPDIR}/pkglist-pre|grep -E ${GREPOPTS} "/SLACKPKGPLUS_$SEARCHSTR/|/$SEARCHSTR/|/$SEARCHSTR | [^ /]*$SEARCHSTR[^ /]* " > $PKGINFOS
      fi
 
      while read PKGDIR PKGBASENAME PKGVER PKGARCH PKGBUILD PKGFULLNAME PKGPATH PKGEXT ; do

slackpkg does search in ${TMPDIR}/pkglist that means "after blacklist"
(try SLACKPKGPLUS=off slackpkg search kernel)

slackpkg+ 1.7 did search in ${WORKDIR}/pkglist that means "before blacklist" starting from commit 904088459ab6a238e6c230b5f60afd55259e2a32 (slackpkg 1.7.beta1)

In effect was a bug, not a feature :)

slackpkg+ now does search in ${WORKDIR}/pkglist that means "after blacklist"
I think this is most correct and aligned with slackpkg.

So I will add a note in changelog marking it as a fix or alignment with slackpkg or so on, since mentioned patch incidentally also fix it.
If you want to skip blacklist use USEBL=0

this is the output of slackpkg+ 1.7.alpha6 and slackpkg+ 1.6
Code:

root@beelink:/etc/slackpkg# slackpkg search kernel

DONE

The list below shows all packages with name matching "kernel".

[ Status          ] [ Repository              ] [ Package                                  ]
  upgrade                  slackware64                  kernel-firmware-20191030_9e194c7-noarch-1 --> kernel-firmware-20200207_6f89735-noarch-1 

You can search specific files using "slackpkg file-search file".



All times are GMT -5. The time now is 06:20 PM.