LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-12-2016, 04:54 PM   #421
zerouno
Member
 
Registered: Oct 2009
Location: Italy
Distribution: Slackware
Posts: 983

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352

Quote:
Originally Posted by phenixia2003 View Post
Note: the times includes the time required to print results.
I made a patch to reduce time to print results (searchlistEX) when there are many matches; about 4 seconds to show 1800 packages.

I post it before commit becouse I have some questions of some part of that code.



Code:
--- a/src/slackpkgplus.sh
+++ b/src/slackpkgplus.sh
@@ -955,22 +955,17 @@ if [ "$SLACKPKGPLUS" = "on" ];then
     local PNAME
 
     printf "[ -16s ] [ -24s ] [ -40s ]\n" "Status" "Repository" "Package"
-    for i in $1; do
-      REPO=$(echo "$i" | cut -f1 -d":")
-      PNAME=$(echo "$i" | cut -f2- -d":")
 
-      if echo "$REPO" | grep -q "SLACKPKGPLUS_" ; then
-        REPO=$(echo "$REPO" | cut -f2- -d"_")
-      else
-        REPO=""
-      fi
+    INSTPKGS="$(ls -f $ROOT/var/log/packages)"
 
-      if [ -z "$REPO" ] && [ "$BASENAME" = "$(cutpkg ${PNAME})" ]; then
-        continue
-      fi
+    for i in $1; do
+      REPO=${i/:*/} #$(echo "$i" | cut -f1 -d":")
+      PNAME=${i/*:/} #PNAME=$(echo "$i" | cut -f2- -d":")
+
+      REPO=${REPO/SLACKPKGPLUS_/}     #REPO=$(echo "$REPO" | cut -f2- -d"_")
 
       # BASENAME is base package name
-      BASENAME="$(cutpkg ${PNAME})"
+      BASENAME=${PNAME%-*-*-*}        #BASENAME="$(cutpkg ${PNAME})"
 
       # RAWNAME is Latest available version
       RAWNAME="${PNAME/%.t[blxg]z/}"
@@ -981,8 +976,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
       # First is the package already installed?
       # Amazing what a little sleep will do
       # exclusion is so much nicer :)
-      INSTPKG=$(ls -1 $ROOT/var/log/packages | grep -e "^${BASENAME}-[^-]\+-[^-]\+-[^-]\+$")
-      #INSTPKG=$(ls -1 $ROOT/var/log/packages | grep -e "^${BASENAME}-[^-]\+-\(${ARCH}\|fw\|noarch\)-[^-]\+")
+      INSTPKG=$(echo "$INSTPKGS"|grep "^${BASENAME}-[^-]\+-[^-]\+-[^-]\+$")
 
       # INSTPKG is local version
       if [ ! "${INSTPKG}" = "" ]; then

modification:
Code:
-      if echo "$REPO" | grep -q "SLACKPKGPLUS_" ; then
-        REPO=$(echo "$REPO" | cut -f2- -d"_")
-      else
-        REPO=""
-      fi
with this code slackpkg search does not show if a package is in slackware/ extra/ patches/ ...; simply does not show the repository name if it is an official package. Removing it and substituting with
Code:
REPO=${REPO/SLACKPKGPLUS_/}
the repository name for official packages is showned.




Code:
-      if [ -z "$REPO" ] && [ "$BASENAME" = "$(cutpkg ${PNAME})" ]; then
-        continue
-      fi
with this code if the package is an official package and it is duplicated, it should be skipped.
Without this code the package should be showned.
However,
Code:
# slackpkg search xf86-video-nouveau
[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled          slackware                    xf86-video-nouveau-1.0.12-i586-1          

# grep xf86-video-nouveau /var/lib/slackpkg/pkglist
slackware xf86-video-nouveau 1.0.12 i586 1 xf86-video-nouveau-1.0.12-i586-1 ./slackware/x txz
extra xf86-video-nouveau blacklist noarch 1 xf86-video-nouveau-blacklist-noarch-1 ./extra/xf86-video-nouveau-blacklist txz
searchlistEX() is invoked with the only slackware:xf86-video-nouveau-1.0.12-i586-1 parameter.



Since I may failed to interpret the code, I wait a your response before commit.

Also please, post the patch for improving searchPackages()


P.S: I found another bashism in slackpkg
Code:
function cutpkg() {
  echo ${1/%.t[blxg]z/} | awk -F- -f /usr/libexec/slackpkg/cutpkg.awk
}
However I think that cutpkg.awk is not the best in performance
Code:
OFS="-" { 
        if ( NF > 3 ) { 
                NF=NF-3
                print $0 
        } else {
                print $0
        }
}
For our use I think that
Code:
BASENAME=${PNAME%-*-*-*}
should be equivalent (with best performance)

Last edited by zerouno; 01-13-2016 at 04:03 AM.
 
1 members found this post helpful.
Old 01-13-2016, 04:33 AM   #422
phenixia2003
Senior Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 1,052

Rep: Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008
Hello,

Quote:
Originally Posted by zerouno View Post
I made a patch to reduce time to print results (searchlistEX) when there are many matches; about 4 seconds to show 1800 packages.

I post it before commit becouse I have some questions of some part of that code.

modification:
Code:
-      if echo "$REPO" | grep -q "SLACKPKGPLUS_" ; then
-        REPO=$(echo "$REPO" | cut -f2- -d"_")
-      else
-        REPO=""
-      fi
with this code slackpkg search does not show if a package is in slackware/ extra/ patches/ ...; simply does not show the repository name if it is an official package. Removing it and substituting with
Code:
REPO=${REPO/SLACKPKGPLUS_/}
the repository name for official packages is showned.
Good.


Quote:
Originally Posted by zerouno View Post
Code:
-      if [ -z "$REPO" ] && [ "$BASENAME" = "$(cutpkg ${PNAME})" ]; then
-        continue
-      fi
with this code if the package is an official package and it is duplicated, it should be skipped.
Without this code the package should be showned.
Well, I checked it and this code seems totally useless.

searchlistEX() is an adaptation of searchlist() from slackpkg (ie. in core-functions.sh), in which there's the same kind of code :

Code:
            if [ "$BASENAME" = "$(cutpkg ${i})" ]; then
                continue
            fi
I did some test, and I find no case where this code is executed !

Quote:
Originally Posted by zerouno View Post
However,
Code:
# slackpkg search xf86-video-nouveau
[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled          slackware                    xf86-video-nouveau-1.0.12-i586-1          

# grep xf86-video-nouveau /var/lib/slackpkg/pkglist
slackware xf86-video-nouveau 1.0.12 i586 1 xf86-video-nouveau-1.0.12-i586-1 ./slackware/x txz
extra xf86-video-nouveau blacklist noarch 1 xf86-video-nouveau-blacklist-noarch-1 ./extra/xf86-video-nouveau-blacklist txz
searchlistEX() is invoked with the only slackware:xf86-video-nouveau-1.0.12-i586-1 parameter.

Since I may failed to interpret the code, I wait a your response before commit.
As I said in this post, xf86-video-nouveau-blacklist misleads slackpkg because its name does not follow the "standard" naming scheme (ie. <basename>-<version>-<arch>-<build>), and slackpkg interprets the substring "blacklist" as being the version number. Therefore, this package is excluded by searchPackages() and is never shown.

If you edit /var/lib/slackpkg/pkglist, and change the line related to xf86-video-nouveau-blacklist this way :
Code:
extra xf86-video-nouveau-blacklist NOVER noarch 1 xf86-video-nouveau-blacklist-NOVER-noarch-1 ./extra/xf86-video-nouveau-blacklist txz
slackpkg will found it :
Code:
$ slackpkg search xf86-video-nouveau
DONE

The list below shows all packages with name matching "xf86-video-nouveau".

[ Status           ] [ Repository               ] [ Package                                  ]
   installed                                        xf86-video-nouveau-1.0.9-x86_64-2         
  uninstalled                                       xf86-video-nouveau-blacklist-NOVER-noarch-1  

You can search specific files using "slackpkg file-search file".
For information purpose, here is how search works (in both slackpkg and slackpkg+) :

1. The user run slackpkg PATTERN.

2. searchPackages() is called with PATTERN in argument. It selects all packages that match this PATTERN. The selected packages are filtered according to their priorities. Therefore, when two packages A and B have the same basename, but A has precedence over B, the package B is deselected.

Nota: slackpkg has no searchPackages(). The filtering is done in a case statement (~ line #700 in core-functions.sh).

3. searchListEX() is called with the package selected in (2). For each selected package, a status is computed according to the installed packages (ie. installed, uninstalled, upgrade).

Nota: slackpkg has no searchListEX() and uses searchlist().


Quote:
Originally Posted by zerouno View Post
Also please, post the patch for improving searchPackages()
Sure => slackpkg+-optimized-searchpackages.diff.txt (ie. for slackpkg+ git/devel) :
Code:
--- slackpkgplus.sh.git	2016-01-13 11:03:14.165340859 +0100
+++ slackpkgplus.sh	2016-01-13 11:34:41.704425081 +0100
@@ -887,8 +887,8 @@
 
     for i in ${PRIORITY[@]}; do
       DIR="$i"
-      if echo "$DIR" | grep -q "^[-_[:alnum:]]\+[:]" ; then
-        DIR=$(echo "$i" | cut -f1 -d":")
+      if [[ "$DIR" =~ ^[-_[:alnum:]]+[:] ]] ; then 	# was  if echo "$DIR" | grep -q "[a-zA-Z0-9]\+[:]" ; then
+	DIR=${DIR/:*/}					# was DIR=$(echo "$i" | cut -f1 -d":")
       fi
 
       if [ "$CMD" == "file-search" ] ; then
