SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The CHECKSUMS.md5 does not contain the md5 for the .asc files
This would tally with the output I see:
Code:
==============================================================================
WARNING! One or more errors occurred while slackpkg was running
------------------------------------------------------------------------------
xfce4-diskperf-plugin-2.5.4-x86_64-1_rlw.txz.asc: md5sum
xfce4-netload-plugin-1.2.4-x86_64-1_rlw.txz.asc: md5sum
xfce4-diskperf-plugin-2.5.4-x86_64-1_rlw.txz.asc: md5sum
xfce4-netload-plugin-1.2.4-x86_64-1_rlw.txz.asc: md5sum
xfce4-diskperf-plugin-2.5.4-x86_64-1_rlw.txz.asc: md5sum
xfce4-netload-plugin-1.2.4-x86_64-1_rlw.txz.asc: md5sum
I had a problem (bug?) using slackpkg+ 1.7.0 and also I have a feature request :)
The problem/bug:
In my conf file I have "REPOPLUS=( repo1 repo2 slackpkgplus repo3 repo4 )" and "PKG_PRIORITY=( slackpkgplus repo1 repo2 repo3 repo4 )".
When I search for slackpkg, it tells me that slackpkg+-1.7.0-noarch-4mt should be upgraded to slackpkg+-1.7.0-noarch-repo1... so it is ignoring PKG_PRIORITY entirely.
The feature request:
Is it possible to extend the repository:package format to templates?
Having something like
repo1:package1
repo1:package2
repo2:package3
repo1:package4
...would be very useful for having templates that include package from different repositories that may have the same packages.
For example: repo1 and repo2 both have package1 + package2 + package3 + package4, but in repo2 package3 was compiled with some optional dependencies that I would like to use. But only package3... all other packages should come from repo1.
I had a problem (bug?) using slackpkg+ 1.7.0 and also I have a feature request
The problem/bug:
In my conf file I have "REPOPLUS=( repo1 repo2 slackpkgplus repo3 repo4 )" and "PKG_PRIORITY=( slackpkgplus repo1 repo2 repo3 repo4 )".
When I search for slackpkg, it tells me that slackpkg+-1.7.0-noarch-4mt should be upgraded to slackpkg+-1.7.0-noarch-repo1... so it is ignoring PKG_PRIORITY entirely.
EDIT:
Just noticed that your slackpkgplus.conf seems to contain PKG_PRIORITY instead of PKGS_PRIORITY.
So, unless I'm wrong you can ignore the following.
You should post you slackpkgplus.conf and the exact output of command :
$ slackpkg search slackpkg
Looking for slackpkg in package list. Please wait... DONE
The list below shows all packages with name matching "slackpkg".
[ Status ] [ Repository ] [ Package ]
installed slackpkgplus slackpkg+-1.7.0-noarch-4mt
installed slackware64 slackpkg-2.82.1-noarch-3
uninstalled(masked) mleddesktop slackpkg+-1.7.0-noarch-1_microlinux
You can search specific files using "slackpkg file-search file".
Quote:
Originally Posted by Slax-Dude
The feature request:
Is it possible to extend the repositoryackage format to templates?
Having something like
repo1ackage1
repo1ackage2
repo2ackage3
repo1ackage4
...would be very useful for having templates that include package from different repositories that may have the same packages.
For example: repo1 and repo2 both have package1 + package2 + package3 + package4, but in repo2 package3 was compiled with some optional dependencies that I would like to use. But only package3... all other packages should come from repo1.
What do you think?
I never tried, but I think that slackpkg+ supports this without the need to have packages prefixed with their source repository. You only need to ensure that the same slackpkgplus.conf is installed on systems for which the template will be used. If you have trouble with some packages, you can try to set TAG_PRIORITY=on in slackpkgplus.conf.
--
SeB
Last edited by phenixia2003; 09-20-2016 at 09:52 AM.
EDIT:
Just noticed that your slackpkgplus.conf seems to contain PKG_PRIORITY instead of PKGS_PRIORITY.
That fixed it!
Must use copy/paste more when editing config files so I don't make these mistakes
Quote:
Originally Posted by phenixia2003
I never tried, but I think that slackpkg+ supports this without the need to have packages prefixed with their source repository. You only need to ensure that the same slackpkgplus.conf is installed on systems for which the template will be used. If you have trouble with some packages, you can try to set TAG_PRIORITY=on in slackpkgplus.conf.
TAG_PRIORITY=on would not help, I think, since the packages are not installed yet... so how will slackpkg guess what the right tag for each package?
Using the template above implies installation of slackpkg+ from repository slackpkgplus :
Code:
$ slackpkg -dialog=off -default_answer=no -batch=on install-template test
Looking for packages in "test-template" template to install. Please wait...DONE
[ Repository ] [ Package ]
slackpkgplus slackpkg+-1.7.0-noarch-4mt.txz
Total package(s): 1
Do you wish to install-template selected packages (Y/n)? n
On the other hand, if PKGS_PRIORITY is undefined or defined as below :
Code:
PKGS_PRIORITY=( mleddesktop slackpkgplus )
Using the template above implies installation of slackpkg+ from repository mleddesktop :
Code:
$ slackpkg -dialog=off -default_answer=no -batch=on install-template test
Looking for packages in "test-template" template to install. Please wait...DONE
[ Repository ] [ Package ]
mleddesktop slackpkg+-1.7.0-noarch-1_microlinux.txz
Total package(s): 1
Do you wish to install-template selected packages (Y/n)? n
Edit:
The drawback here, is that each generated template is implicitly linked to the slackpkgplus.conf in use. Therefore, if you loose this configuration, the template could not work as it should, unless the slackpkgplus.conf is rebuilt.
Even if it would be easier to rebuild the slackpkgplus.conf file, this drawback also applies in case the format "R:P" was extended to templates.
--
SeB
Last edited by phenixia2003; 09-21-2016 at 03:05 AM.
Reason: 1) corrected inaccuracies about priorities. 2) Note about drawbacks: a) of current handling of template, b) of extending format R:P to template
I think having the same conf file will not help, unless I implicitly state all the packages from repo2 that should have priority over the ones from repo1.
If there is only 1 or 2 packages, this is a doable workaround... but if I have a template with hundreds of packages and half of them should come from repo1 and half from repo2... it's a nightmare.
Here is an example :)
Let's say I have a template with 100 packages.
Most of them will be from slackonly, but some like ffmpeg and libreoffice are from alienbob, and others like virt-manager from mleddesktop and others still from some other repos.
How should I manage repo priorities? Please note that some packages are present in more than one repo, but not all of them.
the PKGS_PRIORITY variable would be looooooooong if I would do it like this :(
I also don't know if ( repo2:package3 repo1 repo2 ) would work.
If templates supported the R:P format, this would be much easier to config.
Something like this:
package1
package2
repo2:package3
repo1:package4
package5
package6
All lines in template that have R:P format would respect it, those that don't have a R:P format should respect PKGS_PRIORITY as usual. This would keep backwards compatibility with all those template files out there.
We can already "slackpkg install restricted:vlc" regardless of PKG_PRIORITY, right, so it is already possible to bypass it?
I think having the same conf file will not help, unless I implicitly state all the packages from repo2 that should have priority over the ones from repo1.
If there is only 1 or 2 packages, this is a doable workaround... but if I have a template with hundreds of packages and half of them should come from repo1 and half from repo2... it's a nightmare.
Here is an example
Let's say I have a template with 100 packages.
Most of them will be from slackonly, but some like ffmpeg and libreoffice are from alienbob, and others like virt-manager from mleddesktop and others still from some other repos.
How should I manage repo priorities? Please note that some packages are present in more than one repo, but not all of them.
That's right. But, anyway, in this context, even if syntax R:P was supported by templates, you will have to declare the same huge PKGS_PRIORITY or set TAG_PRIORITY=on (*) to ensure that upgrades are properly selected once the packages declared in the template are installed.
(*) which can fail in case of packages with same version and same build.
I'll check if there's an easy way to have syntax R:P supported by templates.
--
SeB
Last edited by phenixia2003; 09-21-2016 at 07:55 AM.
--- slackpkgplus.sh.org 2016-09-21 18:24:55.429874341 +0200
+++ slackpkgplus.sh 2016-09-21 19:45:56.205848837 +0200
@@ -10,7 +10,7 @@
# regular expression used to distinguish the 3rd party repositories from the standard slackware directories.
#
-SLACKDIR_REGEXP="^((slackware)|(slackware64)|(extra)|(pasture)|(patches)|(testing))$"
+SLACKDIR_REGEXP="^((slackware)|(slackware64)|(extra)|(pasture)|(patches)|(testing))"
# CLOG_PKGREGEX : regular expression used to find package entry in ChangeLog files
# CLOG_SEPREGEX : regular expression that match the "standard" entry separator in a ChangeLog file
@@ -84,6 +84,7 @@
# function showChangeLogInfo()
# function showlist() // dialog=on
# function showlist() // dialog=off
+ # function generate_template()
##### ===== BLACKLIST FUNCTIONS === #####
@@ -899,7 +900,37 @@
fi
fi
- for CPRIORITY in ${PRIORITY[@]} ; do
+ # This is to support installation of packages declared in
+ # template with extendedsyntax support (ie. R:).
+ #
+ # when install-template is passed to slackpkg, a list of packages
+ # is generated from the specified template, then passed to makelist()
+ # which call givepriority for each declared packages in the template.
+ #
+ # in case of template with extended syntax, this means that ARGUMENT
+ # passed to givepriority can be expressed as "repository:name". Therefore,
+ # this "priority" must be prepended to PRIORITY and ARGUMENT set to "name"
+ # otherwise the package will not be installed.
+ #
+ # Prepending PRIORITY with all priority specified in a template could
+ # lead to slowdown. Therefore, only the current priority is prepended
+ # to WORKING_PRIORITY which is first initialized with priorities
+ # declared in variable PRIORITY.
+
+ WORKING_PRIORITY=( echo ${PRIORITY[@]} )
+
+ if [[ "$CMD" == "install-template" ]] && [[ "$ARGUMENT" =~ .*:.* ]] ; then
+
+ if echo "$ARGUMENT" | grep -qwE "(^$SLACKDIR_REGEXP)|(^SLACKPKGPLUS_)" ; then
+ WORKING_PRIORITY=( "${ARGUMENT}" ${PRIORITY[@]} )
+ else
+ WORKING_PRIORITY=( "SLACKPKGPLUS_$ARGUMENT" ${PRIORITY[@]} )
+ fi
+ ARGUMENT=$(echo $ARGUMENT | cut -f2 -d":")
+ fi
+
+
+ for CPRIORITY in ${WORKING_PRIORITY[@]} ; do
[ "$PKGDATA" ] && break
DIR=${CPRIORITY/:*/}
@@ -1515,6 +1546,97 @@
#### ===== END SHOWLIST FUNCTIONS ====== ######
+ #### ===== BEGIN TEMPLATE FUNCTIONS ==== ####
+
+# override generate_template() from core-functions.sh
+#
+# This version generates template with packages prefixed
+# by their respective repositories (ie. R:P)
+#
+generate_template() {
+
+ if [ "$USE_INCLUDES" = "on" ]; then
+ (
+ cd $TEMPLATEDIR
+ if [ "$(ls *.template 2>/dev/null)" != "" ]; then
+ echo -e "\tParsing actual template files:"
+ for i in *.template ; do
+ echo -e "\t\t$i"
+ parse_template $i
+ done
+ fi
+ )
+ fi
+
+ touch $TMPDIR/allheaders
+
+ touch $TMPDIR/waiting
+ echo -e "\tGenerating slackware installed package list (this may take a while) \c"
+ [ "$SPINNING" = "off" ] || spinning ${TMPDIR}/waiting &
+
+ # This is needed to ensure that givepriority() will work and return
+ # the good package when there are different versions of the same package
+ # in different repositories...
+
+ cat ${WORKDIR}/pkglist > ${TMPDIR}/pkglist
+
+ for i in $ROOT/var/log/packages/* ; do
+ PKGNAME=$( echo $i | sed 's?.*/??;s/\.t[bglx]z$//' )
+ BASENAME="${PKGNAME%-*-*-*}"
+ givepriority "$BASENAME"
+
+ PKGINFO=$( grep "$PKGNAME" ${TMPDIR}/pkglist | cut -f1,2 -d" " --output-delimiter=":" | sed "s/^SLACKPKGPLUS_//")
+
+ if [ -z "$PKGINFO" ] ; then
+ # there's no package in database that match the installed version. In this
+ # case, select 1st package in database whose basename=$BASENAME, if any.
+
+ if grep -q " $BASENAME " ${TMPDIR}/pkglist ; then
+ echo $BASENAME>> $TMPDIR/$TEMPLATE.work
+ fi
+ else
+ echo $PKGINFO>> $TMPDIR/$TEMPLATE.work
+ fi
+
+
+ done
+ rm $TMPDIR/waiting
+ echo " "
+
+ echo -e "\tGenerating $TEMPLATE "
+ for TMPLATE in $( wc -l $TMPDIR/* | sort -r | \
+ awk -F/ '/template.tmp/ { print $NF }'); do
+ if ! $( grep -q "^#include.*${TMPLATE/.tmp/}" \
+ $TMPDIR/allheaders) ; then
+ diff -y $TMPDIR/$TEMPLATE.work $TMPDIR/$TMPLATE | \
+ awk -vTMPDIR=$TMPDIR \
+ '!/</ { print $1 > TMPDIR"/same" }
+ /</ { print $1 > TMPDIR"/notsame" }'
+ if $( diff -q $TMPDIR/$TMPLATE \
+ $TMPDIR/same &>/dev/null ); then
+ echo "#include ${TMPLATE/.tmp/}" \
+ >> $TMPDIR/$TEMPLATE.header
+ cat $TMPDIR/${TMPLATE/.tmp/}.header \
+ >> $TMPDIR/allheaders 2>/dev/null
+ cat $TMPDIR/same >> $TMPDIR/allfiles
+ fi
+ fi
+ done
+
+ if [ -e $TMPDIR/allfiles ]; then
+ sort -u $TMPDIR/allfiles > $TMPDIR/alluniqfiles
+ else
+ touch $TMPDIR/alluniqfiles
+ fi
+ if [ -e $TMPDIR/$TEMPLATE.header ]; then
+ cat $TMPDIR/$TEMPLATE.header > $TEMPLATEDIR/$TEMPLATE
+ fi
+ diff $TMPDIR/alluniqfiles $TMPDIR/$TEMPLATE.work |\
+ awk '/>/ { print $2 }' >> $TEMPLATEDIR/$TEMPLATE
+}
+
+ #### ===== END TEMPLATE FUNCTIONS ==== ####
+
function debug(){
echo "DEBUG $(date +%H:%M:%S.%N) (${BASH_LINENO[*]}): $@" >&2
@@ -1599,7 +1721,7 @@
PKGS_PRIORITY[$INDEX]="$repository:.*"
fi
- if ! echo "$repository" | grep -qwE "$SLACKDIR_REGEXP" ; then
+ if ! echo "$repository" | grep -qwE "${SLACKDIR_REGEXP}$" ; then
PURE_PKGSPRIORITY=( ${PURE_PKGSPRIORITY[*]} $pp )
fi
((INDEX++))
@@ -1649,7 +1771,7 @@
if [ ! -z "$repository" ] && [ ! -z "$package" ] ; then
- if ! echo "$repository" | grep -qwE "$SLACKDIR_REGEXP" ; then
+ if ! echo "$repository" | grep -qwE "${SLACKDIR_REGEXP}$" ; then
repository="SLACKPKGPLUS_${repository}"
fi
@@ -1837,7 +1959,7 @@
# require to add rule "${repository} ${package}" in the priority filter
PRIORITY_FILTER_RULE="${repository} ${package}"
- if ! echo "$repository" | grep -qwE "$SLACKDIR_REGEXP" ; then
+ if ! echo "$repository" | grep -qwE "${SLACKDIR_REGEXP}$" ; then
repository="SLACKPKGPLUS_${repository}"
fi
Consider this as being in alpha state. It would be useful to test it with different scenarios.
Here is an example :
Code:
$ cat /etc/slackpkg/template/test.template
slackware64:MPlayer
slackware64:alsa-lib
slackware64:clisp
slackware64:esound
mleddesktop:slackpkg+
restricted:ffmpeg
$ grep -E "^(PKGS_PRIORITY=|REPOPLUS=)" /etc/slackpkg/slackpkgplus.conf
PKGS_PRIORITY=( restricted:ffmpeg )
REPOPLUS=( slackpkgplus mleddesktop alienbob restricted )
$ slackpkg -dialog=off -default_answer=no -batch=on install-template test
Looking for packages in "test" template to install. Please wait...DONE
[ Repository ] [ Package ]
mleddesktop slackpkg+-1.7.0-noarch-1_microlinux.txz
restricted ffmpeg-3.1.1-x86_64-1alien.txz
slackware64 MPlayer-1.2_20160125-x86_64-3.txz
slackware64 alsa-lib-1.1.1-x86_64-2.txz
slackware64 clisp-2.49-x86_64-3.txz
slackware64 esound-0.2.41-x86_64-2.txz
Total package(s): 6
Do you wish to install-template selected packages (Y/n)? n
Note: I have intentionally given priority to slackpkg+ from "mleddesktop" over "slackpkgplus" to show that priorities defined in templates take precedence over the others priorities.
Furthermore, with this patch, slackpkg generate templates with the enhanced syntax :
Code:
$ slackpkg generate-template template-with-enhanced-syntax
new generate_template() called ...
Generating slackware installed package list (this may take a while)
Generating template-with-enhanced-syntax.template
cat /etc/slackpkg/template/template-with-enhanced-syntax.template
slackware64:MPlayer
slackware64:alsa-lib
slackware64:clisp
slackware64:esound
restricted:ffmpeg
mleddesktop:slackpkg+
....
--
SeB
Last edited by phenixia2003; 09-21-2016 at 12:46 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.