LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   slackpkg vs. third-party package repository (https://www.linuxquestions.org/questions/slackware-14/slackpkg-vs-third-party-package-repository-4175427364/)

zerouno 10-26-2014 01:07 PM

patched.

Thanks

kikinovak 10-26-2014 05:46 PM

@zerouno: since its creation, the MLED repo layout has gone through a few avatars. I guess now we can say it is settled. Maybe you can reflect these changes in the next version of slackpkg+?

http://www.microlinux.fr/slackware/

Cheers,

Niki

zerouno 10-26-2014 06:27 PM

I think that was never quite clear the MLED structure, so the better is that you suggests me how to modify the repositories.txt file

Do you confirm that the four repositories desktop-{base,extra,xfce,kde} are not fully indipendent? If I decide to install packages from desktop-kde I need to add at least the desktop-base repository. It's correct?
However, I think the best it's to write a slackpkgplus sample in http://www.microlinux.fr/slackware/ path (a copy of http://www.microlinux.fr/slackware/d....x86_64.sample file may be sufficient) so I can refer to it in repositories.txt file.

Code:

> mled(*):          http://www.microlinux.fr/slackware/desktop-{base,extra,kde,xfce}-14.1-{32,64}bit/
> mles:          http://www.microlinux.fr/slackware/server-{14.0,14.1}-{32,64}bit/
[...]
(*) please refer to http://www.microlinux.fr/slackware/slackpkgplus.conf.sample to configure it

or add it in the README.txt
I think that currently that README does not contains sufficient instructions to install MLED.

phenixia2003 12-09-2014 01:28 PM

1 Attachment(s)
Hello,

As you know, slackpkg+ allows to give priority to any package P in a 3rd party repository R with a rule <R>:<P> :
  • inside the variable PKGS_PRIORITY :

    Code:

        PKGS_PRIORITY = ( restricted:ffmpeg ...)
  • on the command line :
    Code:

    $ slackpkg install restricted:vlc

Currently, this syntax works with 3rd party repositories only. But, following this post, It is obvious this should be the same for standard Slackware packages. With that, the issue reported by michaelslack would have easily been fixed with the priorities rules below :
Code:

PKGS_PRIORITY=( patches:harfbuzz slackware64:harfbuzz ktown5:.* ktown4:.* )
Furthermore, with this extension, multilib users who only want the 32-bit runtime, could avoid the installation of multilib gcc with the rules below :

Code:

PKGS_PRIORITY=( patches:gcc slackware64:gcc multilib:.*)
So I slightly modified slackpkg+, and below is the patch (in attachment too) which gives user the ability to give priority to any standard Slackware package the same way as for the packages from 3rd party repositories:
Code:

--- slackpkgplus.sh.org        2014-12-09 17:07:02.608537119 +0100
+++ slackpkgplus.sh        2014-12-09 17:16:48.442563259 +0100
@@ -6,6 +6,10 @@
 
 CONF=${CONF:-/etc/slackpkg} # needed if you're running slackpkg 2.28.0-12
 
+  # regular expression used to distinguish the 3rd party repositories from the standard slackware directories.
+  #
+SLACKDIR_REGEXP="(slackware)|(slackware64)|(extra)|(pasture)|(patches)|(testing)"
+
 if [ -e $CONF/slackpkgplus.conf ];then
  # You can override GREYLIST WGETOPTS SLACKPKGPLUS VERBOSE USEBL ALLOW32BIT from command-line
  EXTGREYLIST=$GREYLIST
@@ -541,7 +545,16 @@
    cat $TMPDIR/greylist.1|sed 's/^/SLACKPKGPLUS_/' >$TMPDIR/greylist.2
  fi
 
-  REPOPLUS=$(echo "${REPOPLUS[*]} ${PKGS_PRIORITY[*]} ${!MIRRORPLUS[*]}"|sed 's/ /\n/g'|sed 's/:.*//'|awk '{if(!a[$1]++)print $1}')
+  PURE_PKGSPRIORITY=""
+  for pp in ${PKGS_PRIORITY[@]} ; do
+    repository=$(echo "$pp" | cut -f1 -d":")
+
+    if ! echo "$repository" | grep -qwE "$SLACKDIR_REGEXP" ; then
+        PURE_PKGSPRIORITY=( ${PURE_PKGSPRIORITY[*]} $pp )
+    fi
+  done
+
+  REPOPLUS=$(echo "${REPOPLUS[*]} ${PURE_PKGSPRIORITY[*]} ${!MIRRORPLUS[*]}"|sed 's/ /\n/g'|sed 's/:.*//'|awk '{if(!a[$1]++)print $1}')
  PRIORITY=( ${PRIORITY[*]} SLACKPKGPLUS_$(echo $REPOPLUS|sed 's/ / SLACKPKGPLUS_/g') )
 
  # Test repositories
@@ -573,10 +586,15 @@
      package=$(echo "$pp" | cut -f2- -d":")
 
      if [ ! -z "$repository" ] && [ ! -z "$package" ] ; then
+
+        if ! echo "$repository" | grep -qwE "$SLACKDIR_REGEXP" ; then
+          repository="SLACKPKGPLUS_${repository}"
+        fi
+
        if [ -z "$PREFIX" ] ; then
-          PREFIX=( SLACKPKGPLUS_${repository}:$package )
+          PREFIX=( ${repository}:$package )
        else
-          PREFIX=( ${PREFIX[*]} SLACKPKGPLUS_${repository}:$package )
+          PREFIX=( ${PREFIX[*]} ${repository}:$package )
        fi
      fi
    done
@@ -910,7 +928,11 @@
          repository=$(echo "$pref" | cut -f1 -d":")
          package=$(echo "$pref" | cut -f2- -d":")
 
-          PRIORITYLIST=( ${PRIORITYLIST[*]} SLACKPKGPLUS_${repository}:$package )
+          if ! echo "$repository" | grep -qwE "$SLACKDIR_REGEXP" ; then
+            repository="SLACKPKGPLUS_${repository}"
+          fi
+
+          PRIORITYLIST=( ${PRIORITYLIST[*]} ${repository}:$package )
        fi
 
      # You can specify 'slackpkg install reponame' where reponame is a thirdy part repository

Some usage samples :

1. On a multilib system with PKGS_PRIORITY==( multilib:.* restricted:.* alienbob:.* )
Code:

  $ slackpkg -dialog=off upgrade slackware64:gcc

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

  gcc-4.8.2-x86_64-1.txz
  gcc-g++-4.8.2-x86_64-1.txz
  gcc-gfortran-4.8.2-x86_64-1.txz
  gcc-gnat-4.8.2-x86_64-1.txz
  gcc-go-4.8.2-x86_64-1.txz
  gcc-java-4.8.2-x86_64-1.txz
  gcc-objc-4.8.2-x86_64-1.txz

  Total package(s): 7

  Do you wish to upgrade selected packages (Y/n)? n

2. Now, with PKGS_PRIORITY=( patches:gcc slackware64:gcc multilib:.* restricted:.* alienbob:.* )
Code:

$ slackpkg -dialog=off upgrade gcc
 
Checking local integrity... DONE
Looking for gcc in package list. Please wait... DONE

gcc-4.8.2-x86_64-1.txz
gcc-g++-4.8.2-x86_64-1.txz
gcc-gfortran-4.8.2-x86_64-1.txz
gcc-gnat-4.8.2-x86_64-1.txz
gcc-go-4.8.2-x86_64-1.txz
gcc-java-4.8.2-x86_64-1.txz
gcc-objc-4.8.2-x86_64-1.txz

Total package(s): 7

Do you wish to upgrade selected packages (Y/n)?

This extension even allows to downgrade any official installed package, when required. For instance, on a slackware64 14.1 up to date, if I want to downgrade cairo and curl to the original versions :

Code:

$ ls /var/log/packages/{cairo*,curl*} | grep -v compat32
/var/log/packages/cairo-1.12.16-x86_64-1_slack14.1
/var/log/packages/curl-7.36.0-x86_64-1_slack14.1

$ slackpkg -dialog=off upgrade slackware64:cairo slackware64:curl

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

cairo-1.12.14-x86_64-1.txz
curl-7.31.0-x86_64-1.txz

Total package(s): 2

Do you wish to upgrade selected packages (Y/n)?

Hope this helps.

Cheers.

--
SeB

zerouno 12-10-2014 07:44 AM

It's a good idea.

Currently I've few time to apply patch.
However another think that should be done is to remove the ":.*" in PKGS_PRIORITY to select the entire repository.

I think that if I put
PKGS_PRIORITY=( multilib )
if slackpkg+ found it as an existent repository, it should replace automatically with multilib:.*

or (to be clear that it is a repository)
PKGS_PRIORITY=( multilib: )

I think there is no reason becouse a user need to set a single package without an associated repository

PKGS_PRIORITY=( gcc )
is a non-sense configuration.



If someone have to report the existence of some news repositories (as ktown5) or correct the url of some existent in slackpkg+ this is a good moment.

Alien Bob 12-10-2014 08:16 AM

Quote:

Originally Posted by zerouno (Post 5282426)
If someone have to report the existence of some news repositories (as ktown5) or correct the url of some existent in slackpkg+ this is a good moment.

There's always these: http://taper.alienbase.nl/mirrors/al...rrent/testing/ (with ARCH subdirectories). This is the repository in which I offer any testing software. At the moment, it contains the KDE 5 stuff (frameworks, plasma).

Eric

phenixia2003 12-10-2014 11:09 AM

1 Attachment(s)
Hello,

Quote:

Originally Posted by zerouno (Post 5282426)
It's a good idea.

Currently I've few time to apply patch.
However another think that should be done is to remove the ":.*" in PKGS_PRIORITY to select the entire repository.

I think that if I put
PKGS_PRIORITY=( multilib )
if slackpkg+ found it as an existent repository, it should replace automatically with multilib:.*

For that, once you have applied the patch I sent yesterday , apply the patch below (in attachment too) :
Code:

--- slackpkgplus.sh_1.3.3_rev20141209c  2014-12-10 17:48:21.517653841 +0100
+++ slackpkgplus.sh    2014-12-10 17:59:06.639682626 +0100
@@ -545,13 +545,20 @@
    cat $TMPDIR/greylist.1|sed 's/^/SLACKPKGPLUS_/' >$TMPDIR/greylist.2
  fi
 
+  INDEX=0
  PURE_PKGSPRIORITY=""
  for pp in ${PKGS_PRIORITY[@]} ; do
    repository=$(echo "$pp" | cut -f1 -d":")
 
+    if [ "$pp" == "$repository" ] ; then
+      pp="$repository:.*"
+      PKGS_PRIORITY[$INDEX]="$repository:.*"
+    fi
+
    if ! echo "$repository" | grep -qwE "$SLACKDIR_REGEXP" ; then
        PURE_PKGSPRIORITY=( ${PURE_PKGSPRIORITY[*]} $pp )
    fi
+    ((INDEX++))
  done
 
  REPOPLUS=$(echo "${REPOPLUS[*]} ${PURE_PKGSPRIORITY[*]} ${!MIRRORPLUS[*]}"|sed 's/ /\n/g'|sed 's/:.*//'|awk '{if(!a[$1]++)print $1}')

Cheers.

Edit:

Oops, I forgot to check the validity of repository. To fix that, once you have applied the patch above, change the line :
Code:

    if [ "$pp" == "$repository" ] ; then
by

Code:

    if [ "$pp" == "$repository" ] && grep -q "^SLACKPKGPLUS_${repository}[ ]" $WORKDIR/pkglist ; then


--
SeB

gegechris99 12-10-2014 03:20 PM

Quote:

Originally Posted by zerouno (Post 5282426)
If someone have to report the existence of some news repositories (as ktown5) or correct the url of some existent in slackpkg+ this is a good moment.

kikinovak has changed the organization of his Microlinux repositories. For desktop editions (only available for 14.1), it now looks like:

Code:

MIRRORPLUS['desktop-base']=http://www.microlinux.fr/slackware/desktop-base-14.1-{32,64}bit/
MIRRORPLUS['desktop-extra']=http://www.microlinux.fr/slackware/desktop-extra-14.1-{32,64}bit/
MIRRORPLUS['desktop-kde']=http://www.microlinux.fr/slackware/desktop-kde-14.1-{32,64}bit/
MIRRORPLUS['desktop-xfce']=http://www.microlinux.fr/slackware/desktop-xfce-14.1-{32,64}bit/

There is also a server edition available for both 14.0 and 14.1:

Code:

MIRRORPLUS['microlinux-server']=http://www.microlinux.fr/slackware/server-{14.0,14.1}-{32,64}bit/

zerouno 12-13-2014 09:23 AM

Quote:

Originally Posted by phenixia2003 (Post 5282564)
Code:

    if [ "$pp" == "$repository" ] && grep -q "^SLACKPKGPLUS_${repository}[ ]" $WORKDIR/pkglist ; then

at first slackpkg update it generate an error:
grep: /var/lib/slackpkg/pkglist: No such file or directory

I added a 2>/dev/null



uploaded.

bormant 02-07-2015 02:34 AM

slackpkg+ enhanced output skips some packages in 'slackpkg search package' when "package-other" and "package" exist in repositories and only "package-other" (with longer name) instaled.

0. slackpkg+ repositiries and versions
Code:

# grep '^MIRROR\|^REPO' /etc/slackpkg/slackpkgplus.conf
REPOPLUS=( slackpkgplus alienbob mled-e )
MIRRORPLUS['alienbob']=http://taper.alienbase.nl/mirrors/people/alien/sbrepos/14.1/x86_64/
MIRRORPLUS['mled-e']=http://www.microlinux.fr/slackware/extras-14.1-64bit/
MIRRORPLUS['slackpkgplus']=http://slakfinder.org/slackpkg+/

# slackpkg update

# slackpkg search slackpkg
The list below shows all packages with name matching "slackpkg".
[ Status          ] [ Repository              ] [ Package                                  ]
  installed                                        slackpkg-2.82.0-noarch-12               
  installed          slackpkgplus                slackpkg+-1.4.0-noarch-2mt

1. There are 'dropbox' package in 'mled-e' and 'dropbox-client' package in 'alienbob':
Code:

# ls /var/adm/packages/dropbox-*
/bin/ls: cannot access /var/adm/packages/dropbox-*: No such file or directory

# slackpkg search dropbox
The list below shows all packages with name matching "dropbox".
[ Status          ] [ Repository              ] [ Package                                  ]
  uninstalled          alienbob                    dropbox-client-1.6.1-x86_64-1alien       
  uninstalled          mled-e                      dropbox-2.10.41-x86_64-1_microlinux

2. Install 'dropbox-client' and run 'slackpkg search dropbox' again
Code:

# ls /var/adm/packages/dropbox-*
/var/adm/packages/dropbox-client-1.6.1-x86_64-1alien

# slackpkg search dropbox
The list below shows all packages with name matching "dropbox".
[ Status          ] [ Repository              ] [ Package                                  ]
  installed          alienbob                    dropbox-client-1.6.1-x86_64-1alien

Bug: there is no line about uninstalled 'dropbox' from 'mled-e'.

'slackpkg install dropbox' works as expected here and shows dropbox-2.10.41-x86_64-1_microlinux in package list.

3. Install 'dropbox' and run 'slackpkg search dropbox' again
Code:

# ls /var/adm/packages/dropbox-*
/var/adm/packages/dropbox-2.10.41-x86_64-1_microlinux
/var/adm/packages/dropbox-client-1.6.1-x86_64-1alien

# slackpkg search dropbox
The list below shows all packages with name matching "dropbox".
[ Status          ] [ Repository              ] [ Package                                  ]
  installed          alienbob                    dropbox-client-1.6.1-x86_64-1alien       
  installed          mled-e                      dropbox-2.10.41-x86_64-1_microlinux

Ok.

4. Remove 'dropbox-client' (package with long name) when 'dropbox' still here
Code:

# ls /var/adm/packages/dropbox-*
/var/adm/packages/dropbox-2.10.41-x86_64-1_microlinux

# slackpkg search dropbox
The list below shows all packages with name matching "dropbox".
[ Status          ] [ Repository              ] [ Package                                  ]
  uninstalled          alienbob                    dropbox-client-1.6.1-x86_64-1alien       
  installed          mled-e                      dropbox-2.10.41-x86_64-1_microlinux

Ok.

phenixia2003 02-07-2015 05:27 AM

1 Attachment(s)
Hello,

Quote:

Originally Posted by bormant (Post 5313424)
slackpkg+ enhanced output skips some packages in 'slackpkg search package' when "package-other" and "package" exist in repositories and only "package-other" (with longer name) instaled.


I looked at this and the issue comes from the line #512 which was superseded with #513 because of troubles on system with mixed package architectures, as far as i remember.

Code:

509      # First is the package already installed?
510      # Amazing what a little sleep will do
511      # exclusion is so much nicer :)
512      INSTPKG=$(ls -1 $ROOT/var/log/packages | grep -e "^${BASENAME}-[^-]\+-[^-]\+-[^-]\+")
513      #INSTPKG=$(ls -1 $ROOT/var/log/packages | grep -e "^${BASENAME}-[^-]\+-\(${ARCH}\|fw\|noarch\)-[^-]\+")

With #513 instead of #512, the problem is gone:

Code:

$ slackpkg search dropbox

DONE

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

[ Status          ] [ Repository              ] [ Package                                  ]
  installed          alienbob                    dropbox-client-1.6.1-x86_64-1alien       
  uninstalled          mled-e                      dropbox-2.10.41-x86_64-1_microlinux     

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

So, to solve this problem while preventing issues on systems with mixed package architectures, I suggest this patch (also in attachment) :
Code:

--- slackpkgplus.sh    2015-01-09 18:13:24.000000000 +0100
+++ slackpkgplus.sh.new 2015-02-07 12:17:10.850147819 +0100
@@ -509,9 +509,14 @@
      # 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}-[^-]\+-[^-]\+-[^-]\+")
      #INSTPKG=$(ls -1 $ROOT/var/log/packages | grep -e "^${BASENAME}-[^-]\+-\(${ARCH}\|fw\|noarch\)-[^-]\+")
 
+      if [ "$ALLOW32BIT" == "on" ] ; then
+      ARCH="\($ARCH\)\|\([i]*[3456x]86[^_]*\)"
+      fi
+      INSTPKG=$(ls -1 $ROOT/var/log/packages | grep -e "^${BASENAME}-[^-]\+-\(${ARCH}\|fw\|noarch\)-[^-]\+")
+
      # INSTPKG is local version
      if [ ! "${INSTPKG}" = "" ]; then

--
SeB

bormant 02-07-2015 12:11 PM

@phenixia2003,
great work, thanks.

zerouno 07-01-2015 02:35 PM

Added new feature.

I'm releasing a new release, 1.5.0
I added a way to obtains an adaptative package priority, but it need testing.

if you add
TAG_PRIORITY=on
in configuration files, slackpkg+ try - in upgrade mode - to detect repository from which download the package using the tag of the installed package.
The idea is that if I install the package openjdk from slacky, I will want upgrade it from slacky repository without specify that in PKG_PRIORITY everytime that I install a new package.

openjdk is present in both alienbob and slacky repositories.
I've
REPOPLUS=( slackpkgplus alienbob slacky )

if I install openjdk with
Code:

slackpkg install slacky:openjdk
slackpkg+ install the slacky version of openjdk
if I upgrade it with
Code:

slackpkg upgrade-all
slackpkg+ overwrite openjdk with the alienbob version.

with
TAG_PRIORITY=on
slackpkg+ see the tag of package (sl) and search the first package openjdk that contains that tag, so it will upgrade openjdk with the slacky version.

If slackpkg+ found a package with the same tag in two or more repositories (for example restricted and alienbob contains many duplicated but differents packages with the same name and same tag), it will honor $REPOPLUS order.

The only exception where is not preserved the tag is when in a slackware-stable the installed package is an official slackware package and exists a patch for that package.


please give me feedback and bug reporting

Thankyou

kikinovak 07-01-2015 03:56 PM

Hi zerouno,

I'm making heavy use of slackpkg+, though I deliberatlely use an older version (1.3.2 I think). At one point there were way too many features and variables, so I stopped at that version.

Don't forget the KISS principle and don't drown your great tool in a feature tsunami.

Cheers,

Niki

linuxtinker 07-01-2015 11:01 PM

As soon as I get to install 1.5.0 Ill let you know how it works. I run into this issue all the time with some ponce & slacky packages.
Thanks for your work!


All times are GMT -5. The time now is 01:53 PM.