@@ -917,11 +917,13 @@
       fi
 
       while read PKG ; do
-        PKGDIR=$(echo "$PKG" | cut -f1 -d" ")
-        PKGBASENAME=$(echo "$PKG" | cut -f2 -d" ")
-        PKGFULLNAME=$(echo "$PKG" | cut -f6 -d" ")
+	PKGDATA=( $PKG ) # PKGDATA([0]=DIR,[1]=BASENMAE,[5]=FULLNAME)
 
-        if echo "$PKGDIR" | grep -q "SLACKPKGPLUS_" ; then
+        PKGDIR=${PKGDATA[0]} 		# was PKGDIR=$(echo "$PKG" | cut -f1 -d" ")
+        PKGBASENAME=${PKGDATA[1]}	# was PKGBASENAME=$(echo "$PKG" | cut -f2 -d" ")
+        PKGFULLNAME=${PKGDATA[5]}	# was PKGFULLNAME=$(echo "$PKG" | cut -f6 -d" ")
+
+	if [[ "$PKGDIR" =~ ^SLACKPKGPLUS_ ]] ; then # was if echo "$PKGDIR" | grep -q "SLACKPKGPLUS_" ; then
           grep -q "^repository:${PKGDIR}:basename:${PKGBASENAME}:" $PKGLIST && continue
         else
           grep -q ":basename:${PKGBASENAME}:" $PKGLIST  && continue
Some samples (done with output disabled) :
Code:
$ time slackpkg search slackware64
DONE

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

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

real    0m4.806s
user    0m3.199s
sys     0m0.311s
The old version gives (output disabled) :
Code:
$ time slackpkg search slackware64
DONE

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

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

real    0m18.313s
user    0m10.236s
sys     0m1.097s


Quote:
Originally Posted by zerouno View Post
However I think that cutpkg.awk is not the best in performance

For our use I think that
Code:
BASENAME=${PNAME%-*-*-*}
should be equivalent (with best performance)
Sure.

--
SeB
 
Old 01-13-2016, 05:22 AM   #423
zerouno
Member
 
Registered: Oct 2009
Location: Italy
Distribution: Slackware
Posts: 983

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
Thankyou.

xf86-video-nouveau-blacklist-noarch-1.txz is not a package with unconvenzional name.
it is the package xf86-video-nouveau where the version is 'blacklist'

it must not be installed with
# installpkg xf86-video-nouveau-blacklist-noarch-1.txz
but
# upgradepkg xf86-video-nouveau-blacklist-noarch-1.txz
it will remove xf86-video-nouveau-1.0.12-i586-1 and install xf86-video-nouveau-blacklist-noarch-1.txz

slackpkg upgrade xf86-video-nouveau-blacklist
works.

should be no reason becouse both xf86-video-nouveau-1.0.12 xf86-video-nouveau-blacklist are installed on the system, but this is OT here (personally I leave installed the 1.0.12 version and manually blacklist it).


I can use another package, as e2fsprogs, to explain the same thing.
Code:
grep e2fsprogs /var/lib/slackpkg/pkglist
slackware64 e2fsprogs 1.42.13 x86_64 2 e2fsprogs-1.42.13-x86_64-2 ./slackware64/a txz
testing e2fsprogs 1.43_WIP_20150518 x86_64 1 e2fsprogs-1.43_WIP_20150518-x86_64-1 ./testing/packages txz
I think that slackpkg search e2fsprogs should print both.




I will install your searchpackages patch.
 
Old 01-13-2016, 08:37 AM   #424
phenixia2003
Senior Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 1,052

Rep: Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008
Hello,

Quote:
Originally Posted by zerouno View Post
xf86-video-nouveau-blacklist-noarch-1.txz is not a package with unconvenzional name.
it is the package xf86-video-nouveau where the version is 'blacklist'
When two packages have the same name, I expect to see two different versions of the same software. Here, this is not the case :
  • xf86-video-nouveau contains the nouveau video driver for X11
  • xf86-video-nouveau-blacklist contains a single configuration file to prevent the nouveau kernel driver from being loaded.

But As you said, this is off topic.

Quote:
Originally Posted by zerouno View Post
I can use another package, as e2fsprogs, to explain the same thing.
Code:
grep e2fsprogs /var/lib/slackpkg/pkglist
slackware64 e2fsprogs 1.42.13 x86_64 2 e2fsprogs-1.42.13-x86_64-2 ./slackware64/a txz
testing e2fsprogs 1.43_WIP_20150518 x86_64 1 e2fsprogs-1.43_WIP_20150518-x86_64-1 ./testing/packages txz
I think that slackpkg search e2fsprogs should print both.
I guess that you want something like that :
Code:
$ slackpkg search xf86-video-nouveau

DONE

The list below shows all packages with name matching "xf86-video-nouveau".

[ Status           ] [ Repository               ] [ Package                                  ]
   installed           slackware64                  xf86-video-nouveau-1.0.9-x86_64-2         
  uninstalled (masked)     extra                        xf86-video-nouveau-blacklist-noarch-1     

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

-----------------------------------------------------------------------
$ slackpkg search glibc

DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled          multilib                     glibc-debug-2.17_multilib-x86_64-10alien  
   installed           multilib                     glibc-2.17_multilib-x86_64-10alien        
   installed           multilib                     glibc-i18n-2.17_multilib-x86_64-10alien   
   installed           multilib                     glibc-profile-2.17_multilib-x86_64-10alien  
   installed           multilib                     glibc-solibs-2.17_multilib-x86_64-10alien  
  upgrade              multilib                     glibc-zoneinfo-2015c_multilib-noarch-1alien --> glibc-zoneinfo-2015g_multilib-noarch-1alien  
  uninstalled (masked)     patches                      glibc-2.17-x86_64-10_slack14.1            
  uninstalled (masked)     patches                      glibc-i18n-2.17-x86_64-10_slack14.1       
  uninstalled (masked)     patches                      glibc-profile-2.17-x86_64-10_slack14.1    
  uninstalled (masked)     patches                      glibc-solibs-2.17-x86_64-10_slack14.1     
  uninstalled (masked)     patches                      glibc-zoneinfo-2015g-noarch-1_slack14.1   
  uninstalled (masked)     slackware64                  glibc-solibs-2.17-x86_64-7                
  uninstalled (masked)     slackware64                  glibc-zoneinfo-2013d-noarch-7             
  uninstalled (masked)     slackware64                  glibc-2.17-x86_64-7                       
  uninstalled (masked)     slackware64                  glibc-i18n-2.17-x86_64-7                  
  uninstalled (masked)     slackware64                  glibc-profile-2.17-x86_64-7               

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

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

$ slackpkg search vlc

DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled          restricted                   npapi-vlc-20150301-x86_64-1alien          
  uninstalled          restricted                   vlc-2.2.1-x86_64-1alien                   
  uninstalled          ktown                        phonon-vlc-0.8.1-x86_64-1alien            
  uninstalled (masked)     alienbob                     npapi-vlc-20150301-x86_64-1alien          
  uninstalled (masked)     alienbob                     vlc-2.2.1-x86_64-1alien
To add this to slackpkg+ (git/devel latest) you need the patch slackpkg+-advanced-search.diff.txt (beta, requires more tests) :
Code:
--- slackpkgplus.sh.git	2016-01-13 14:59:31.903171203 +0100
+++ slackpkgplus.sh	2016-01-13 15:37:32.726272974 +0100
@@ -880,7 +880,7 @@
     # -- PKGLIST:
     #      temporary file used to store data about packages. It uses
     #      the following format:
-    #        repository:<repository_name>:basename:<package_basename>:
+    #        repository:<repository_name>:basename:<package_basename>:version:<package_version>
     #
     PKGLIST=$(tempfile --directory=$TMPDIR)
     PKGINFOS=$(tempfile --directory=$TMPDIR)
@@ -917,19 +917,22 @@
       fi
 
       while read PKG ; do
-	PKGDATA=( $PKG ) # PKGDATA([0]=DIR,[1]=BASENMAE,[5]=FULLNAME)
+	PKGDATA=( $PKG ) # PKGDATA([0]=DIR,[1]=BASENAME, [2]=VERSION, [5]=FULLNAME)
 
 	PKGDIR=${PKGDATA[0]} 		# was PKGDIR=$(echo "$PKG" | cut -f1 -d" ")
 	PKGBASENAME=${PKGDATA[1]}	# was PKGBASENAME=$(echo "$PKG" | cut -f2 -d" ")
+	PKGVER=${PKGDATA[2]}
 	PKGFULLNAME=${PKGDATA[5]}	# was PKGFULLNAME=$(echo "$PKG" | cut -f6 -d" ")
 
-	if [[ "$PKGDIR" =~ ^SLACKPKGPLUS_ ]] ; then # was if echo "$PKGDIR" | grep -q "SLACKPKGPLUS_" ; then
-          grep -q "^repository:${PKGDIR}:basename:${PKGBASENAME}:" $PKGLIST && continue
-        else
-          grep -q ":basename:${PKGBASENAME}:" $PKGLIST  && continue
-        fi
+	grep -q "^repository:${PKGDIR}:basename:${PKGBASENAME}:version:${PKGVER}" $PKGLIST && continue
+
+	if grep -q ":basename:${PKGBASENAME}:" $PKGLIST ; then
+	        LIST="$LIST MASKED_${PKGDIR}:${PKGFULLNAME}"
+		continue
+	fi
+
         LIST="$LIST ${PKGDIR}:${PKGFULLNAME}"
-        echo "repository:${PKGDIR}:basename:${PKGBASENAME}:" >> $PKGLIST
+        echo "repository:${PKGDIR}:basename:${PKGBASENAME}:version:${PKGVER}" >> $PKGLIST
       done < $PKGINFOS
     done
     rm -f $PKGLIST $PKGINFOS
@@ -975,10 +978,16 @@
       # Default is uninstalled
       STATUS="uninstalled"
 
-      # First is the package already installed?
-      # Amazing what a little sleep will do
-      # exclusion is so much nicer :)
-      INSTPKG=$(echo "$INSTPKGS"|grep "^${BASENAME}-[^-]\+-[^-]\+-[^-]\+$")
+      if [[ $REPO =~ ^MASKED_.* ]] ; then
+	REPO=${REPO/MASKED_/}
+	STATUS="uninstalled (masked)"
+	INSTPKG=""
+      else
+	      # First is the package already installed?
+	      # Amazing what a little sleep will do
+	      # exclusion is so much nicer :)
+	      INSTPKG=$(echo "$INSTPKGS"|grep "^${BASENAME}-[^-]\+-[^-]\+-[^-]\+$")
+      fi
 
       # INSTPKG is local version
       if [ ! "${INSTPKG}" = "" ]; then
@@ -1549,7 +1558,6 @@
   if [ "$CMD" == "search" ] || [ "$CMD" == "file-search" ] ; then
     PATTERN=$(echo $ARG | sed -e 's/\+/\\\+/g' -e 's/\./\\\./g' -e 's/ /\|/g')
     searchPackages $PATTERN
-
     case $CMD in
       search)
         if [ "$LIST" = "" ]; then
Cheers.

--
SeB
 
Old 01-13-2016, 09:04 AM   #425
zerouno
Member
 
Registered: Oct 2009
Location: Italy
Distribution: Slackware
Posts: 983

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
Yes, a similar thing.
A tag "masked" seems to be a good idea to indicate that the package will not shown in slackpkg install/upgrade (unless you specify full name or repository name



Seeing the patch, I think (not tried) that may be also some case of "Installed (masked)".

Code:
   installed           multilib                     glibc-2.17_multilib-x86_64-10alien        
  uninstalled (masked)     patches                      glibc-2.17-x86_64-10_slack14.1
becouse you have PKG_PRIORITY=( multilib )
If you comment it (but not remove the repository) you will have the first that is installed, but slackpkg will presents you the second when you will run slackpkg upgrade-all

Last edited by zerouno; 01-13-2016 at 09:06 AM.
 
Old 01-13-2016, 10:25 AM   #426
phenixia2003
Senior Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 1,052

Rep: Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008
Hello,

Quote:
Originally Posted by zerouno View Post
Yes, a similar thing.
A tag "masked" seems to be a good idea to indicate that the package will not shown in slackpkg install/upgrade (unless you specify full name or repository name
Forget the previous patch, it does not work as it should (sorry) :
Code:
$ grep ^PKGS_PRIORITY /etc/slackpkg/slackpkgplus.conf
PKGS_PRIORITY=( patches multilib alienbob_current restricted ktown )

$ slackpkg search glibc
slackpkg search glibc


NOTICE: remember to re-run 'slackpkg update' after modifying slackpkgplus.conf

DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
  upgrade              patches                      glibc-2.17_multilib-x86_64-10alien --> glibc-2.17-x86_64-10_slack14.1  
  upgrade              patches                      glibc-i18n-2.17_multilib-x86_64-10alien --> glibc-i18n-2.17-x86_64-10_slack14.1  
  upgrade              patches                      glibc-profile-2.17_multilib-x86_64-10alien --> glibc-profile-2.17-x86_64-10_slack14.1  
  upgrade              patches                      glibc-solibs-2.17_multilib-x86_64-10alien --> glibc-solibs-2.17-x86_64-10_slack14.1  
  upgrade              patches                      glibc-zoneinfo-2015c_multilib-noarch-1alien --> glibc-zoneinfo-2015g-noarch-1_slack14.1  
  uninstalled          multilib                     glibc-debug-2.17_multilib-x86_64-10alien  
  uninstalled (masked)     multilib                     glibc-2.17_multilib-x86_64-10alien        
  uninstalled (masked)     multilib                     glibc-i18n-2.17_multilib-x86_64-10alien   
  uninstalled (masked)     multilib                     glibc-profile-2.17_multilib-x86_64-10alien  
  uninstalled (masked)     multilib                     glibc-solibs-2.17_multilib-x86_64-10alien  
  uninstalled (masked)     multilib                     glibc-zoneinfo-2015g_multilib-noarch-1alien  
  uninstalled (masked)     slackware64                  glibc-solibs-2.17-x86_64-7                
  uninstalled (masked)     slackware64                  glibc-zoneinfo-2013d-noarch-7             
  uninstalled (masked)     slackware64                  glibc-2.17-x86_64-7                       
  uninstalled (masked)     slackware64                  glibc-i18n-2.17-x86_64-7                  
  uninstalled (masked)     slackware64                  glibc-profile-2.17-x86_64-7               
  uninstalled (masked)     multilib                     glibc-2.17_multilib-x86_64-10alien        
  uninstalled (masked)     multilib                     glibc-i18n-2.17_multilib-x86_64-10alien   
  uninstalled (masked)     multilib                     glibc-profile-2.17_multilib-x86_64-10alien  
  uninstalled (masked)     multilib                     glibc-solibs-2.17_multilib-x86_64-10alien  
  uninstalled (masked)     multilib                     glibc-zoneinfo-2015g_multilib-noarch-1alien  

You can search specific files using "slackpkg file-search file".
The patch slackpkg+-advanced-search-2.diff.txt works better (but always beta) :
Code:
$ slackpkg search glibc


NOTICE: remember to re-run 'slackpkg update' after modifying slackpkgplus.conf

DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
  upgrade              patches                      glibc-2.17_multilib-x86_64-10alien --> glibc-2.17-x86_64-10_slack14.1  
  upgrade              patches                      glibc-i18n-2.17_multilib-x86_64-10alien --> glibc-i18n-2.17-x86_64-10_slack14.1  
  upgrade              patches                      glibc-profile-2.17_multilib-x86_64-10alien --> glibc-profile-2.17-x86_64-10_slack14.1  
  upgrade              patches                      glibc-solibs-2.17_multilib-x86_64-10alien --> glibc-solibs-2.17-x86_64-10_slack14.1  
  upgrade              patches                      glibc-zoneinfo-2015c_multilib-noarch-1alien --> glibc-zoneinfo-2015g-noarch-1_slack14.1  
  uninstalled          multilib                     glibc-debug-2.17_multilib-x86_64-10alien  
  uninstalled (masked)     multilib                     glibc-zoneinfo-2015g_multilib-noarch-1alien  
  uninstalled (masked)     slackware64                  glibc-solibs-2.17-x86_64-7                
  uninstalled (masked)     slackware64                  glibc-zoneinfo-2013d-noarch-7             
  uninstalled (masked)     slackware64                  glibc-2.17-x86_64-7                       
  uninstalled (masked)     slackware64                  glibc-i18n-2.17-x86_64-7                  
  uninstalled (masked)     slackware64                  glibc-profile-2.17-x86_64-7               

You can search specific files using "slackpkg file-search file".
Quote:
Originally Posted by zerouno View Post
Seeing the patch, I think (not tried) that may be also some case of "Installed (masked)".

Code:
   installed           multilib                     glibc-2.17_multilib-x86_64-10alien        
  uninstalled (masked)     patches                      glibc-2.17-x86_64-10_slack14.1
becouse you have PKG_PRIORITY=( multilib )
If you comment it (but not remove the repository) you will have the first that is installed, but slackpkg will presents you the second when you will run slackpkg upgrade-all
I don't really understand what you mean. If you comment PKGS_PRIORITY (or remove multilib from it), the glibc packages from patches will be proposed as upgrade. For instance:

With PKGS_PRIORITY=( multilib alienbob_current restricted ktown )

Code:
$ slackpkg search glibc-solibs
DONE

The list below shows all packages with name matching "glibc-solibs".

[ Status           ] [ Repository               ] [ Package                                  ]
   installed           multilib                     glibc-solibs-2.17_multilib-x86_64-10alien  
  uninstalled (masked)     patches                      glibc-solibs-2.17-x86_64-10_slack14.1     
  uninstalled (masked)     slackware64                  glibc-solibs-2.17-x86_64-7
Now, with PKGS_PRIORITY=( alienbob_current restricted ktown ) :

Code:
$ slackpkg search glibc-solibs
DONE

The list below shows all packages with name matching "glibc-solibs".

[ Status           ] [ Repository               ] [ Package                                  ]
  upgrade              patches                      glibc-solibs-2.17_multilib-x86_64-10alien --> glibc-solibs-2.17-x86_64-10_slack14.1  
  uninstalled (masked)     slackware64                  glibc-solibs-2.17-x86_64-7
When a package is proposed as upgrade, that means the installed version is implicitly masked. Therefore, I don't think it would be great to duplicate that kind of packages in the printed list, like in the pseudo-output below :

Code:
[ Status           ] [ Repository               ] [ Package                                  ]
  upgrade              patches                      glibc-solibs-2.17_multilib-x86_64-10alien --> glibc-solibs-2.17-x86_64-10_slack14.1  
  uninstalled (masked)     slackware64                  glibc-solibs-2.17-x86_64-7                
  installed (masked)   multilib                     glibc-solibs-2.17_multilib-x86_64-10alien
Anyway, if you want it, this should be doable.

--
SeB

Last edited by phenixia2003; 01-13-2016 at 10:27 AM.
 
Old 01-13-2016, 01:22 PM   #427
zerouno
Member
 
Registered: Oct 2009
Location: Italy
Distribution: Slackware
Posts: 983

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
Quote:
When a package is proposed as upgrade, that means the installed version is implicitly masked
I did not think about it. Yes, it's ok.

I made some small modification, but I do not commit it now.
I sorted the output, so to group by Status.

note: I have substituted 'while read PKG' and next rows with
'while read PKGDIR PKGBASENAME PKGVER PKGARCH PKGBUILD PKGFULLNAME PKGPATH PKGEXT'
It should not add other performance but the code is more clear.

Code:
--- a/src/slackpkgplus.sh                                                                                                                               
+++ b/src/slackpkgplus.sh
@@ -913,25 +913,36 @@ if [ "$SLACKPKGPLUS" = "on" ];then
           }' l_dir=${DIR} > $PKGINFOS
 
       else # -- CMD==search
-        grep ${GREPOPTS} "^${DIR}.*${SEARCHSTR}" "${TMPDIR}/pkglist" > $PKGINFOS
+        grep ${GREPOPTS} "^${DIR}.*\(/${SEARCHSTR}[/ ]\)\|\( [^/ ]*${SEARCHSTR}[^/ ]* \)" "${TMPDIR}/pkglist" > $PKGINFOS
       fi
 
-      while read PKG ; do
-        PKGDATA=( $PKG ) # PKGDATA([0]=DIR,[1]=BASENMAE,[5]=FULLNAME)
+      while read PKGDIR PKGBASENAME PKGVER PKGARCH PKGBUILD PKGFULLNAME PKGPATH PKGEXT ; do
 
-        PKGDIR=${PKGDATA[0]}        # was PKGDIR=$(echo "$PKG" | cut -f1 -d" ")
-        PKGBASENAME=${PKGDATA[1]}   # was PKGBASENAME=$(echo "$PKG" | cut -f2 -d" ")
-        PKGFULLNAME=${PKGDATA[5]}   # was PKGFULLNAME=$(echo "$PKG" | cut -f6 -d" ")
+          # does nothing when the package has been handled ...
+        grep -q "^repo:${PKGDIR}:bname:${PKGBASENAME}:ver:${PKGVER}:fname:${PKGFULLNAME}:" $PKGLIST && continue
 
-        if [[ "$PKGDIR" =~ ^SLACKPKGPLUS_ ]] ; then # was if echo "$PKGDIR" | grep -q "SLACKPKGPLUS_" ; then
-          grep -q "^repository:${PKGDIR}:basename:${PKGBASENAME}:" $PKGLIST && continue
+         # When a package P' with the same basename has been handled before the current package, this means 
+         # the package P' has precedence over P. 
+
+        if grep -q ":bname:${PKGBASENAME}:" $PKGLIST ; then
+
+          # if the current package P is installed, this means the previous P' will be
+          # proposed as an upgrade to P. In this case, the loop must continue without
+          # any other action...
+          grep -q " $PKGFULLNAME " ${TMPDIR}/tmplist && continue
+
+          # The current package P is not installed. In this case P must be shown as
+          # being uninstalled and masked.
+          LIST="$LIST MASKED_${PKGDIR}:${PKGFULLNAME}" 
         else
-          grep -q ":basename:${PKGBASENAME}:" $PKGLIST  && continue
+          LIST="$LIST ${PKGDIR}:${PKGFULLNAME}" 
         fi
-        LIST="$LIST ${PKGDIR}:${PKGFULLNAME}"
-        echo "repository:${PKGDIR}:basename:${PKGBASENAME}:" >> $PKGLIST
+
+        echo "repo:${PKGDIR}:bname:${PKGBASENAME}:ver:${PKGVER}:fname:${PKGFULLNAME}:" >> $PKGLIST
+
       done < $PKGINFOS
     done
+
     rm -f $PKGLIST $PKGINFOS
 
     LIST=$(echo -e $LIST | tr \  "\n" | uniq )
@@ -975,10 +986,17 @@ if [ "$SLACKPKGPLUS" = "on" ];then
       # Default is uninstalled
       STATUS="uninstalled"
 
-      # First is the package already installed?
-      # Amazing what a little sleep will do
-      # exclusion is so much nicer :)
-      INSTPKG=$(echo "$INSTPKGS"|grep "^${BASENAME}-[^-]\+-[^-]\+-[^-]\+$")
+      if [[ $REPO =~ ^MASKED_.* ]] ; then
+        REPO=${REPO/MASKED_/}
+        STATUS="uninstalled(masked)"
+        INSTPKG=""
+      else
+        # First is the package already installed?
+        # Amazing what a little sleep will do
+        # exclusion is so much nicer :)
+        INSTPKG=$(echo "$INSTPKGS"|grep "^${BASENAME}-[^-]\+-[^-]\+-[^-]\+$")
+      fi
+
 
       # INSTPKG is local version
       if [ ! "${INSTPKG}" = "" ]; then
@@ -994,17 +1012,17 @@ if [ "$SLACKPKGPLUS" = "on" ];then
             # If installed is it uptodate?
             if [ "${CINSTPKG}" = "${RAWNAME}" ]; then
               STATUS=" installed "
-              printf "  -16s     %-24s     %-40s  \n" "$STATUS" "$REPO" "$CINSTPKG"
+              printf "  %-20s     %-24s     %-40s  \n" "$STATUS" "$REPO" "$CINSTPKG"
             else
               STATUS="upgrade"
-              printf "  %-16s     %-24s     %-40s  \n" "$STATUS" "$REPO" "$CINSTPKG --> ${RAWNAME}"
+              printf "  %-20s     %-24s     %-40s  \n" "$STATUS" "$REPO" "$CINSTPKG --> ${RAWNAME}"
             fi
           fi
         done
       else
-        printf "  %-16s     %-24s     %-40s  \n" "$STATUS" "$REPO" "${RAWNAME}"
+        printf "  %-20s     %-24s     %-40s  \n" "$STATUS" "$REPO" "${RAWNAME}"
       fi
-    done
+    done|sort
   } # END function searchlistEX()
 
Old 01-13-2016, 03:21 PM   #428
zerouno
Member
 
Registered: Oct 2009
Location: Italy
Distribution: Slackware
Posts: 983

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
slackpkg+-1.7.a4-noarch-2mt fix $ROOT slackpkg upgrade bug in slackpkg+

I think that it is another patch to backport to 1.6.1 tree.
Do you think?


edit: if someone want to test it under slackpkg 1.6.1 the patch for both bug (the other is that) is:
Code:
--- slackpkgplus.sh-orig
+++ slackpkgplus.sh
@@ -507,9 +507,9 @@ if [ "$SLACKPKGPLUS" = "on" ];then
 
     grep -vE "(^#|^[[:blank:]]*$)" ${CONF}/blacklist > ${TMPDIR}/blacklist
     if echo $CMD | grep -q install ; then
-      ls -1 $ROOT/var/log/packages/* | awk -f /usr/libexec/slackpkg/pkglist.awk > ${TMPDIR}/tmplist
+      ( cd $ROOT ; ls -1 ./var/log/packages/* ) | awk -f /usr/libexec/slackpkg/pkglist.awk > ${TMPDIR}/tmplist
     else
-      ls -1 $ROOT/var/log/packages/* | awk -f /usr/libexec/slackpkg/pkglist.awk | applyblacklist > ${TMPDIR}/tmplist
+      ( cd $ROOT ; ls -1 ./var/log/packages/* ) | awk -f /usr/libexec/slackpkg/pkglist.awk | applyblacklist > ${TMPDIR}/tmplist
     fi
     cat ${WORKDIR}/pkglist | applyblacklist > ${TMPDIR}/pkglist
 
@@ -528,7 +528,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
     for i in ${PRIORITY[@]}; do
       DIR="$i"
       if echo "$DIR" | grep -q "[a-zA-Z0-9]\+[:]" ; then
-              DIR=$(echo "$i" | cut -f2- -d":")
+        DIR=$(echo "$i" | cut -f1 -d":")
       fi
 
       if [ "$CMD" == "file-search" ] ; then
thankyou

Last edited by zerouno; 01-13-2016 at 03:44 PM.
 
Old 01-15-2016, 03:22 AM   #429
nk_
LQ Newbie
 
Registered: Jan 2016
Distribution: Slackware
Posts: 11

Rep: Reputation: 5
Don't work greylist for slackpkg clean-system , but blacklist works fine.
slackware-current
slackpkg+-1.6.1-noarch-7mt
slackpkg-2.82.0-noarch-16
1) w/o sbopkg in greylist and blacklist
Code:
# cat /etc/slackpkg/greylist | grep sbopkg
#sbopkg

# cat /etc/slackpkg/blacklist | grep sbopkg
#sbopkg

# slackpkg clean-system
                  ┌──────────────────────────────remove────────────────────────────────┐
                  │ Choose packages to remove:                                         │  
                  │ ┌────────────────────────────────────────────────────────────────┐ │  
                  │ │[*] chromaprint-1.2-i686-1_SBo                     │ │  
                  │ │[*] gparted-0.24.0-i686-1_SBo                      │ │  
                  │ │[*] sbopkg-0.37.1-noarch-1_wsr                     │ │  
                  │ │[*] xdotool-3.20150503.1-i686-2_SBo                │ │
2) with sbopkg in blacklist
Code:
# cat /etc/slackpkg/greylist | grep sbopkg 
#sbopkg

# cat /etc/slackpkg/blacklist | grep sbopkg
sbopkg

# slackpkg clean-system                    
                  ┌──────────────────────────────remove────────────────────────────────┐
                  │ Choose packages to remove:                                         │  
                  │ ┌────────────────────────────────────────────────────────────────┐ │  
                  │ │[*] chromaprint-1.2-i686-1_SBo                     │ │  
                  │ │[*] gparted-0.24.0-i686-1_SBo                      │ │  
                  │ │[*] xdotool-3.20150503.1-i686-2_SBo                │ │
3) with sbopkg in greylist
Code:
# cat /etc/slackpkg/greylist | grep sbopkg
sbopkg

# cat /etc/slackpkg/blacklist | grep sbopkg
#sbopkg

# slackpkg clean-system                    
                  ┌──────────────────────────────remove────────────────────────────────┐
                  │ Choose packages to remove:                                         │  
                  │ ┌────────────────────────────────────────────────────────────────┐ │  
                  │ │[*] chromaprint-1.2-i686-1_SBo                     │ │  
                  │ │[*] gparted-0.24.0-i686-1_SBo                      │ │  
                  │ │[*] sbopkg-0.37.1-noarch-1_wsr                     │ │  
                  │ │[*] xdotool-3.20150503.1-i686-2_SBo                │ │
 
Old 01-15-2016, 04:43 AM   #430
phenixia2003
Senior Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 1,052

Rep: Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008
Hello,

Quote:
Originally Posted by nk_ View Post
Don't work greylist for slackpkg clean-system , but blacklist works fine.
The greylist has no effect when running slackpkg clean-system because of the two points below :

1. The action clean-system allows to remove packages which are not "standard" (ie. not from slackware, nor from the configured 3rd party repositories).

2. Only "standard" packages (ie. from slackware, and from the configured 3rd pary repositories) can be on the greylist.



--
SeB
 
Old 01-15-2016, 05:22 AM   #431
zerouno
Member
 
Registered: Oct 2009
Location: Italy
Distribution: Slackware
Posts: 983

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
Greylist is bugged, and I'm fixing it.
 
Old 01-15-2016, 07:52 AM   #432
zerouno
Member
 
Registered: Oct 2009
Location: Italy
Distribution: Slackware
Posts: 983

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
please try that patch. Should work with both devel and stable version.
Code:
--- slackpkgplus.sh
+++ slackpkgplus.sh
@@ -1050,7 +1050,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
       if [ "$GREYLIST" == "off" ];then
         >$TMPDIR/greylist
       fi
-      grep -Ew -f $TMPDIR/greylist $TMPDIR/pkglist|awk '{print $2}' >$TMPDIR/unchecklist
+#      grep -Ew -f $TMPDIR/greylist $TMPDIR/pkglist|awk '{print $2}' >$TMPDIR/unchecklist
       rm -f $TMPDIR/dialog.tmp
       
       if [ "$2" = "upgrade" ]; then
@@ -1064,7 +1064,8 @@ if [ "$SLACKPKGPLUS" = "on" ];then
           PKGVER=$(echo $i|rev|cut -f3 -d-|rev)
           ALLFOUND=$(echo $(grep " ${BASENAME} " $TMPDIR/pkglist|sed -r -e 's/SLACKPKGPLUS_//' -e 's/^([^ ]*) [^ ]* ([^ ]*) [^ ]* ([^ ]*) .*/\2-\3(\1) ,/')|sed 's/,$//')
 
-          grep -q "^$(echo $i|rev|cut -f4- -d-|rev)$" $TMPDIR/unchecklist && TMPONOFF="off"
+          grep -m1 " ${BASENAME} " $TMPDIR/pkglist|grep -q -Ew -f $TMPDIR/greylist && TMPONOFF="off"
+          #grep -q "^$(echo $i|rev|cut -f4- -d-|rev)$" $TMPDIR/unchecklist && TMPONOFF="off"
           echo "$REPOPOSFULL $i \"$REPOPOS\" $TMPONOFF \"installed: $PKGFOUND  -->  available: $ALLFOUND\"" >>$TMPDIR/dialog.tmp.1
         done
 
@@ -1086,7 +1087,8 @@ if [ "$SLACKPKGPLUS" = "on" ];then
         for i in $1; do
           TMPONOFF=$ONOFF
           REPOPOS=$(grep -m1 " $(echo $i|sed 's/\.t.z//') "  $TMPDIR/pkglist|awk '{print $1}'|sed 's/SLACKPKGPLUS_//')
-          grep -q "^$(echo $i|rev|cut -f4- -d-|rev)$" $TMPDIR/unchecklist && TMPONOFF="off"
+          grep -m1 " $(echo $i|sed 's/\.t.z//') "  $TMPDIR/pkglist| grep -q -Ew -f $TMPDIR/greylist && TMPONOFF="off"
+          #grep -q "^$(echo $i|rev|cut -f4- -d-|rev)$" $TMPDIR/unchecklist && TMPONOFF="off"
           echo "$i \"$REPOPOS\" $TMPONOFF" >>$TMPDIR/dialog.tmp
         done
         HINT=""
I've not full tested it.
 
Old 01-15-2016, 09:29 AM   #433
zerouno
Member
 
Registered: Oct 2009
Location: Italy
Distribution: Slackware
Posts: 983

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
for 1.6.1 release the patch is
Code:
--- a/src/zdialogplus.sh
+++ b/src/zdialogplus.sh
@@ -24,7 +24,6 @@ if [ "$SLACKPKGPLUS" = "on" ];then
                if [ "$GREYLIST" == "off" ];then
                  >$TMPDIR/greylist
                fi
-               grep -Ew -f $TMPDIR/greylist $TMPDIR/pkglist|awk '{print $2}' >$TMPDIR/unchecklist
                rm -f $TMPDIR/dialog.tmp
 
                if [ "$2" = "upgrade" ]; then
@@ -38,7 +37,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
                                PKGVER=$(echo $i|rev|cut -f3 -d-|rev)
                                ALLFOUND=$(echo $(grep " ${BASENAME} " $TMPDIR/pkglist|sed -r -e 's/SLACKPKGPLUS_//' -e 's/^([^ ]*) [^ ]* ([^ ]*) [^ ]* ([^ ]*) .*/\2-\3(\1) ,/')|sed 's/,$//')
 
-                               grep -q "^$(echo $i|rev|cut -f4- -d-|rev)$" $TMPDIR/unchecklist && TMPONOFF="off"
+                               grep -m1 " ${BASENAME} " $TMPDIR/pkglist|grep -q -Ew -f $TMPDIR/greylist && TMPONOFF="off"
                                echo "$REPOPOSFULL $i \"$REPOPOS\" $TMPONOFF \"installed: $PKGFOUND  -->  available: $ALLFOUND\"" >>$TMPDIR/dialog.tmp.1
                        done
 # 1         2                  3      4    5 6                                7             8   9 1011                               12-
@@ -58,7 +57,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
                        for i in $1; do
                                TMPONOFF=$ONOFF
                                 REPOPOS=$(grep -m1 " $(echo $i|sed 's/\.t.z//') "  $TMPDIR/pkglist|awk '{print $1}'|sed 's/SLACKPKGPLUS_//')
-                               grep -q "^$(echo $i|rev|cut -f4- -d-|rev)$" $TMPDIR/unchecklist && TMPONOFF="off"
+                               grep -m1 " $(echo $i|sed 's/\.t.z//') "  $TMPDIR/pkglist| grep -q -Ew -f $TMPDIR/greylist && TMPONOFF="off"
                                echo "$i \"$REPOPOS\" $TMPONOFF" >>$TMPDIR/dialog.tmp
                        done
                        HINT=""
Also the /etc/slackpkg/greylist has
Code:
#do not upgrade packages installed with sbopkg; use it instead
#_SBo
The correct is
Code:
#do not upgrade packages installed with sbopkg; use it instead
#[0-9]+_SBo
That patch does not add the support for the clean-system greylist
Attached Files
File Type: txt greylistfix1.6.1.txt (1.6 KB, 12 views)
 
Old 01-15-2016, 11:53 AM   #434
zerouno
Member
 
Registered: Oct 2009
Location: Italy
Distribution: Slackware
Posts: 983

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
Since I'm trying to make a slackpkg+ LTS, I'm experimenting a stable branch on github that I will use to backport the patches from devel branch and test before sync it into the master branch and release the new package.
I had a private branch on my pc for that, but I think that is a best way to pubblish it.

The stable branch has currently the three previously posted fix.
 
Old 01-15-2016, 02:33 PM   #435
zerouno
Member
 
Registered: Oct 2009
Location: Italy
Distribution: Slackware
Posts: 983

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
That works with slackpkg+-1.7.a4-noarch-2mt (should works also with 1.6.1, but probably it will not be backported).

Code:
--- a/src/slackpkgplus.sh
+++ b/src/slackpkgplus.sh
@@ -1032,7 +1032,6 @@ if [ "$SLACKPKGPLUS" = "on" ];then
       if [ "$GREYLIST" == "off" ];then
         >$TMPDIR/greylist
       fi
-      grep -Ew -f $TMPDIR/greylist $TMPDIR/pkglist|awk '{print $2}' >$TMPDIR/unchecklist
       rm -f $TMPDIR/dialog.tmp
       
       if [ "$2" = "upgrade" ]; then
@@ -1046,7 +1045,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
           PKGVER=$(echo $i|rev|cut -f3 -d-|rev)
           ALLFOUND=$(echo $(grep " ${BASENAME} " $TMPDIR/pkglist|sed -r -e 's/SLACKPKGPLUS_//' -e 's/^([^ ]*) [^ ]* ([^ ]*) [^ ]* ([^ ]*) .*/\2-\3(\1) ,/')|sed 's/,$//')
 
-          grep -q "^$(echo $i|rev|cut -f4- -d-|rev)$" $TMPDIR/unchecklist && TMPONOFF="off"
+         ( echo $PKGFOUND ; grep -m1 " ${BASENAME} " $TMPDIR/pkglist ) |grep -q -Ew -f $TMPDIR/greylist && TMPONOFF="off"
           echo "$REPOPOSFULL $i \"$REPOPOS\" $TMPONOFF \"installed: $PKGFOUND  -->  available: $ALLFOUND\"" >>$TMPDIR/dialog.tmp.1
         done
 
@@ -1068,7 +1067,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
         for i in $1; do
           TMPONOFF=$ONOFF
           REPOPOS=$(grep -m1 " $(echo $i|sed 's/\.t.z//') "  $TMPDIR/pkglist|awk '{print $1}'|sed 's/SLACKPKGPLUS_//')
-          grep -q "^$(echo $i|rev|cut -f4- -d-|rev)$" $TMPDIR/unchecklist && TMPONOFF="off"
+         ( echo $i;grep -m1 " $(echo $i|sed 's/\.t.z//') "  $TMPDIR/pkglist ) | grep -q -Ew -f $TMPDIR/greylist && TMPONOFF="off"
           echo "$i \"$REPOPOS\" $TMPONOFF" >>$TMPDIR/dialog.tmp
         done
         HINT=""
It will greylist also the installed packages, so if you have
[0-9]+_SBo
in your greylist, running slackpkg upgrade-all the packages installed (for example virtualbox-4.3.30-i486-1_SBo) with sbopkg will be not overwritten by default with virtualbox-4.3.30-i486-1_other.

If I install a my own package with installpkg, slackpkg clean-system will not uninstall it by default.
Attached Files
File Type: txt greylistfix1.7.a4-2.txt (1.8 KB, 8 views)
 
  


Reply

Tags
slackpkg


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Holding a package update from slackpkg gazj Slackware 2 01-25-2011 04:58 PM
Where can I find a 3rd Party Repository for RHEL 5? tightlikethat Linux - Newbie 3 02-27-2010 08:46 PM
Best 3rd Party RPM Repository for FC9 kromberg Fedora 11 11-13-2008 08:04 PM
Package Kit Error-- "Cannot retrieve repository metadata (repomd.xml) for repository" mbvpixies78 Linux - Newbie 11 08-22-2008 07:20 PM
3rd party package managers? crontab Slackware 3 10-06-2007 10:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration