LinuxQuestions.org
Help answer threads with 0 replies.
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 10-10-2016, 11:00 AM   #631
phenixia2003
Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 889

Rep: Reputation: 772Reputation: 772Reputation: 772Reputation: 772Reputation: 772Reputation: 772Reputation: 772

Hello,

Quote:
Originally Posted by nk_ View Post
Hi, zerouno and phenixia2003
can you help me, I don't know why packages not found with this actions:
Code:
...
# slackpkg search vlc

Looking for vlc in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled              alien                        npapi-vlc-20160706-x86_64-1alien          
  uninstalled              alien                        vlc-2.2.4-x86_64-1alien                   
  uninstalled(masked)      alien_restricted             npapi-vlc-20160706-x86_64-1alien          
  uninstalled(masked)      alien_restricted             vlc-2.2.4-x86_64-1alien                   

You can search specific files using "slackpkg file-search file".
Code:
# slackpkg install vlc-2.2.4
# slackpkg search vlc

Looking for vlc in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
   installed               alien                        vlc-2.2.4-x86_64-1alien                   
  uninstalled              alien                        npapi-vlc-20160706-x86_64-1alien          
  uninstalled(masked)      alien_restricted             npapi-vlc-20160706-x86_64-1alien          

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

# ls /var/log/packages/ | grep vlc
vlc-2.2.4-x86_64-1alien
Where are in search vlc package from alien repository (vlc-2.2.4-x86_64-1alien)?

Code:
# removepkg vlc
# slackpkg search vlc

Looking for vlc in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled              alien                        npapi-vlc-20160706-x86_64-1alien          
  uninstalled              alien                        vlc-2.2.4-x86_64-1alien                   
  uninstalled(masked)      alien_restricted             npapi-vlc-20160706-x86_64-1alien          
  uninstalled(masked)      alien_restricted             vlc-2.2.4-x86_64-1alien                   

You can search specific files using "slackpkg file-search file".
In the given case, search does not work as expected because vlc from repositories alienbob and restricted have the exact same name, therefore, the search function of slackpkg+ can't distinguish them and ignore the second: From restricted in your case, but that would be the one from alienbob if you give precedence to restricted repository :
Code:
$ grep "^PKGS_PRIORITY" /etc/slackpkg/slackpkgplus.conf
PKGS_PRIORITY=( alienbob restricted )

$ slackpkg search vlc
Looking for vlc in package list. Please wait...DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
   installed               alienbob                     npapi-vlc-20160706-x86_64-1alien          
  uninstalled              alienbob                     vlc-2.2.4-x86_64-1alien                   
  uninstalled(masked)      restricted                   vlc-2.2.4-x86_64-1alien                   


$ slackpkg install vlc
...

$ slackpkg search vlc

Looking for vlc in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
   installed               alienbob                     npapi-vlc-20160706-x86_64-1alien          
   installed               alienbob                     vlc-2.2.4-x86_64-1alien         

$ slackpkg remove vlc
          

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

$ slackpkg install vlc
...

$ slackpkg search vlc

Looking for vlc in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
   installed               restricted                   npapi-vlc-20160706-x86_64-1alien          
   installed               restricted                   vlc-2.2.4-x86_64-1alien                   

You can search specific files using "slackpkg file-search file".
The only way to solve this would be that restricted and alienbob don't share, at least, the same build numbers (ex: packages from alienbob with an even number, and the packages from restricted with odd number)

--
SeB

Last edited by phenixia2003; 10-10-2016 at 11:14 AM.
 
Old 10-11-2016, 03:05 AM   #632
phenixia2003
Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 889

Rep: Reputation: 772Reputation: 772Reputation: 772Reputation: 772Reputation: 772Reputation: 772Reputation: 772
Hello,

Quote:
Originally Posted by nk_ View Post
Hi, zerouno and phenixia2003
can you help me, I don't know why packages not found with this actions:

[code]# slackpkg install vlc-2.2.4
# slackpkg search vlc

Looking for vlc in package list. Please wait... DONE

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

[ Status ] [ Repository ] [ Package ]
installed alien vlc-2.2.4-x86_64-1alien
uninstalled alien npapi-vlc-20160706-x86_64-1alien
uninstalled(masked) alien_restricted npapi-vlc-20160706-x86_64-1alien

You can search specific files using "slackpkg file-search file".
Even if it would be better that all repositories use, at least, different build ID, I've implemented the patch slackpkg+-search-duplicate-packages-fix.patch.txt to fix this issue :

Code:
--- slackpkgplus.sh.org	2016-10-11 09:40:12.650732937 +0200
+++ slackpkgplus.sh	2016-10-11 09:40:12.650732937 +0200
@@ -1018,8 +1018,16 @@
     #      the following format:
     #        repo:<repository_name>:bname:<package_basename>:ver:<package_version>:fname:<package_fullname>:
     #
+    #    HDLPKGS:
+    #      temporary file used to store data about packages already handled when CMD=search
+    #      to support case where different repositories offer the same package (ie. same basename,
+    #      version, and build) and one of them is installed.
+    #
+    #      format : <repository_name> <package_fullname>
+    #
     PKGLIST=$(tempfile --directory=$TMPDIR)
     PKGINFOS=$(tempfile --directory=$TMPDIR)
+    HDLPKGS=$(tempfile --directory=$TMPDIR)
 
     for i in ${PRIORITY[@]}; do
       DIR="$i"
@@ -1065,10 +1073,15 @@
 
            # 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 ${GREPOPTS} -q " $PKGFULLNAME " ${TMPDIR}/tmplist && continue
+           # any other action unless when different repositories offers the same
+           # packages and P is not referenced in HDLPKGS file ...
+
+          grep ${GREPOPTS} -q " $PKGFULLNAME " ${TMPDIR}/tmplist \
+		&&
+	  grep ${GREPOPTS} -q "^${PKGDIR} ${PKGFULLNAME}$" $HDLPKGS  && continue
 
-            # The current package P is not installed. In this case P must be shown as
+            # The current package P is not installed, or P is in different repositories. In 
+	    # this case P must be shown as
             # being uninstalled and masked.
           LIST="$LIST MASKED_${PKGDIR}:${PKGFULLNAME}"
         else
@@ -1076,15 +1089,18 @@
         fi
 
         echo "repo:${PKGDIR}:bname:${PKGBASENAME}:ver:${PKGVER}:fname:${PKGFULLNAME}:" >> $PKGLIST
+        echo "${PKGDIR} ${PKGFULLNAME}" >> $HDLPKGS
 
       done < $PKGINFOS
     done
+
     rm ${TMPDIR}/waiting
     rm -f $PKGLIST $PKGINFOS
 
     LIST=$(echo -e $LIST | tr \  "\n" | uniq )
 
     echo -e "DONE\n"
+
   } # END function searchPackages()
 
   #### ===== PRIORITY AND SEARCH FUNCTIONS ===== #####
The patch in action :
Code:
$ slackpkg search vlc 

Looking for vlc in package list. Please wait...DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
   installed               alienbob                     npapi-vlc-20160706-x86_64-1alien          
   installed               alienbob                     vlc-2.2.4-x86_64-1alien                   
  uninstalled(masked)      restricted                   npapi-vlc-20160706-x86_64-1alien          
  uninstalled(masked)      restricted                   vlc-2.2.4-x86_64-1alien                   

You can search specific files using "slackpkg file-search file".
Important :
Even if the patch solve the issue, keep in mind that information returned by slackpkg search <pattern> when different repositories offer the same package (ie. with exact name) depend on the defined priorities and thus, could be wrong. For instance, if you have PKGS_PRIORITY=(alienbob restricted), then you install vlc from alienbob, and later you set PKGS_PRIORITY=(restricted alienbob ), then, slackpkg search will show that vlc is from restricted instead of alienbob :

Code:
$ grep "^PKGS_PRIORITY" /etc/slackpkg/slackpkgplus.conf
PKGS_PRIORITY=( alienbob restricted )

$ slackpkg search vlc 

Looking for vlc in package list. Please wait...DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
   installed               alienbob                     npapi-vlc-20160706-x86_64-1alien          
   installed               alienbob                     vlc-2.2.4-x86_64-1alien
  uninstalled(masked)      restricted                   npapi-vlc-20160706-x86_64-1alien          
  uninstalled(masked)      restricted                   vlc-2.2.4-x86_64-1alien                   

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

# PKGS_PRIORITY has been changed ...

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

$ slackpkg search vlc 

Looking for vlc in package list. Please wait...DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
   installed               restricted                   npapi-vlc-20160706-x86_64-1alien          
   installed               restricted                   vlc-2.2.4-x86_64-1alien                   
  uninstalled(masked)      alienbob                     npapi-vlc-20160706-x86_64-1alien          
  uninstalled(masked)      alienbob                     vlc-2.2.4-x86_64-1alien

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

P.S: In case of any trouble with this patch, feel free to report it here.

--
SeB

Last edited by phenixia2003; 10-11-2016 at 03:06 AM.
 
1 members found this post helpful.
Old 10-11-2016, 01:56 PM   #633
phenixia2003
Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 889

Rep: Reputation: 772Reputation: 772Reputation: 772Reputation: 772Reputation: 772Reputation: 772Reputation: 772
Hello,

@Zerouno

I found an important bug in givepriority().

slackpkg+ does not work as expected (ie. the same way as slackpkg) when a serie (a,ap,d,e,f ...,y) is passed in argument.

For instance, on a slackware VM without any package from serie d,e,f,kde,kdei,t,tcl,x,xap,xfce, you get the results below :

Code:
 -------------------------------------------------------------------
! Serie  ! number of package returned by slackpkg install <serie>   !
!        !                slackpkg     !       slackpkg+            !
!--------+-----------------------------+----------------------------!
!  d     !           35                !           4                !
!  e     !            1                !           1                !
!  f     !            2                !           1                !
! kde    !          247                !          90                !
! kdei   !           82                !           0                !
!  t     !            4                !           4                !
! tcl    !            6                !           2                !
!  x     !          297                !          297               !
! xap    !           41                !           0                !
! xfce   !           26                !           17               !
 -------------------------------------------------------------------
The patch slackpkg+-fix-for-givepriority-serie-bug.patch.txt fix this issue (but it needs to be tested more before applying it) :

Code:
--- slackpkgplus.sh.org	2016-10-11 09:40:12.650732937 +0200
+++ slackpkgplus.sh	2016-10-11 20:40:37.677404551 +0200
@@ -960,9 +960,13 @@
           grep "^${REPOSITORY} " ${TMPDIR}/priority.filters | cut -f2 -d" " > ${TMPDIR}/filter.patterns
           grep "^[.][*] " ${TMPDIR}/priority.filters | cut -f2 -d" " >> ${TMPDIR}/filter.patterns
 
-            # If no filter patterns were found, or if the selected package does not
-            # match any of the filter patterns, the selected package is rejected...
-          if [ ! -s ${TMPDIR}/filter.patterns ] || ! echo "${PKGDATA[5]}.${PKGDATA[7]}" | grep -q -f ${TMPDIR}/filter.patterns ;  then
+	    # The selected package is rejected when (1) no filter patterns were found, or (2)
+	    # none of the filter patterns matches the package's data
+	    #
+          if [ ! -s ${TMPDIR}/filter.patterns ] \
+ 		|| \
+ 		! echo "${PKGDATA[*]}" | grep -q -f ${TMPDIR}/filter.patterns ;  then
+
             PKGDATA=""
             LINEIDX=""
             NAME=""
--
SeB
 
1 members found this post helpful.
Old 10-11-2016, 02:05 PM   #634
zerouno
Member
 
Registered: Oct 2009
Location: Italy
Distribution: Slackware
Posts: 574

Rep: Reputation: 164Reputation: 164
Thankyou.
I think that I can apply both patches this weekend.
 
Old 10-12-2016, 05:33 PM   #635
nk_
LQ Newbie
 
Registered: Jan 2016
Distribution: Slackware
Posts: 8

Rep: Reputation: 5
Quote:
Originally Posted by phenixia2003 View Post
Even if it would be better that all repositories use, at least, different build ID, I've implemented the patch Attachment 23213 to fix this issue

Important :
Even if the patch solve the issue, keep in mind that information returned by slackpkg search <pattern> when different repositories offer the same package (ie. with exact name) depend on the defined priorities and thus, could be wrong. For instance, if you have PKGS_PRIORITY=(alienbob restricted), then you install vlc from alienbob, and later you set PKGS_PRIORITY=(restricted alienbob ), then, slackpkg search will show that vlc is from restricted instead of alienbob
Thanks, works fine
Code:
# slackpkg search vlc

Looking for vlc in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
   installed               alien                        vlc-2.2.4-x86_64-1alien                   
  uninstalled              alien                        npapi-vlc-20160706-x86_64-1alien         
  uninstalled              ktown5                       phonon-vlc-0.9.0-x86_64-1alien           
  uninstalled(masked)      alien_restricted             npapi-vlc-20160706-x86_64-1alien         
  uninstalled(masked)      alien_restricted             vlc-2.2.4-x86_64-1alien                   
  uninstalled(masked)      salix                        vlc-2.2.4-x86_64-1gv                     

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

And yet one moment, about PKGS_PRIORITY=( repository:but_package_other)


slackpkgplus.conf
Code:
SLACKPKGPLUS=on
VERBOSE=1
ALLOW32BIT=off
USEBL=1
WGETOPTS="--timeout=20 --tries=2"
SEARCH_CLOG_INPARENT=on
CACHEUPDATE=off
GREYLIST=on
SENSITIVE_SEARCH=on
WW_FILE_SEARCH=on
SHOWORDER=package
DETAILED_INFO=none
STRICTGPG=on

TAG_PRIORITY=off

REPOPLUS=( slackpkgplus alien boost )

MIRRORPLUS['alien']=http://bear.alienbase.nl/mirrors/people/alien/sbrepos/14.2/x86_64/
MIRRORPLUS['boost']=ftp://download.deepstyle.org.ua/pub/slackware/slackboost64-14.2/slackboost64/

PKGS_PRIORITY=( boost:infozip )
Code:
# ls /var/log/packages/ | grep p7zip
p7zip-16.02-x86_64-1alien

with PKGS_PRIORITY=( boost:infozip ) in /etc/slackpkg/slackpkgplus.conf
Code:
# slackpkg update
# slackpkg search p7zip

Looking for p7zip in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled(masked)      alien                        p7zip-16.02-x86_64-1alien                 
  upgrade                  boost                        p7zip-16.02-x86_64-1alien --> p7zip-16.02-x86_64-2sb

and without PKGS_PRIORITY=( boost:infozip ) , with PKGS_PRIORITY=( )
Code:
# slackpkg update
# slackpkg search p7zip


Looking for p7zip in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
   installed               alien                        p7zip-16.02-x86_64-1alien                 
  uninstalled(masked)      boost                        p7zip-16.02-x86_64-2sb

I'm about installed(masked) -> upgrade
Code:
p7zip-16.02-x86_64-1alien --> p7zip-16.02-x86_64-2sb

With Salix-repository, too
Code:
REPOPLUS=( slackpkgplus alien salix )
MIRRORPLUS['salix']=http://download.salixos.org/x86_64/14.2/
Try with salix:gslapt
Code:
# removepkg gslapt

ls: cannot access '/var/log/packages/gslapt*': No such file or directory
No such package: /var/log/packages/gslapt. Can't remove.
PKGS_PRIORITY=( ) :
Code:
# slackpkg -checkgpg=off update
# slackpkg search p7zip

Looking for p7zip in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
   installed               alien                        p7zip-16.02-x86_64-1alien                 
  uninstalled(masked)      salix                        p7zip-15.14.1-x86_64-1gv
PKGS_PRIORITY=( salix:gslapt ) :
Code:
# slackpkg -checkgpg=off update
# slackpkg search p7zip

Looking for p7zip in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled(masked)      alien                        p7zip-16.02-x86_64-1alien                 
  upgrade                  salix                        p7zip-16.02-x86_64-1alien --> p7zip-15.14.1-x86_64-1gv
Can you fix it?
Thanks

Last edited by nk_; 10-12-2016 at 05:53 PM.
 
1 members found this post helpful.
Old 10-13-2016, 04:10 AM   #636
phenixia2003
Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 889

Rep: Reputation: 772Reputation: 772Reputation: 772Reputation: 772Reputation: 772Reputation: 772Reputation: 772
Hello,

Quote:
Originally Posted by nk_ View Post
Code:
# slackpkg search p7zip

Looking for p7zip in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled(masked)      alien                        p7zip-16.02-x86_64-1alien                 
  upgrade                  boost                        p7zip-16.02-x86_64-1alien --> p7zip-16.02-x86_64-2sb

and without PKGS_PRIORITY=( boost:infozip ) , with PKGS_PRIORITY=( )
Code:
# slackpkg update
# slackpkg search p7zip

Looking for p7zip in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
   installed               alien                        p7zip-16.02-x86_64-1alien                 
  uninstalled(masked)      boost                        p7zip-16.02-x86_64-2sb
Well, the previous patch is not as good as I thought => garbage !

Try with the new patch slackpkg+-search-duplicate-packages-fix-V2.patch.txt :
Code:
--- slackpkgplus.sh.org	2016-10-13 10:52:49.214902588 +0200
+++ slackpkgplus.sh	2016-10-13 10:54:26.539896471 +0200
@@ -1014,12 +1014,19 @@
     [ "$SENSITIVE_SEARCH" = "off" ] && GREPOPTS="--ignore-case"
 
     # -- PKGLIST:
-    #      temporary file used to store data about packages. It uses
+    #      temporary file used to store data about handled packages. It uses
     #      the following format:
     #        repo:<repository_name>:bname:<package_basename>:ver:<package_version>:fname:<package_fullname>:
     #
+    #    DUPTRACK:
+    #    used to store the fullname of all packages that match the search pattern. This is
+    #    to support case where different repositories offer same packages (ie. same name, 
+    #    version, arch and build) and one of them is installed.
+    #
     PKGLIST=$(tempfile --directory=$TMPDIR)
     PKGINFOS=$(tempfile --directory=$TMPDIR)
+    DUPTRACK=$(tempfile --directory=$TMPDIR)
+
 
     for i in ${PRIORITY[@]}; do
       DIR="$i"
@@ -1055,21 +1062,36 @@
 
       while read PKGDIR PKGBASENAME PKGVER PKGARCH PKGBUILD PKGFULLNAME PKGPATH PKGEXT ; do
 
+	# add current package fullname to be able to identify cases where different repositories
+	# offer same packages (ie. same name, version, arch, and build...
+	#
+	echo "${PKGFULLNAME}" >> $DUPTRACK
+
+
         # does nothing when the package has been handled ...
         grep ${GREPOPTS} -q "^repo:${PKGDIR}:bname:${PKGBASENAME}:ver:${PKGVER}:fname:${PKGFULLNAME}:" $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 ${GREPOPTS} -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 ${GREPOPTS} -q " $PKGFULLNAME " ${TMPDIR}/tmplist && continue
-
-            # The current package P is not installed. In this case P must be shown as
-            # being uninstalled and masked.
+	   # if the current package P is installed, and there's only one occurence of
+	   # its fullname in DUPTRACK, P' will be proposed as an upgrade to P and the 
+	   # loop must continue without any other action. Otherwise, P must be shown
+	   # as being uninstalled and masked.
+	   #
+          if grep ${GREPOPTS} -q " $PKGFULLNAME " ${TMPDIR}/tmplist ; then
+		COUNT=$(grep "$PKGFULLNAME" $DUPTRACK | wc -l)
+
+		[ $COUNT -eq 1 ] && continue
+	  fi
+
+	    # The current package P is not installed or different repositories offer the 
+	    # same package (ie. same name, version, arch, and build). In these cases P must 
+	    # be shown as being uninstalled and masked.
+	    #
           LIST="$LIST MASKED_${PKGDIR}:${PKGFULLNAME}"
         else
           LIST="$LIST ${PKGDIR}:${PKGFULLNAME}"
Here it (seems to) work(s) well :

Code:
$ grep -E "^(REPOPLUS|PKGS_PRIORITY)" /etc/slackpkg/slackpkgplus.conf
REPOPLUS=( slackpkgplus restricted alien boost )
PKGS_PRIORITY=( boost:infozip )


$ slackpkg search p7zip

Looking for p7zip in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
  upgrade                  boost                        p7zip-16.02-x86_64-1alien --> p7zip-16.02-x86_64-2sb  

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

$ ls /var/log/packages/vlc*
/var/log/packages/vlc-2.2.4-x86_64-1alien


$ slackpkg search vlc
Looking for vlc in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
   installed               restricted                   vlc-2.2.4-x86_64-1alien                   
  uninstalled              restricted                   npapi-vlc-20160706-x86_64-1alien          
  uninstalled(masked)      alien                        npapi-vlc-20160706-x86_64-1alien          
  uninstalled(masked)      alien                        vlc-2.2.4-x86_64-1alien                   

You can search specific files using "slackpkg file-search file".
... but it seems you're used to find unexpected behaviors

--
SeB
 
Old 10-13-2016, 09:08 AM   #637
nk_
LQ Newbie
 
Registered: Jan 2016
Distribution: Slackware
Posts: 8

Rep: Reputation: 5
Quote:
Originally Posted by phenixia2003 View Post
Try with the new patch Attachment 23243 :
Ok
Code:
# slackpkg reinstall slackpkg+
# ls /var/log/packages/ | grep slackpkg+
slackpkg+-1.7.0-noarch-4mt

# cd /usr/libexec/slackpkg/functions.d/
# patch < /tmp/slackpkg+-search-duplicate-packages-fix-V2.patch.txt 
patching file slackpkgplus.sh
Code:
REPOPLUS=( slackpkgplus alien alien_restricted boost )
PKGS_PRIORITY=( boost:infozip )
MIRRORPLUS['slackpkgplus']=http://slakfinder.org/slackpkg+/
MIRRORPLUS['alien']=http://bear.alienbase.nl/mirrors/people/alien/sbrepos/14.2/x86_64/
MIRRORPLUS['alien_restricted']=http://bear.alienbase.nl/mirrors/people/alien/restricted_sbrepos/14.2/x86_64/
MIRRORPLUS['boost']=ftp://download.deepstyle.org.ua/pub/slackware/slackboost64-14.2/slackboost64/
Code:
# printf 'y' | slackpkg -checkgpg=off update
Code:
# ls /var/log/packages/vlc*
/var/log/packages/vlc-2.2.4-x86_64-1alien
# slackpkg search vlc

Looking for vlc in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
   installed               alien                        vlc-2.2.4-x86_64-1alien                   
  uninstalled              alien                        npapi-vlc-20160706-x86_64-1alien          
  uninstalled(masked)      alien_restricted             npapi-vlc-20160706-x86_64-1alien          
  uninstalled(masked)      alien_restricted             vlc-2.2.4-x86_64-1alien
Code:
# ls /var/log/packages/p7zip*
/var/log/packages/p7zip-16.02-x86_64-1alien
# slackpkg search p7zip

Looking for p7zip in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
  upgrade                  boost                        p7zip-16.02-x86_64-1alien --> p7zip-16.02-x86_64-2sb
and try with salix
Code:
REPOPLUS=( slackpkgplus alien alien_restricted boost salix )

PKGS_PRIORITY=( )
MIRRORPLUS['slackpkgplus']=http://slakfinder.org/slackpkg+/
MIRRORPLUS['alien']=http://bear.alienbase.nl/mirrors/people/alien/sbrepos/14.2/x86_64/
MIRRORPLUS['alien_restricted']=http://bear.alienbase.nl/mirrors/people/alien/restricted_sbrepos/14.2/x86_64/

PKGS_PRIORITY+=( boost:infozip )
MIRRORPLUS['boost']=ftp://download.deepstyle.org.ua/pub/slackware/slackboost64-14.2/slackboost64/

PKGS_PRIORITY+=( salix:gslapt )
MIRRORPLUS['salix']=http://download.salixos.org/x86_64/14.2/
Code:
# printf 'y' | slackpkg -checkgpg=off update
# slackpkg search p7zip

Looking for p7zip in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled(masked)      salix                        p7zip-15.14.1-x86_64-1gv                  
  upgrade                  boost                        p7zip-16.02-x86_64-1alien --> p7zip-16.02-x86_64-2sb
- founded, works! (installed package hide in search)

And this is not 100%, next:

Code:
# removepkg vlc
# slackpkg install alien_restricted:vlc-2.2

# slackpkg search vlc

Looking for vlc in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
   installed               alien                        vlc-2.2.4-x86_64-1alien                   
  uninstalled              alien                        npapi-vlc-20160706-x86_64-1alien          
  uninstalled(masked)      alien_restricted             npapi-vlc-20160706-x86_64-1alien          
  uninstalled(masked)      alien_restricted             vlc-2.2.4-x86_64-1alien
Sorry, but don't work idea, because
" vlc-2.2.4-x86_64-1alien / alien_restricted " != " vlc-2.2.4-x86_64-1alien / alien "

Last edited by nk_; 10-13-2016 at 09:19 AM.
 
Old 10-13-2016, 09:46 AM   #638
phenixia2003
Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 889

Rep: Reputation: 772Reputation: 772Reputation: 772Reputation: 772Reputation: 772Reputation: 772Reputation: 772
Hello,

Quote:
Originally Posted by nk_ View Post
Code:
# ls /var/log/packages/p7zip*
/var/log/packages/p7zip-16.02-x86_64-1alien
# slackpkg search p7zip

Looking for p7zip in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
  upgrade                  boost                        p7zip-16.02-x86_64-1alien --> p7zip-16.02-x86_64-2sb
and try with salix
Code:
REPOPLUS=( slackpkgplus alien alien_restricted boost salix )

PKGS_PRIORITY=( )
MIRRORPLUS['slackpkgplus']=http://slakfinder.org/slackpkg+/
MIRRORPLUS['alien']=http://bear.alienbase.nl/mirrors/people/alien/sbrepos/14.2/x86_64/
MIRRORPLUS['alien_restricted']=http://bear.alienbase.nl/mirrors/people/alien/restricted_sbrepos/14.2/x86_64/

PKGS_PRIORITY+=( boost:infozip )
MIRRORPLUS['boost']=ftp://download.deepstyle.org.ua/pub/slackware/slackboost64-14.2/slackboost64/

PKGS_PRIORITY+=( salix:gslapt )
MIRRORPLUS['salix']=http://download.salixos.org/x86_64/14.2/
Code:
# printf 'y' | slackpkg -checkgpg=off update
# slackpkg search p7zip

Looking for p7zip in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled(masked)      salix                        p7zip-15.14.1-x86_64-1gv                  
  upgrade                  boost                        p7zip-16.02-x86_64-1alien --> p7zip-16.02-x86_64-2sb
- founded, works! (installed package hide in search)

And this is not 100%,
I really don't understand what you mean ...

Quote:
Originally Posted by nk_ View Post
next:

Code:
# removepkg vlc
# slackpkg install alien_restricted:vlc-2.2

# slackpkg search vlc

Looking for vlc in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
   installed               alien                        vlc-2.2.4-x86_64-1alien                   
  uninstalled              alien                        npapi-vlc-20160706-x86_64-1alien          
  uninstalled(masked)      alien_restricted             npapi-vlc-20160706-x86_64-1alien          
  uninstalled(masked)      alien_restricted             vlc-2.2.4-x86_64-1alien
Sorry, but don't work idea, because
" vlc-2.2.4-x86_64-1alien / alien_restricted " != " vlc-2.2.4-x86_64-1alien / alien "
As long as the repositories alienbob and restricted will use the same build tag (ie [[:digit:]]+alien), you'll see that kind of misleading results with some packages because slackpkg+ has no way to differentiate these packages. I already pointed out this :

Quote:
Originally Posted by phenixia2003 View Post
Important :
Even if the patch solve the issue, keep in mind that information returned by slackpkg search <pattern> when different repositories offer the same package (ie. with exact name) depend on the defined priorities and thus, could be wrong. For instance, if you have PKGS_PRIORITY=(alienbob restricted), then you install vlc from alienbob, and later you set PKGS_PRIORITY=(restricted alienbob ), then, slackpkg search will show that vlc is from restricted instead of alienbob
Quote:
Originally Posted by phenixia2003 View Post
The only way to solve this would be that restricted and alienbob don't share, at least, the same build numbers (ex: packages from alienbob with an even number, and the packages from restricted with odd number)

--
SeB

Last edited by phenixia2003; 10-13-2016 at 10:04 AM.
 
Old 10-13-2016, 11:57 AM   #639
nk_
LQ Newbie
 
Registered: Jan 2016
Distribution: Slackware
Posts: 8

Rep: Reputation: 5
Quote:
As long as the repositories alienbob and restricted will use the same build tag (ie [[:digit:]]+alien), you'll see that kind of misleading results with some packages because slackpkg+ has no way to differentiate these packages. I already pointed out this :
Oh, sorry, all right

Quote:
I really don't understand what you mean ...
About this, tried again:
Code:
# ls /var/log/packages/p7zip*
/var/log/packages/p7zip-16.02-x86_64-1alien

# slackpkg search p7zip

Looking for p7zip in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled(masked)      salix                        p7zip-15.14.1-x86_64-1gv                  
  upgrade                  boost                        p7zip-16.02-x86_64-1alien --> p7zip-16.02-x86_64-2sb
why installed package hide with PKGS_PRIORITY=( some_repo:some_package ), maybe show it?

Last edited by nk_; 10-13-2016 at 12:02 PM.
 
1 members found this post helpful.
Old 10-13-2016, 02:04 PM   #640
phenixia2003
Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 889

Rep: Reputation: 772Reputation: 772Reputation: 772Reputation: 772Reputation: 772Reputation: 772Reputation: 772
Hello,

First of all, there's a bug in the patch I sent... Well, we're the 13th :
Code:
$ ls /var/log/packages/p7zip*
/var/log/packages/p7zip-16.02-x86_64-1alien

$ grep ^PKGS_PRIORITY /etc/slackpkg/slackpkgplus.conf
PKGS_PRIORITY=(  boost restricted alien salix )

$ slackpkg search p7zip

Looking for p7zip in package list. Please wait...DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled(masked)      alien                        p7zip-16.02-x86_64-1alien                 
  uninstalled(masked)      salix                        p7zip-15.14.1-x86_64-1gv                  
  upgrade                  boost                        p7zip-16.02-x86_64-1alien --> p7zip-16.02-x86_64-2sb  

You can search specific files using "slackpkg file-search file".
Quote:
Originally Posted by nk_ View Post
About this, tried again:
Code:
# ls /var/log/packages/p7zip*
/var/log/packages/p7zip-16.02-x86_64-1alien

# slackpkg search p7zip

Looking for p7zip in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled(masked)      salix                        p7zip-15.14.1-x86_64-1gv                  
  upgrade                  boost                        p7zip-16.02-x86_64-1alien --> p7zip-16.02-x86_64-2sb
why installed package hide with PKGS_PRIORITY=( some_repo:some_package ), maybe show it?
If I understand well, you'd want something like that :
Code:
[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled(masked)      salix                        p7zip-15.14.1-x86_64-1gv                  
  installled               alien                        p7zip-16.02-x86_64-1alien
  upgrade                  boost                        p7zip-16.02-x86_64-1alien --> p7zip-16.02-x86_64-2sb

or, better, like that :
Code:
[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled(masked)      salix                        p7zip-15.14.1-x86_64-1gv                  
  upgrade                  boost                        alien:p7zip-16.02-x86_64-1alien --> p7zip-16.02-x86_64-2sb

This new patch slackpkg+-search-duplicate-packages-fix-V3.patch.txt fixes (I hope) the issue found in previous version, and, indicates the source repository of each package for which there's an available update in another repository :

Code:
--- slackpkgplus.sh.org	2016-10-13 20:45:52.685750598 +0200
+++ slackpkgplus.sh	2016-10-13 21:03:48.327682995 +0200
@@ -1014,12 +1014,19 @@
     [ "$SENSITIVE_SEARCH" = "off" ] && GREPOPTS="--ignore-case"
 
     # -- PKGLIST:
-    #      temporary file used to store data about packages. It uses
+    #      temporary file used to store data about handled packages. It uses
     #      the following format:
     #        repo:<repository_name>:bname:<package_basename>:ver:<package_version>:fname:<package_fullname>:
     #
+    #    DUPTRACK:
+    #    used to store the fullname of all packages that match the search pattern. This is
+    #    to support case where different repositories offer same packages (ie. same name, 
+    #    version, arch and build) and one of them is installed.
+    #
     PKGLIST=$(tempfile --directory=$TMPDIR)
     PKGINFOS=$(tempfile --directory=$TMPDIR)
+    DUPTRACK=$(tempfile --directory=$TMPDIR)
+
 
     for i in ${PRIORITY[@]}; do
       DIR="$i"
@@ -1055,6 +1062,12 @@
 
       while read PKGDIR PKGBASENAME PKGVER PKGARCH PKGBUILD PKGFULLNAME PKGPATH PKGEXT ; do
 
+	# add current package fullname to be able to identify cases where different repositories
+	# offer same packages (ie. same name, version, arch, and build...
+	#
+	echo "${PKGFULLNAME}" >> $DUPTRACK
+
+
         # does nothing when the package has been handled ...
         grep ${GREPOPTS} -q "^repo:${PKGDIR}:bname:${PKGBASENAME}:ver:${PKGVER}:fname:${PKGFULLNAME}:" $PKGLIST && continue
 
@@ -1063,14 +1076,26 @@
 
         if grep ${GREPOPTS} -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 ${GREPOPTS} -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}"
+	   IS_INSTALLED=false
+
+	   # if the current package P is installed, and there's only one occurence of
+	   # its fullname in DUPTRACK, P' will be proposed as an upgrade to P and the 
+	   # loop must continue without any other action. Otherwise, P must be shown
+	   # as being uninstalled and masked.
+	   #
+          if grep ${GREPOPTS} -q " $PKGFULLNAME " ${TMPDIR}/tmplist ; then
+		COUNT=$(grep "$PKGFULLNAME" $DUPTRACK | wc -l)
+
+		[ $COUNT -eq 1 ] && IS_INSTALLED=true
+	  fi
+
+	  if [ $IS_INSTALLED = false ] ; then
+	      # The current package P is not installed or different repositories offer the 
+	      # same package (ie. same name, version, arch, and build). In these cases P must 
+	      # be shown as being uninstalled and masked.
+	      #
+            LIST="$LIST MASKED_${PKGDIR}:${PKGFULLNAME}"
+          fi
         else
           LIST="$LIST ${PKGDIR}:${PKGFULLNAME}"
         fi
@@ -1149,6 +1174,13 @@
               STATUS=" installed "
               printf "  %-20s     %-24s     %-40s  \n" "$STATUS" "$REPO" "$CINSTPKG"
             else
+
+	      INSTPKG_REPO=$(grep -m 1 "$CINSTPKG" ${WORKDIR}/pkglist | cut -f1 -d" " | sed "s/SLACKPKGPLUS_//")
+
+	      if [ "$INSTPKG_REPO" != "$REPO" ] ; then
+		CINSTPKG="$INSTPKG_REPO:$CINSTPKG"
+	      fi
+
               STATUS="upgrade"
               printf "  %-20s     %-24s     %-40s  \n" "$STATUS" "$REPO" "$CINSTPKG --> ${RAWNAME}"
             fi
A simple test :

Code:
$ slackpkg search p7zip
Looking for p7zip in package list. Please wait...DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled(masked)      salix                        p7zip-15.14.1-x86_64-1gv                  
  upgrade                  boost                        alien:p7zip-16.02-x86_64-1alien --> p7zip-16.02-x86_64-2sb  

You can search specific files using "slackpkg file-search file".
Please test this and report any issue.

--
SeB

Last edited by phenixia2003; 10-13-2016 at 02:15 PM.
 
Old 10-13-2016, 05:16 PM   #641
nk_
LQ Newbie
 
Registered: Jan 2016
Distribution: Slackware
Posts: 8

Rep: Reputation: 5
Hello)
Quote:
Originally Posted by phenixia2003 View Post

If I understand well, you'd want something like that :
Code:
[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled(masked)      salix                        p7zip-15.14.1-x86_64-1gv                  
  installled               alien                        p7zip-16.02-x86_64-1alien
  upgrade                  boost                        p7zip-16.02-x86_64-1alien --> p7zip-16.02-x86_64-2sb

or, better, like that :
Code:
[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled(masked)      salix                        p7zip-15.14.1-x86_64-1gv                  
  upgrade                  boost                        alien:p7zip-16.02-x86_64-1alien --> p7zip-16.02-x86_64-2sb
Yes, I'm about this, thanks

But I don't understand, why Status: upgrade?
And ` slackpkg upgrade-all ` don't show this package for upgrade

Status: upgrade , if PKGS_PRIORITY+=( repo:pkg ) and search_pkg founded this repository

Example-1:
Code:
REPOPLUS=( slackpkgplus alien alien_restricted boost salix )

PKGS_PRIORITY=( )
MIRRORPLUS['slackpkgplus']=http://slakfinder.org/slackpkg+/
MIRRORPLUS['alien']=http://bear.alienbase.nl/mirrors/people/alien/sbrepos/14.2/x86_64/
MIRRORPLUS['alien_restricted']=http://bear.alienbase.nl/mirrors/people/alien/restricted_sbrepos/14.2/x86_64/

MIRRORPLUS['boost']=ftp://download.deepstyle.org.ua/pub/slackware/slackboost64-14.2/slackboost64/

PKGS_PRIORITY+=( salix:gslapt )
MIRRORPLUS['salix']=http://download.salixos.org/x86_64/14.2/
Code:
# slackpkg -checkgpg=off update
# slackpkg search p7zip

Looking for p7zip in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled(masked)      boost                        p7zip-16.02-x86_64-2sb                    
  upgrade                  salix                        alien:p7zip-16.02-x86_64-1alien --> p7zip-15.14.1-x86_64-1gv
How alien:p7zip-16.02-x86_64-1alien --> salix:p7zip-15.14.1-x86_64-1gv (p7zip-16.02 -> 15.14.1)
with priority REPOPLUS=( slackpkgplus alien alien_restricted boost salix ) ?

Example-2 (add PKGS_PRIORITY+=( boost:infozip )):
Code:
REPOPLUS=( slackpkgplus alien alien_restricted boost salix )

PKGS_PRIORITY=( )
MIRRORPLUS['slackpkgplus']=http://slakfinder.org/slackpkg+/
MIRRORPLUS['alien']=http://bear.alienbase.nl/mirrors/people/alien/sbrepos/14.2/x86_64/
MIRRORPLUS['alien_restricted']=http://bear.alienbase.nl/mirrors/people/alien/restricted_sbrepos/14.2/x86_64/

PKGS_PRIORITY+=( boost:infozip )
MIRRORPLUS['boost']=ftp://download.deepstyle.org.ua/pub/slackware/slackboost64-14.2/slackboost64/

PKGS_PRIORITY+=( salix:gslapt )
MIRRORPLUS['salix']=http://download.salixos.org/x86_64/14.2/
Code:
# slackpkg -checkgpg=off update
# slackpkg search p7zip

Looking for p7zip in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled(masked)      salix                        p7zip-15.14.1-x86_64-1gv                  
  upgrade                  boost                        alien:p7zip-16.02-x86_64-1alien --> p7zip-16.02-x86_64-2sb  

You can search specific files using "slackpkg file-search file".
But # slackpkg upgrade-all don't show this upgrade(s)

Example-3 (w/o PKGS_PRIORITY):
Code:
REPOPLUS=( slackpkgplus alien alien_restricted boost salix )

PKGS_PRIORITY=( )
MIRRORPLUS['slackpkgplus']=http://slakfinder.org/slackpkg+/
MIRRORPLUS['alien']=http://bear.alienbase.nl/mirrors/people/alien/sbrepos/14.2/x86_64/
MIRRORPLUS['alien_restricted']=http://bear.alienbase.nl/mirrors/people/alien/restricted_sbrepos/14.2/x86_64/

MIRRORPLUS['boost']=ftp://download.deepstyle.org.ua/pub/slackware/slackboost64-14.2/slackboost64/

MIRRORPLUS['salix']=http://download.salixos.org/x86_64/14.2/
Code:
# slackpkg -checkgpg=off update
# slackpkg search p7zip

Looking for p7zip in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
   installed               alien                        p7zip-16.02-x86_64-1alien                 
  uninstalled(masked)      boost                        p7zip-16.02-x86_64-2sb                    
  uninstalled(masked)      salix                        p7zip-15.14.1-x86_64-1gv
in Example-3 all-right
 
1 members found this post helpful.
Old 10-14-2016, 01:01 AM   #642
bormant
Member
 
Registered: Jan 2008
Posts: 335

Rep: Reputation: 194Reputation: 194
phenixia2003,
please note nk_'s example 2 above:
adding only one package with repo into PKGS_PRIORITY (boost:infozip) leads to list other packages from this repo as "upgrade" (boost:p7zip in example). So, it lists packages as whole boost priority and not only boost:infozip.

Last edited by bormant; 10-14-2016 at 01:06 AM.
 
2 members found this post helpful.
Old 10-14-2016, 05:05 AM   #643
phenixia2003
Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 889

Rep: Reputation: 772Reputation: 772Reputation: 772Reputation: 772Reputation: 772Reputation: 772Reputation: 772
Hello,

Quote:
Originally Posted by nk_ View Post
But I don't understand, why Status: upgrade?
And ` slackpkg upgrade-all ` don't show this package for upgrade

Status: upgrade , if PKGS_PRIORITY+=( repo:pkg ) and search_pkg founded this repository
Quote:
Originally Posted by bormant View Post
phenixia2003,
please note nk_'s example 2 above:
adding only one package with repo into PKGS_PRIORITY (boost:infozip) leads to list other packages from this repo as "upgrade" (boost:p7zip in example). So, it lists packages as whole boost priority and not only boost:infozip.

You're right, this is a bug (an old furthermore). I fixed it. I also corrected/optimized/simplified the last patch I sent yesterday .
  • The patch slackpkg+-search-duplicate-packages-fix-V6.patch.txt supersedes the last patch I sent yesterday.

    Code:
    --- slackpkgplus.sh.org	2016-10-14 10:11:23.283949727 +0200
    +++ slackpkgplus.sh	2016-10-14 12:07:42.637393904 +0200
    @@ -1014,13 +1014,14 @@
         [ "$SENSITIVE_SEARCH" = "off" ] && GREPOPTS="--ignore-case"
     
         # -- PKGLIST:
    -    #      temporary file used to store data about packages. It uses
    +    #      temporary file used to store data about handled packages. It uses
         #      the following format:
         #        repo:<repository_name>:bname:<package_basename>:ver:<package_version>:fname:<package_fullname>:
         #
         PKGLIST=$(tempfile --directory=$TMPDIR)
         PKGINFOS=$(tempfile --directory=$TMPDIR)
     
    +
         for i in ${PRIORITY[@]}; do
           DIR="$i"
           if [[ "$DIR" =~ ^[-_[:alnum:]]+[:] ]] ; then   # was  if echo "$DIR" | grep -q "[a-zA-Z0-9]\+[:]" ; then
    @@ -1063,14 +1064,26 @@
     
             if grep ${GREPOPTS} -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 ${GREPOPTS} -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}"
    +	     # P' has precedence over P. Therefore, P must be displayed with masked 
    +	     # attribute, unless when installed, in which case P' will be proposed
    +	     # as an upgrade to P.
    +
    +	  MASKED=true
    +
    +          if grep ${GREPOPTS} -q " $PKGFULLNAME " ${TMPDIR}/tmplist ; then
    +		COUNT=$(grep ":$PKGFULLNAME:" $PKGLIST | wc -l)
    +
    +		# P is installed. It should not be masked. However, when different 
    +		# repositories offer the same package (ie. same name,version,arch,
    +		# build) this rule must be applied only when there's *no occurence*
    +		# of fullname(P) in PKGLIST (ie. list of handled packages).
    +		#
    +		[ $COUNT -eq 0 ] && MASKED=false
    +	  fi
    +
    +	  if [ $MASKED = true ] ; then
    +            LIST="$LIST MASKED_${PKGDIR}:${PKGFULLNAME}"
    +          fi
             else
               LIST="$LIST ${PKGDIR}:${PKGFULLNAME}"
             fi
    @@ -1149,6 +1162,13 @@
                   STATUS=" installed "
                   printf "  %-20s     %-24s     %-40s  \n" "$STATUS" "$REPO" "$CINSTPKG"
                 else
    +
    +	      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"
    +	      fi
    +
                   STATUS="upgrade"
                   printf "  %-20s     %-24s     %-40s  \n" "$STATUS" "$REPO" "$CINSTPKG --> ${RAWNAME}"
                 fi
  • The patch slackpkg+-search-fix-wrong-upgrade-info-bug.patch.txt fixes the issue about wrong updates suggested by slackpkg search.

    Code:
    --- slackpkgplus.sh.org	2016-10-14 10:11:23.283949727 +0200
    +++ slackpkgplus.sh	2016-10-14 10:11:23.283949727 +0200
    @@ -1024,7 +1024,24 @@
         for i in ${PRIORITY[@]}; do
           DIR="$i"
           if [[ "$DIR" =~ ^[-_[:alnum:]]+[:] ]] ; then   # was  if echo "$DIR" | grep -q "[a-zA-Z0-9]\+[:]" ; then
    -        DIR=${DIR/:*/}                               # was DIR=$(echo "$i" | cut -f1 -d":")
    +        DIR=${i/:*/}                                 # was DIR=$(echo "$i" | cut -f1 -d":")
    +        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
    +	#*selectd.
    +	#
    +	# Example:
    +	#  - p7zip is present in alien and boost 
    +	#  - alien has precedence over boost
    +	# - PKGS_PRIORITY=(boost:infozip)
    +	#  - p7zip from alien is installed. 
    +	#
    +	# In these case, the priority boost:infozip must be ignored otherwise slackpkg+ will 
    +	# wrongly shows boost:p7zip as an upgrade for alien:p7zip
    +	#
    +
    +	[ ! -z "$PAT" ] && ! echo "$SEARCHSTR" | grep  -qw "$PAT" && continue
           fi
     
           if [ "$CMD" == "file-search" ] ; then


Example :

Code:
# ls /var/log/packages/p7zip*
p7zip-16.02-x86_64-1alien

# REPOPLUS=(slackpkgplus alien restricted boost salix )
# PKGS_PRIORITY=()

$ slackpkg search p7zip

[ Status           ] [ Repository               ] [ Package                                  ]
   installed               alien                        p7zip-16.02-x86_64-1alien                 
  uninstalled(masked)      boost                        p7zip-16.02-x86_64-2sb                    
  uninstalled(masked)      salix                        p7zip-15.14.1-x86_64-1gv                  

# PKGS_PRIORITY=(boost)

$ slackpkg search p7zip

[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled(masked)      salix                        p7zip-15.14.1-x86_64-1gv                  
  upgrade                  boost                        alien:p7zip-16.02-x86_64-1alien --> p7zip-16.02-x86_64-2sb  


# PKGS_PRIORITY=(boost:infozip)

$ slackpkg search p7zip

[ Status           ] [ Repository               ] [ Package                                  ]
   installed               alien                        p7zip-16.02-x86_64-1alien                 
  uninstalled(masked)      boost                        p7zip-16.02-x86_64-2sb                    
  uninstalled(masked)      salix                        p7zip-15.14.1-x86_64-1gv                  



$ ls /var/log/packages/vlc*
/var/log/packages/vlc-2.2.4-x86_64-1alien

#REPOPLUS=( slackpkgplus alien restricted boost salix )
#PKGS_PRIORITY=(  boost restricted alien salix )

$ slackpkg search vlc

[ Status           ] [ Repository               ] [ Package                                  ]
   installed               restricted                   vlc-2.2.4-x86_64-1alien                   
  uninstalled              restricted                   npapi-vlc-20160706-x86_64-1alien          
  uninstalled(masked)      alien                        npapi-vlc-20160706-x86_64-1alien          
  uninstalled(masked)      alien                        vlc-2.2.4-x86_64-1alien                   
  uninstalled(masked)      salix                        vlc-2.2.4-x86_64-1gv                      


#PKGS_PRIORITY=(  salix:vlc boost restricted alien salix )

$ slackpkg search vlc

[ Status           ] [ Repository               ] [ Package                                  ]
  uninstalled              restricted                   npapi-vlc-20160706-x86_64-1alien          
  uninstalled(masked)      alien                        npapi-vlc-20160706-x86_64-1alien          
  uninstalled(masked)      alien                        vlc-2.2.4-x86_64-1alien                   
  upgrade                  salix                        restricted:vlc-2.2.4-x86_64-1alien --> vlc-2.2.4-x86_64-1gv

--
SeB

Last edited by phenixia2003; 10-14-2016 at 05:12 AM.
 
2 members found this post helpful.
Old 10-14-2016, 08:26 AM   #644
nk_
LQ Newbie
 
Registered: Jan 2016
Distribution: Slackware
Posts: 8

Rep: Reputation: 5
Yes! Cool.
phenixia2003 thanks for the patches
bormant thanks for help with my bad english(

And maybe yet,
about wrong updates suggested by slackpkg search with /etc/slackpkg/greylist and blacklist

Code:
> blacklist: qmmp

# slackpkg search qmmp

Looking for qmmp in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
  upgrade                  alien                        qmmp-0.10.3-x86_64-1_SBo --> qmmp-0.7.6-x86_64-1alien
Code:
> greylist: [0-9]+_SBo

# slackpkg search unrar

Looking for unrar in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]                  
  uninstalled(masked)      salix                        unrar-5.3.11-x86_64-1gv                   
  upgrade                  alien                        unrar-5.4.5-x86_64-1_SBo --> unrar-4.2.4-x86_64-1alien
Status upgrade(masked) for this upgrades in search?

Last edited by nk_; 10-14-2016 at 08:29 AM.
 
1 members found this post helpful.
Old 10-14-2016, 09:53 AM   #645
phenixia2003
Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 889

Rep: Reputation: 772Reputation: 772Reputation: 772Reputation: 772Reputation: 772Reputation: 772Reputation: 772
Quote:
Originally Posted by nk_ View Post
Yes! Cool.
phenixia2003 thanks for the patches
bormant thanks for help with my bad english(
Thanks for taking time to test these patches.

Quote:
Originally Posted by nk_ View Post
And maybe yet,
about wrong updates suggested by slackpkg search with /etc/slackpkg/greylist and blacklist

Code:
> blacklist: qmmp

# slackpkg search qmmp

Looking for qmmp in package list. Please wait... DONE

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

[ Status           ] [ Repository               ] [ Package                                  ]
  upgrade                  alien                        qmmp-0.10.3-x86_64-1_SBo --> qmmp-0.7.6-x86_64-1alien
Code:
> greylist: [0-9]+_SBo
You're right, this is a bug (${WORKDIR}/pkglist used instead of ${TMPDIR}/pkglist in searchPackages).

The patch slackpkg+-search-duplicate-packages-fix-V7.patch.txt fixes it and supersedes the 'V6' I sent in my last post:

Code:
--- slackpkgplus.sh.org	2016-10-14 16:45:59.467757177 +0200
+++ slackpkgplus.sh	2016-10-14 16:45:59.467757177 +0200
@@ -1014,13 +1014,14 @@
     [ "$SENSITIVE_SEARCH" = "off" ] && GREPOPTS="--ignore-case"
 
     # -- PKGLIST:
-    #      temporary file used to store data about packages. It uses
+    #      temporary file used to store data about handled packages. It uses
     #      the following format:
     #        repo:<repository_name>:bname:<package_basename>:ver:<package_version>:fname:<package_fullname>:
     #
     PKGLIST=$(tempfile --directory=$TMPDIR)
     PKGINFOS=$(tempfile --directory=$TMPDIR)
 
+
     for i in ${PRIORITY[@]}; do
       DIR="$i"
       if [[ "$DIR" =~ ^[-_[:alnum:]]+[:] ]] ; then   # was  if echo "$DIR" | grep -q "[a-zA-Z0-9]\+[:]" ; then
@@ -1050,7 +1051,7 @@
           }' 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
@@ -1063,14 +1064,26 @@
 
         if grep ${GREPOPTS} -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 ${GREPOPTS} -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}"
+	     # P' has precedence over P. Therefore, P must be displayed with masked 
+	     # attribute, unless when installed, in which case P' will be proposed
+	     # as an upgrade to P.
+
+	  MASKED=true
+
+          if grep ${GREPOPTS} -q " $PKGFULLNAME " ${TMPDIR}/tmplist ; then
+		COUNT=$(grep ":$PKGFULLNAME:" $PKGLIST | wc -l)
+
+		# P is installed. It should not be masked. However, when different 
+		# repositories offer the same package (ie. same name,version,arch,
+		# build) this rule must be applied only when there's *no occurence*
+		# of fullname(P) in PKGLIST (ie. list of handled packages).
+		#
+		[ $COUNT -eq 0 ] && MASKED=false
+	  fi
+
+	  if [ $MASKED = true ] ; then
+            LIST="$LIST MASKED_${PKGDIR}:${PKGFULLNAME}"
+          fi
         else
           LIST="$LIST ${PKGDIR}:${PKGFULLNAME}"
         fi
@@ -1149,6 +1162,13 @@
               STATUS=" installed "
               printf "  %-20s     %-24s     %-40s  \n" "$STATUS" "$REPO" "$CINSTPKG"
             else
+
+	      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"
+	      fi
+
               STATUS="upgrade"
               printf "  %-20s     %-24s     %-40s  \n" "$STATUS" "$REPO" "$CINSTPKG --> ${RAWNAME}"
             fi
Here is an example :
Code:
$ grep "qmmp" /etc/slackpkg/blacklist
$ slackpkg search qmmp

[ Status           ] [ Repository               ] [ Package                                  ]
  upgrade                  alien                        qmmp-0.10.3-x86_64-1_SBo --> qmmp-0.7.6-x86_64-1alien  


$ echo "qmmp" >> /etc/slackpkg/blacklist
$ slackpkg search qmmp
Looking for qmmp in package list. Please wait...DONE

No package name matches the pattern.

Quote:
Originally Posted by nk_ View Post
# slackpkg search unrar

Looking for unrar in package list. Please wait... DONE

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

[ Status ] [ Repository ] [ Package ]
uninstalled(masked) salix unrar-5.3.11-x86_64-1gv
upgrade alien unrar-5.4.5-x86_64-1_SBo --> unrar-4.2.4-x86_64-1alien [/CODE]

Status upgrade(masked) for this upgrades in search?

This is not a bug. The greylist does not work as a blacklist. This is a convenience which allows users to define the packages that must be unchecked when packages that match a request are displayed within a dialog interface. For instance, if you run slackpg upgrade-all, the greylist will be used, unless the dialog interface is disabled. That is :
  • when DIALOG=off in /etc/slackpkg/slackpkg.conf
  • when you pass -dialog=off to slackpkg :

    Code:
    $ slackpkg -dialog=off install foo

--
SeB
 
1 members found this post helpful.
  


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 04:05 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration