From 23ae95e0887fd257c5bba65a9fa8cb324b589f15 Mon Sep 17 00:00:00 2001 From: Matteo Rossini Date: Tue, 19 Nov 2013 12:52:44 +0100 Subject: [PATCH 1/9] Update slackpkg+ version (1.0.1) --- src/slackpkgplus.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slackpkgplus.sh b/src/slackpkgplus.sh index 8da0339..c98c1d6 100755 --- a/src/slackpkgplus.sh +++ b/src/slackpkgplus.sh @@ -25,7 +25,7 @@ fi if [ "$SLACKPKGPLUS" = "on" ];then - SPKGPLUS_VERSION="1.0" + SPKGPLUS_VERSION="1.0.1" VERSION="$VERSION / slackpkg+ $SPKGPLUS_VERSION" From 538cbf2b56c5edb241e85bc0603ee8fdb6f03fe9 Mon Sep 17 00:00:00 2001 From: Matteo Rossini Date: Fri, 29 Nov 2013 13:14:32 +0100 Subject: [PATCH 2/9] - Added WGETOPTS. This allow to pass parameters to 'wget'. You can use it as a workaround for repository indisponibility by set it to WGETOPTS="--timeout=5 --tries=1" --- src/slackpkgplus.sh | 12 +++++++----- src/slackpkgplus.x86.sample | 9 ++++++--- src/slackpkgplus.x86_64.sample | 6 ++++++ 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/slackpkgplus.sh b/src/slackpkgplus.sh index c98c1d6..31d71d6 100755 --- a/src/slackpkgplus.sh +++ b/src/slackpkgplus.sh @@ -6,16 +6,18 @@ declare -A MIRRORPLUS declare -A NOTIFYMSG if [ -e /etc/slackpkg/slackpkgplus.conf ];then - # You can override SLACKPKGPLUS VERBOSE USEBL from command-line + # You can override WGETOPTS SLACKPKGPLUS VERBOSE USEBL from command-line EXTSLACKPKGPLUS=$SLACKPKGPLUS EXTVERBOSE=$VERBOSE EXTUSEBL=$USEBL + EXTWGETOPTS=$WGETOPTS . /etc/slackpkg/slackpkgplus.conf SLACKPKGPLUS=${EXTSLACKPKGPLUS:-$SLACKPKGPLUS} VERBOSE=${EXTVERBOSE:-$VERBOSE} USEBL=${EXTUSEBL:-$USEBL} + WGETOPTS=${EXTWGETOPTS:-$WGETOPTS} USEBLACKLIST=true if [ "$USEBL" == "0" ];then @@ -669,13 +671,13 @@ if [ "$SLACKPKGPLUS" = "on" ];then } - DOWNLOADER="wget --no-check-certificate --passive-ftp -O" + DOWNLOADER="wget $WGETOPTS --no-check-certificate --passive-ftp -O" if [ "$VERBOSE" = "0" ];then - DOWNLOADER="wget --no-check-certificate -nv --passive-ftp -O" + DOWNLOADER="wget $WGETOPTS --no-check-certificate -nv --passive-ftp -O" elif [ "$VERBOSE" = "2" ];then - DOWNLOADER="wget --no-check-certificate --passive-ftp -O" + DOWNLOADER="wget $WGETOPTS --no-check-certificate --passive-ftp -O" elif [ "$CMD" = "update" ];then - DOWNLOADER="wget --no-check-certificate -nv --passive-ftp -O" + DOWNLOADER="wget $WGETOPTS --no-check-certificate -nv --passive-ftp -O" fi # Global variable required by givepriority() diff --git a/src/slackpkgplus.x86.sample b/src/slackpkgplus.x86.sample index abfa815..ac935b2 100644 --- a/src/slackpkgplus.x86.sample +++ b/src/slackpkgplus.x86.sample @@ -12,6 +12,11 @@ VERBOSE=1 # 'USEBL=0 slackpkg upgrade-all' USEBL=1 +# Add custom option to 'wget'. +# You can solve the repository indisponibility issue by set a timeout here +#WGETOPTS="--timeout=5 --tries=1" + + # If two or more repositories contains some same packages, you can specify # from which repository you prefer to search it. # The syntax is ":" @@ -22,12 +27,11 @@ USEBL=1 #PKGS_PRIORITY=( myrepo:.* ) # -# List repositories you want to use (defined below). +# List repositories you want to use (defined below) # remember to launch 'slackpkg update' if you modify that row. REPOPLUS=( slackpkgplus restricted alienbob slacky ) - # Define mirrors (uncomment one or more mirror; remember to add it to REPOPLUS) # Note: only multilib,alienbob,restricted,slacky repositories support GPG. If you add others # you may need to disable gpg check in slackpkg.conf @@ -47,7 +51,6 @@ MIRRORPLUS['slackpkgplus']=http://slakfinder.org/slackpkg+/ #MIRRORPLUS['myrepo']=dir://repositories/mypackages/ - # -- Each entry in the hash table NOTIFYMSG allows to associate a message # to an event. At runtime, when an event E is triggered the associated # message NOTIFYMSG[E], if any, is printed, in a dialog when DIALOG=on, diff --git a/src/slackpkgplus.x86_64.sample b/src/slackpkgplus.x86_64.sample index 158a70c..9bf284f 100644 --- a/src/slackpkgplus.x86_64.sample +++ b/src/slackpkgplus.x86_64.sample @@ -12,6 +12,11 @@ VERBOSE=1 # 'USEBL=0 slackpkg upgrade-all' USEBL=1 +# Add custom option to 'wget'. +# You can solve the repository indisponibility issue by set a timeout here +#WGETOPTS="--timeout=5 --tries=1" + + # If two or more repositories contains some same packages, you can specify # from which repository you prefer to search it. # The syntax is ":" @@ -89,6 +94,7 @@ driver in use (nVidia, aTi), with 32-bit driver files if your system is\ multilib enabled." +# # Supported Repositories (see /usr/doc/slackpkg+-* for details): # From f34b81c549c1a10c04c96ccd2c074df63bc905aa Mon Sep 17 00:00:00 2001 From: Matteo Rossini Date: Fri, 29 Nov 2013 13:28:18 +0100 Subject: [PATCH 3/9] - Moved notify messages in a dedicated configuration file and added ENABLENOTIFY to enable/disable it --- src/doinst.sh | 1 + src/notifymsg.conf | 41 ++++++++++++++++++++++++++++++++++ src/slackpkg+.SlackBuild | 1 + src/slackpkgplus.sh | 3 +++ src/slackpkgplus.x86.sample | 36 +++-------------------------- src/slackpkgplus.x86_64.sample | 38 +++---------------------------- 6 files changed, 52 insertions(+), 68 deletions(-) create mode 100644 src/notifymsg.conf diff --git a/src/doinst.sh b/src/doinst.sh index 34e27dd..090e5da 100644 --- a/src/doinst.sh +++ b/src/doinst.sh @@ -36,6 +36,7 @@ copy_config_file() { copy_config_file config etc/slackpkg/slackpkgplus.conf.new +config etc/slackpkg/notifymsg.conf.new remove var/lib/slackpkg/ChangeLog.txt remove var/lib/slackpkg/pkglist echo diff --git a/src/notifymsg.conf b/src/notifymsg.conf new file mode 100644 index 0000000..b5a0376 --- /dev/null +++ b/src/notifymsg.conf @@ -0,0 +1,41 @@ +# This file contains all Notification Messages associated to an event. +# To enable the feature set ENABLENOTIFY=on in slackpkgplus.conf +# +# +# -- Each entry in the hash table NOTIFYMSG allows to associate a message +# to an event. At runtime, when an event E is triggered the associated +# message NOTIFYMSG[E], if any, is printed, in a dialog when DIALOG=on, +# on the standard output otherwise. +# +# The syntax of the variable NOTIFYMSG is as below : +# +# NOTIFYMSG[]="" +# +# EVENT ::= @ +# EVENTID ::= on_install|on_upgrade|on_remove +# PATTERNLIST ::= [,PATTERNLIST] +# MESSAGE ::= string +# +# Each PATTERN can be the basename of a package (i.e mesa), or a regular +# expression (mozilla-.*) +# +# When an event occurs, the basenames of packages that match a given +# PATTERNLIST is available at runtime through the variable NV_MATCHPKGS. +# Attention, this variable must be escaped (i.e \${NV_MATCHPKGS}) when +# referenced inside the MESSAGE associated to an EVENT. +# +# +NOTIFYMSG[on_install@mesa.*,xorg-server]="Package(s) \$NV_MATCHPKGS has(have) been (re)installed.\n\ +\n\ +In order to use graphical softwares, you should reinstall any proprietary\ +driver in use (nVidia, aTi)." + +NOTIFYMSG[on_upgrade@mesa.*,xorg-server]="Package(s) \$NV_MATCHPKGS has(have) been updated.\n\ +\n\ +In order to use graphical softwares, you should reinstall any proprietary\ +driver in use (nVidia, aTi)." + +NOTIFYMSG[on_upgrade@kernel-modules]="Package(s) \$NV_MATCHPKGS has(have) been updated.\n\ +\n\ +Remember to update lilo.conf and the initrd (if use one) to include new modules.\n\ +Also you need to rebuild all custom kernel modules (video driver, virtualization modules,...)." diff --git a/src/slackpkg+.SlackBuild b/src/slackpkg+.SlackBuild index 4edaf06..c168fca 100644 --- a/src/slackpkg+.SlackBuild +++ b/src/slackpkg+.SlackBuild @@ -30,6 +30,7 @@ cp $CWD/slackpkg+.SlackBuild usr/doc/slackpkg+-$VERSION/ cp $CWD/slackpkgplus.*.sample usr/doc/slackpkg+-$VERSION/ cp $CWD/slack-desc install/ cat $CWD/doinst.sh|sed "s/SLPVERSION/$VERSION/" > install/doinst.sh +cat $CWD/notifymsg.conf > etc/slackpkg/notifymsg.conf.new chmod +x usr/libexec/slackpkg/functions.d/slackpkgplus.sh chmod +x usr/libexec/slackpkg/functions.d/zdialogplus.sh diff --git a/src/slackpkgplus.sh b/src/slackpkgplus.sh index 31d71d6..fe64253 100755 --- a/src/slackpkgplus.sh +++ b/src/slackpkgplus.sh @@ -23,6 +23,9 @@ if [ -e /etc/slackpkg/slackpkgplus.conf ];then if [ "$USEBL" == "0" ];then USEBLACKLIST=false fi + if [ "$ENABLENOTIFY" = "on" -a -e /etc/slackpkg/notifymsg.conf ];then + . /etc/slackpkg/notifymsg.conf + fi fi if [ "$SLACKPKGPLUS" = "on" ];then diff --git a/src/slackpkgplus.x86.sample b/src/slackpkgplus.x86.sample index ac935b2..1596a83 100644 --- a/src/slackpkgplus.x86.sample +++ b/src/slackpkgplus.x86.sample @@ -16,6 +16,9 @@ USEBL=1 # You can solve the repository indisponibility issue by set a timeout here #WGETOPTS="--timeout=5 --tries=1" +# Enable (on) / Disable (off) notification events (see notifymsg.conf) +#ENABLENOTIFY=off + # If two or more repositories contains some same packages, you can specify # from which repository you prefer to search it. @@ -51,39 +54,6 @@ MIRRORPLUS['slackpkgplus']=http://slakfinder.org/slackpkg+/ #MIRRORPLUS['myrepo']=dir://repositories/mypackages/ -# -- Each entry in the hash table NOTIFYMSG allows to associate a message -# to an event. At runtime, when an event E is triggered the associated -# message NOTIFYMSG[E], if any, is printed, in a dialog when DIALOG=on, -# on the standard output otherwise. -# -# The syntax of the variable NOTIFYMSG is as below : -# -# NOTIFYMSG[]="" -# -# EVENT ::= @ -# EVENTID ::= on_install|on_upgrade|on_remove -# PATTERNLIST ::= [,PATTERNLIST] -# MESSAGE ::= string -# -# Each PATTERN can be the basename of a package (i.e mesa), or a regular -# expression (mozilla-.*) -# -# When an event occurs, the basenames of packages that match a given -# PATTERNLIST is available at runtime through the variable NV_MATCHPKGS. -# Attention, this variable must be escaped (i.e \${NV_MATCHPKGS}) when -# referenced inside the MESSAGE associated to an EVENT. -# -NOTIFYMSG[on_install@mesa.*,xorg-server]="Package(s) \$NV_MATCHPKGS has(have) been (re)installed.\n\ -\n\ -In order to use graphical softwares, you should reinstall any proprietary\ -driver in use (nVidia, aTi)." - -NOTIFYMSG[on_upgrade@mesa.*,xorg-server]="Package(s) \$NV_MATCHPKGS has(have) been updated.\n\ -\n\ -In order to use graphical softwares, you should reinstall any proprietary\ -driver in use (nVidia, aTi)." - - # # Supported Repositories (see /usr/doc/slackpkg+-* for details): # diff --git a/src/slackpkgplus.x86_64.sample b/src/slackpkgplus.x86_64.sample index 9bf284f..c7111f6 100644 --- a/src/slackpkgplus.x86_64.sample +++ b/src/slackpkgplus.x86_64.sample @@ -16,6 +16,9 @@ USEBL=1 # You can solve the repository indisponibility issue by set a timeout here #WGETOPTS="--timeout=5 --tries=1" +# Enable (on) / Disable (off) notification events (see notifymsg.conf) +#ENABLENOTIFY=off + # If two or more repositories contains some same packages, you can specify # from which repository you prefer to search it. @@ -59,41 +62,6 @@ MIRRORPLUS['slackpkgplus']=http://slakfinder.org/slackpkg+/ #MIRRORPLUS['myrepo']=dir://repositories/mypackages/ -# -- Each entry in the hash table NOTIFYMSG allows to associate a message -# to an event. At runtime, when an event E is triggered the associated -# message NOTIFYMSG[E], if any, is printed, in a dialog when DIALOG=on, -# on the standard output otherwise. -# -# The syntax of the variable NOTIFYMSG is as below : -# -# NOTIFYMSG[]="" -# -# EVENT ::= @ -# EVENTID ::= on_install|on_upgrade|on_remove -# PATTERNLIST ::= [,PATTERNLIST] -# MESSAGE ::= string -# -# Each PATTERN can be the basename of a package (i.e mesa), or a regular -# expression (mozilla-.*) -# -# When an event occurs, the basenames of packages that match a given -# PATTERNLIST is available at runtime through the variable NV_MATCHPKGS. -# Attention, this variable must be escaped (i.e \${NV_MATCHPKGS}) when -# referenced inside the MESSAGE associated to an EVENT. -# -NOTIFYMSG[on_install@mesa.*,xorg-server]="Package(s) \$NV_MATCHPKGS has(have) been (re)installed.\n\ -\n\ -In order to use graphical softwares, you should reinstall any proprietary\ -driver in use (nVidia, aTi), with 32-bit driver files if your system is\ -multilib enabled." - -NOTIFYMSG[on_upgrade@mesa.*,xorg-server]="Package(s) \$NV_MATCHPKGS has(have) been updated.\n\ -\n\ -In order to use graphical softwares, you should reinstall any proprietary\ -driver in use (nVidia, aTi), with 32-bit driver files if your system is\ -multilib enabled." - - # # Supported Repositories (see /usr/doc/slackpkg+-* for details): # From dc302eff2bc1b4b8d4817a550954d8739837f641 Mon Sep 17 00:00:00 2001 From: Matteo Rossini Date: Fri, 6 Dec 2013 05:49:10 +0100 Subject: [PATCH 4/9] Version 1.0.2 - 6/Dec/2013 - Added WGETOPTS - Moved notifications on a dedicated configuration file (notifymsg.conf) --- ChangeLog.txt | 4 ++++ src/ChangeLog.txt | 4 ++++ src/README | 30 ++++++++++++++++++++++++++++++ src/slackpkgplus.sh | 2 +- src/slackpkgplus.x86.sample | 2 +- src/slackpkgplus.x86_64.sample | 2 +- 6 files changed, 41 insertions(+), 3 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index e045392..39c1c9c 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,7 @@ +Version 1.0.2 - 6/Dec/2013 + - Added WGETOPTS + - Moved notifications on a dedicated configuration file (notifymsg.conf) + Version 1.0.1 - 14/Nov/2013 - Fixed fatal on 'pasture' repository and on invalid repository diff --git a/src/ChangeLog.txt b/src/ChangeLog.txt index e045392..39c1c9c 100644 --- a/src/ChangeLog.txt +++ b/src/ChangeLog.txt @@ -1,3 +1,7 @@ +Version 1.0.2 - 6/Dec/2013 + - Added WGETOPTS + - Moved notifications on a dedicated configuration file (notifymsg.conf) + Version 1.0.1 - 14/Nov/2013 - Fixed fatal on 'pasture' repository and on invalid repository diff --git a/src/README b/src/README index ba59ff8..ec75244 100644 --- a/src/README +++ b/src/README @@ -298,6 +298,36 @@ metadata!! ------ +NOTIFICATIONS + +Some package require special post-installation activity as upgrading a related +package or rebuilt kernel modules or change a custom configuration. A user may +forgot to do this, especially in large updates. The notification functionality +help the user to remember it. In /etc/slackpkg/notifymsg.conf you can define +some custom event. See documentation in that file. Events may be VERY custom +(on kde upgrde remember me to call my friends ;), or the more useful +"on kernel upgrade remember to recompile all driver modules" + +You may enable this function by setting "ENABLENOTIFY=on" in slackpkgplus.conf + + +----- + +WGET Options + +slackpkg+ uses wget to download packages and metadata. + +You can use the WGETOPTS setting to pass options to wget. + +By default when an url is unreachable wget - after a long timeout - retry to +download so if a repository is unreacheble you should remove it from your +configuration file. +As workaround you can add the options WGETOPTS="--timeout=5 --tries=1" +in slackpkgplus.conf + + +----- + FURTHER INFORMATION The AlienBOB article about slackpkg+: diff --git a/src/slackpkgplus.sh b/src/slackpkgplus.sh index fe64253..51d3d99 100755 --- a/src/slackpkgplus.sh +++ b/src/slackpkgplus.sh @@ -30,7 +30,7 @@ fi if [ "$SLACKPKGPLUS" = "on" ];then - SPKGPLUS_VERSION="1.0.1" + SPKGPLUS_VERSION="1.0.2" VERSION="$VERSION / slackpkg+ $SPKGPLUS_VERSION" diff --git a/src/slackpkgplus.x86.sample b/src/slackpkgplus.x86.sample index 1596a83..3414738 100644 --- a/src/slackpkgplus.x86.sample +++ b/src/slackpkgplus.x86.sample @@ -14,7 +14,7 @@ USEBL=1 # Add custom option to 'wget'. # You can solve the repository indisponibility issue by set a timeout here -#WGETOPTS="--timeout=5 --tries=1" +WGETOPTS="--timeout=5 --tries=1" # Enable (on) / Disable (off) notification events (see notifymsg.conf) #ENABLENOTIFY=off diff --git a/src/slackpkgplus.x86_64.sample b/src/slackpkgplus.x86_64.sample index c7111f6..5201900 100644 --- a/src/slackpkgplus.x86_64.sample +++ b/src/slackpkgplus.x86_64.sample @@ -14,7 +14,7 @@ USEBL=1 # Add custom option to 'wget'. # You can solve the repository indisponibility issue by set a timeout here -#WGETOPTS="--timeout=5 --tries=1" +WGETOPTS="--timeout=5 --tries=1" # Enable (on) / Disable (off) notification events (see notifymsg.conf) #ENABLENOTIFY=off From 4cd45ee7d21b94497ef12b64a0e7d5a5f46f9309 Mon Sep 17 00:00:00 2001 From: Matteo Rossini Date: Fri, 6 Dec 2013 10:32:20 +0100 Subject: [PATCH 5/9] - Added ALLOW32BIT flag to allow to install 32bit packages on a 64bit system --- src/README | 14 ++++++++++++++ src/slackpkgplus.sh | 14 ++++++++++++-- src/slackpkgplus.x86.sample | 7 +++++++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/README b/src/README index ec75244..87dab57 100644 --- a/src/README +++ b/src/README @@ -325,6 +325,20 @@ configuration file. As workaround you can add the options WGETOPTS="--timeout=5 --tries=1" in slackpkgplus.conf +----- + + +ALLOW32BIT + +By default slackpkg+ deny to install 32bit packages on a 64bit system. + +Set ALLOW32BIT=on to allow slackpkg+ to install 32bit packages on a 64bit slackware +installation (possibly unsafe). Please, do not install both 32 and 64bit of the same +package to avoid problems, and NEVER upgrade exitant 64bit packages with relative 32bit +package. + +Do not forget to install the multilibs. + ----- diff --git a/src/slackpkgplus.sh b/src/slackpkgplus.sh index 51d3d99..94b5fb9 100755 --- a/src/slackpkgplus.sh +++ b/src/slackpkgplus.sh @@ -6,7 +6,8 @@ declare -A MIRRORPLUS declare -A NOTIFYMSG if [ -e /etc/slackpkg/slackpkgplus.conf ];then - # You can override WGETOPTS SLACKPKGPLUS VERBOSE USEBL from command-line + # You can override WGETOPTS SLACKPKGPLUS VERBOSE USEBL ALLOW32BIT from command-line + EXTALLOW32BIT=$ALLOW32BIT EXTSLACKPKGPLUS=$SLACKPKGPLUS EXTVERBOSE=$VERBOSE EXTUSEBL=$USEBL @@ -14,6 +15,7 @@ if [ -e /etc/slackpkg/slackpkgplus.conf ];then . /etc/slackpkg/slackpkgplus.conf + ALLOW32BIT=${EXTALLOW32BIT:-$ALLOW32BIT} SLACKPKGPLUS=${EXTSLACKPKGPLUS:-$SLACKPKGPLUS} VERBOSE=${EXTVERBOSE:-$VERBOSE} USEBL=${EXTUSEBL:-$USEBL} @@ -234,7 +236,11 @@ if [ "$SLACKPKGPLUS" = "on" ];then X86_64=$(ls /var/log/packages/aaa_base*x86_64*|head -1 2>/dev/null) for PREPO in $REPOPLUS;do if [ ! -z "$X86_64" ];then - egrep -e ^[a-f0-9]{32} ${TMPDIR}/CHECKSUMS.md5-$PREPO|egrep -- "-(x86_64|noarch)-" |sed -r "s# \./# ./SLACKPKGPLUS_$PREPO/#" >> ${TMPDIR}/CHECKSUMS.md5 + if [ "$ALLOW32BIT" == "on" ];then + egrep -e ^[a-f0-9]{32} ${TMPDIR}/CHECKSUMS.md5-$PREPO|egrep -v -- "-(arm)-" |sed -r "s# \./# ./SLACKPKGPLUS_$PREPO/#" >> ${TMPDIR}/CHECKSUMS.md5 + else + egrep -e ^[a-f0-9]{32} ${TMPDIR}/CHECKSUMS.md5-$PREPO|egrep -v -- "-(i[3456]86|arm)-" |sed -r "s# \./# ./SLACKPKGPLUS_$PREPO/#" >> ${TMPDIR}/CHECKSUMS.md5 + fi else egrep -e ^[a-f0-9]{32} ${TMPDIR}/CHECKSUMS.md5-$PREPO|egrep -v -- "-(x86_64|arm)-" |sed -r "s# \./# ./SLACKPKGPLUS_$PREPO/#" >> ${TMPDIR}/CHECKSUMS.md5 fi @@ -702,6 +708,10 @@ if [ "$SLACKPKGPLUS" = "on" ];then fi done + if [[ "$CMD" == "upgrade" || "$CMD" == "upgrade-all" ]] && [ "$ALLOW32BIT" == "on" ] ; then + ARCH="\($ARCH\)\|\([i]*[3456x]86[^_]*\)" + fi + if [ "$CMD" == "install" ] || [ "$CMD" == "upgrade" ] || [ "$CMD" == "reinstall" ] || [ "$CMD" == "remove" ] ; then NEWINPUTLIST="" diff --git a/src/slackpkgplus.x86.sample b/src/slackpkgplus.x86.sample index 3414738..9ee9aba 100644 --- a/src/slackpkgplus.x86.sample +++ b/src/slackpkgplus.x86.sample @@ -12,6 +12,13 @@ VERBOSE=1 # 'USEBL=0 slackpkg upgrade-all' USEBL=1 +# By default slackpkg+ deny to install 32bit packages. +# Set this flag to 'on' allow slackpkg+ to install 32bit packages on a 64bit slackware +# installation (possibly unsafe). Please, do not install both 32 and 64bit of the same +# package to avoid problems, and NEVER upgrade exitant 64bit packages with relative 32bit package. +# Do not forget to install the multilibs. +#ALLOW32BIT=off + # Add custom option to 'wget'. # You can solve the repository indisponibility issue by set a timeout here WGETOPTS="--timeout=5 --tries=1" From 46b174478815c2ced9f716b13212d45d4caa3136 Mon Sep 17 00:00:00 2001 From: Matteo Rossini Date: Fri, 6 Dec 2013 11:47:41 +0100 Subject: [PATCH 6/9] - setupmultilib.sh install only adaptative multilib by default --- src/setupmultilib.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/setupmultilib.sh b/src/setupmultilib.sh index 550a07a..80a965b 100755 --- a/src/setupmultilib.sh +++ b/src/setupmultilib.sh @@ -74,7 +74,13 @@ if [ "$ANS" == "y" -o "$ANS" == "Y" ];then slackpkg update gpg slackpkg update slackpkg upgrade multilib - slackpkg install multilib + COMPATPKGS=$( + cd /var/log/packages + ls | rev |cut -f4- -d-|rev|sed -e 's/^/^slackware64 /' -e 's/$/ /' > /tmp/installed_packages1 + grep -f /tmp/installed_packages1 /var/lib/slackpkg/pkglist|awk '{print "SLACKPKGPLUS_multilib "$2"-compat32 "}' > /tmp/installed_packages2 + grep -f /tmp/installed_packages2 /var/lib/slackpkg/pkglist|awk '{print "multilib:"$2}' + ) + slackpkg install $COMPATPKGS echo "Multilib installed" else echo "To install multilib type:" From c5c4b254644fd88166bd72b38e05b1fe07ad5cb7 Mon Sep 17 00:00:00 2001 From: Matteo Rossini Date: Fri, 6 Dec 2013 11:50:42 +0100 Subject: [PATCH 7/9] Fixed missing alert on slackpkgplus.conf update --- src/slackpkgplus.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/slackpkgplus.sh b/src/slackpkgplus.sh index 94b5fb9..ec60dcb 100755 --- a/src/slackpkgplus.sh +++ b/src/slackpkgplus.sh @@ -498,7 +498,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then fi done - if [ /etc/slackpkgplus.conf -nt $WORKDIR/pkglist -a "$CMD" != "update" ];then + if [ /etc/slackpkg/slackpkgplus.conf -nt $WORKDIR/pkglist -a "$CMD" != "update" ];then echo echo "NOTICE: remember to re-run 'slackpkg update' after modifing slackpkgplus.conf" echo From f121bcb168cd6aaf3e02b50b8c8a38d994ece71f Mon Sep 17 00:00:00 2001 From: Matteo Rossini Date: Fri, 6 Dec 2013 13:44:43 +0100 Subject: [PATCH 8/9] Version 1.1.0 - 6/Dec/2013 - Added ALLOW32BIT flag to allow to install 32bit packages on a 64bit system - setupmultilib.sh install only adaptative multilib by default - Small fixes --- ChangeLog.txt | 5 +++++ src/ChangeLog.txt | 5 +++++ src/doinst.sh | 1 + src/greylist | 17 +++++++++++++++++ src/slackpkg+.SlackBuild | 1 + src/slackpkgplus.sh | 12 +++++++++++- src/slackpkgplus.x86.sample | 9 ++------- src/slackpkgplus.x86_64.sample | 9 +++++++++ src/zdialogplus.sh | 13 +++++++++++-- 9 files changed, 62 insertions(+), 10 deletions(-) create mode 100644 src/greylist diff --git a/ChangeLog.txt b/ChangeLog.txt index 39c1c9c..48b72e0 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,8 @@ +Version 1.1.0 - 6/Dec/2013 + - Added ALLOW32BIT flag to allow to install 32bit packages on a 64bit system + - setupmultilib.sh install only adaptative multilib by default + - Small fixes + Version 1.0.2 - 6/Dec/2013 - Added WGETOPTS - Moved notifications on a dedicated configuration file (notifymsg.conf) diff --git a/src/ChangeLog.txt b/src/ChangeLog.txt index 39c1c9c..48b72e0 100644 --- a/src/ChangeLog.txt +++ b/src/ChangeLog.txt @@ -1,3 +1,8 @@ +Version 1.1.0 - 6/Dec/2013 + - Added ALLOW32BIT flag to allow to install 32bit packages on a 64bit system + - setupmultilib.sh install only adaptative multilib by default + - Small fixes + Version 1.0.2 - 6/Dec/2013 - Added WGETOPTS - Moved notifications on a dedicated configuration file (notifymsg.conf) diff --git a/src/doinst.sh b/src/doinst.sh index 090e5da..4ea7ade 100644 --- a/src/doinst.sh +++ b/src/doinst.sh @@ -36,6 +36,7 @@ copy_config_file() { copy_config_file config etc/slackpkg/slackpkgplus.conf.new +config etc/slackpkg/greylist.new config etc/slackpkg/notifymsg.conf.new remove var/lib/slackpkg/ChangeLog.txt remove var/lib/slackpkg/pkglist diff --git a/src/greylist b/src/greylist new file mode 100644 index 0000000..b6bf76a --- /dev/null +++ b/src/greylist @@ -0,0 +1,17 @@ +# All packages in that list will be showned but +# unchecked by default +# +# You can greylist using regular expressions. +# +# Don't use *full* regex here, because all of the following +# will be checked for the regex: series, name, version, arch, +# build, fullname and repository name. +# +# Also you may want to greylist ALL slackpkgplus repository; +# useful if you want to run slackpkg install alienbob and select +# only the wanted package (instead de-select all unwanted): +#SLACKPKGPLUS_.* +# +# You may want to greylist kde and/or kdei +#kde +#kdei diff --git a/src/slackpkg+.SlackBuild b/src/slackpkg+.SlackBuild index c168fca..282b36b 100644 --- a/src/slackpkg+.SlackBuild +++ b/src/slackpkg+.SlackBuild @@ -28,6 +28,7 @@ cp $CWD/repositories.txt usr/doc/slackpkg+-$VERSION/ cp $CWD/setupmultilib.sh usr/doc/slackpkg+-$VERSION/ cp $CWD/slackpkg+.SlackBuild usr/doc/slackpkg+-$VERSION/ cp $CWD/slackpkgplus.*.sample usr/doc/slackpkg+-$VERSION/ +cp $CWD/greylist etc/slackpkg/greylist.new cp $CWD/slack-desc install/ cat $CWD/doinst.sh|sed "s/SLPVERSION/$VERSION/" > install/doinst.sh cat $CWD/notifymsg.conf > etc/slackpkg/notifymsg.conf.new diff --git a/src/slackpkgplus.sh b/src/slackpkgplus.sh index ec60dcb..5efd52e 100755 --- a/src/slackpkgplus.sh +++ b/src/slackpkgplus.sh @@ -32,7 +32,7 @@ fi if [ "$SLACKPKGPLUS" = "on" ];then - SPKGPLUS_VERSION="1.0.2" + SPKGPLUS_VERSION="1.1.0" VERSION="$VERSION / slackpkg+ $SPKGPLUS_VERSION" @@ -483,6 +483,12 @@ if [ "$SLACKPKGPLUS" = "on" ];then done } + touch $TMPDIR/greylist.1 + if [ -e /etc/slackpkg/greylist ];then + cat /etc/slackpkg/greylist|sed -e 's/#.*//'|grep -v -e '^#' -e '^$'|awk '{print $1}'|sort -u >$TMPDIR/greylist.1 + 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}') PRIORITY=( ${PRIORITY[*]} SLACKPKGPLUS_$(echo $REPOPLUS|sed 's/ / SLACKPKGPLUS_/g') ) @@ -569,6 +575,8 @@ if [ "$SLACKPKGPLUS" = "on" ];then if [ "$(head -1 ${TMPDIR}/blacklist.tmp|awk '{print $1}')" != "local" ];then cat ${TMPDIR}/pkglist-pre fi + cat $TMPDIR/greylist.* >$TMPDIR/greylist + grep -qvEw -f $TMPDIR/greylist $TMPDIR/pkglist-pre >$TMPDIR/unchecklist } @@ -889,4 +897,6 @@ if [ "$SLACKPKGPLUS" = "on" ];then cleanup fi + cat $TMPDIR/greylist*|sort -u >$TMPDIR/unchecklist + fi diff --git a/src/slackpkgplus.x86.sample b/src/slackpkgplus.x86.sample index 9ee9aba..35849df 100644 --- a/src/slackpkgplus.x86.sample +++ b/src/slackpkgplus.x86.sample @@ -12,13 +12,6 @@ VERBOSE=1 # 'USEBL=0 slackpkg upgrade-all' USEBL=1 -# By default slackpkg+ deny to install 32bit packages. -# Set this flag to 'on' allow slackpkg+ to install 32bit packages on a 64bit slackware -# installation (possibly unsafe). Please, do not install both 32 and 64bit of the same -# package to avoid problems, and NEVER upgrade exitant 64bit packages with relative 32bit package. -# Do not forget to install the multilibs. -#ALLOW32BIT=off - # Add custom option to 'wget'. # You can solve the repository indisponibility issue by set a timeout here WGETOPTS="--timeout=5 --tries=1" @@ -26,6 +19,8 @@ WGETOPTS="--timeout=5 --tries=1" # Enable (on) / Disable (off) notification events (see notifymsg.conf) #ENABLENOTIFY=off +# Enable (on) / Disable (off) the greylist feature. See /etc/slackpkg/greylist +GREYLIST=on # If two or more repositories contains some same packages, you can specify # from which repository you prefer to search it. diff --git a/src/slackpkgplus.x86_64.sample b/src/slackpkgplus.x86_64.sample index 5201900..543563a 100644 --- a/src/slackpkgplus.x86_64.sample +++ b/src/slackpkgplus.x86_64.sample @@ -7,6 +7,13 @@ SLACKPKGPLUS=on # set to '2' to show always show the download bar VERBOSE=1 +# By default slackpkg+ deny to install 32bit packages. +# Set this flag to 'on' allow slackpkg+ to install 32bit packages on a 64bit slackware +# installation (possibly unsafe). Please, do not install both 32 and 64bit of the same +# package to avoid problems, and NEVER upgrade exitant 64bit packages with relative 32bit package. +# Do not forget to install the multilibs. +ALLOW32BIT=off + # Enable (1) / Disable (0) the official slackpkg blacklist. May be useful to temporarily skip # the slackware blacklist. You can also override it from command line: # 'USEBL=0 slackpkg upgrade-all' @@ -19,6 +26,8 @@ WGETOPTS="--timeout=5 --tries=1" # Enable (on) / Disable (off) notification events (see notifymsg.conf) #ENABLENOTIFY=off +# Enable (on) / Disable (off) the greylist feature. See /etc/slackpkg/greylist +GREYLIST=on # If two or more repositories contains some same packages, you can specify # from which repository you prefer to search it. diff --git a/src/zdialogplus.sh b/src/zdialogplus.sh index 3be8d1b..d1a4bcb 100755 --- a/src/zdialogplus.sh +++ b/src/zdialogplus.sh @@ -19,22 +19,31 @@ if [ "$SLACKPKGPLUS" = "on" ];then if [ "$ONOFF" != "off" ]; then ONOFF=on fi + cat $TMPDIR/greylist.* >$TMPDIR/greylist + if [ "$GREYLIST" == "off" ];then + >$TMPDIR/greylist + fi + grep -Ew -f $TMPDIR/greylist $TMPDIR/pkglist|awk '{print $2}' >$TMPDIR/unchecklist rm -f $TMPDIR/dialog.tmp if [ "$2" = "upgrade" ]; then ls -1 /var/log/packages > $TMPDIR/tmplist for i in $1; do + TMPONOFF=$ONOFF BASENAME=$(cutpkg $i) PKGFOUND=$(grep -m1 -e "^${BASENAME}-[^-]\+-\(noarch\|fw\|${ARCH}\)" $TMPDIR/tmplist) REPOPOS=$(grep -m1 " $(echo $i|sed 's/\.t.z//') " $TMPDIR/pkglist|awk '{print $1}'|sed 's/SLACKPKGPLUS_//') - echo "$i \"$REPOPOS\" $ONOFF \"currently installed: $PKGFOUND\"" >>$TMPDIR/dialog.tmp + grep -q "^$(echo $i|rev|cut -f4- -d-|rev)$" $TMPDIR/unchecklist && TMPONOFF="off" + echo "$i \"$REPOPOS\" $TMPONOFF \"currently installed: $PKGFOUND\"" >>$TMPDIR/dialog.tmp done HINT="--item-help" else for i in $1; do + TMPONOFF=$ONOFF REPOPOS=$(grep -m1 " $(echo $i|sed 's/\.t.z//') " $TMPDIR/pkglist|awk '{print $1}'|sed 's/SLACKPKGPLUS_//') - echo "$i \"$REPOPOS\" $ONOFF" >>$TMPDIR/dialog.tmp + grep -q "^$(echo $i|rev|cut -f4- -d-|rev)$" $TMPDIR/unchecklist && TMPONOFF="off" + echo "$i \"$REPOPOS\" $TMPONOFF" >>$TMPDIR/dialog.tmp done HINT="" fi From 13e211cfc7538ab740fd94199d5c6bfd940ed143 Mon Sep 17 00:00:00 2001 From: Matteo Rossini Date: Mon, 9 Dec 2013 14:18:57 +0100 Subject: [PATCH 9/9] Version 1.2.0 - 9/Dec/2013 - Now ALLOW32BIT also auto-greylist the 32bit packages - Added an install log in /var/lib/slackpkg/install.log; use '/usr/libexec/slackpkg/makeinstlog.sh -t' to create a starting install.log (it TRY to detect the repository) --- ChangeLog.txt | 6 ++++ src/ChangeLog.txt | 6 ++++ src/README | 52 ++++++++++++++++++++++++++++++---- src/doinst.sh | 3 ++ src/makeinstlog.sh | 47 ++++++++++++++++++++++++++++++ src/slackpkg+.SlackBuild | 2 ++ src/slackpkgplus.sh | 41 +++++++++++++++++++++++---- src/slackpkgplus.x86_64.sample | 1 + 8 files changed, 148 insertions(+), 10 deletions(-) create mode 100755 src/makeinstlog.sh diff --git a/ChangeLog.txt b/ChangeLog.txt index 48b72e0..eecd1c9 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,9 @@ +Version 1.2.0 - 9/Dec/2013 + - Now ALLOW32BIT also auto-greylist the 32bit packages + - Added an install log in /var/lib/slackpkg/install.log; use + '/usr/libexec/slackpkg/makeinstlog.sh -t' to create a starting + install.log (it TRY to detect the repository) + Version 1.1.0 - 6/Dec/2013 - Added ALLOW32BIT flag to allow to install 32bit packages on a 64bit system - setupmultilib.sh install only adaptative multilib by default diff --git a/src/ChangeLog.txt b/src/ChangeLog.txt index 48b72e0..eecd1c9 100644 --- a/src/ChangeLog.txt +++ b/src/ChangeLog.txt @@ -1,3 +1,9 @@ +Version 1.2.0 - 9/Dec/2013 + - Now ALLOW32BIT also auto-greylist the 32bit packages + - Added an install log in /var/lib/slackpkg/install.log; use + '/usr/libexec/slackpkg/makeinstlog.sh -t' to create a starting + install.log (it TRY to detect the repository) + Version 1.1.0 - 6/Dec/2013 - Added ALLOW32BIT flag to allow to install 32bit packages on a 64bit system - setupmultilib.sh install only adaptative multilib by default diff --git a/src/README b/src/README index 87dab57..ef4ffeb 100644 --- a/src/README +++ b/src/README @@ -21,10 +21,17 @@ for any damage that may be caused to your computer. CONFIGURATION +For the basic configuration: + * Edit /etc/slackpkg/slackpkgplus.conf * Uncomment one or more mirrors and add them to the REPOPLUS list -* Optionally, set PKGS_PRIORITY to give priority order for packages present in - multiple repositories + +Note that packages in these repository will not listed if they are present in +the official repositories (see below). + +* Optionally, set PKGS_PRIORITY to give priority order for single packages + present in multiple repositories or to allow repositories to override + official slackware packages For a list of supported repositories see repositories.txt, but you can also add others yourself. @@ -131,10 +138,10 @@ PRIORITY CONFIGURATION When a package is present in more than one repository, the package will be searched for in the following order: -1) as listed in PKGS_PRIORITY +1) as listed in PKGS_PRIORITY (allow to override official packages) 2) as listed in an official Slackware repository (configured in /etc/slackpkg/mirrors) -3) as listed in REPOPLUS +3) as listed in REPOPLUS (deny to override official packages) 4) all others defined in MIRRORPLUS PKGS_PRIORITY syntax: @@ -154,7 +161,7 @@ MULTILIB If you want to use a multilib system, you can automatically configure the multilib repository in slackpkgplus.conf and install multilib simply by running: -# /usr/doc/slackpkg+-1.0/setupmultilib.sh +# /usr/doc/slackpkg+-1.2.0/setupmultilib.sh To configure multilib manually (e.g. if you have installed multilib already), uncomment the correct "MIRRORPLUS['multilib']=...", @@ -340,6 +347,41 @@ package. Do not forget to install the multilibs. +----- + +GREYLIST + +Sometime you may want that slackpkg+ does not install some package in the upgrade-all +process. To do that you must uncheck the package everytime or add it in the +'blacklist' file. The first method may be onerous when you use upgrade-all frequently. +The second method does not allow you to know which package version is available. +A thirdy method is to put it in the 'graylist' file. +All packages listed in graylist will be available to install and listed in slackpkg +dialog, but they will be unchecked by default so you are sure to not install it +wrongly. +You may decide also to greylist one entire repository. A good idea is to greylist +all thirdy party repository so an upgrade-all automatically upgrade official +slackware packages but force you to review all other packages so to be sure on what +you install. + +----- + +INSTALL LOG + +Slackpkg+ now create a log of all installed packages in /var/lib/slackpkg/install.log +and try to add in this log from which repository you have downloaded the file. +This help you to track your slackware installation. + +You are encouraged to run '/usr/lib/slackpkg/makeinstlog.sh -t' (this may take a few) +to initialize the log (it will create /var/lib/slackpkg/install.log.tmp). The '-t' +param add the repository name from which the packages was downloaded, but it may fails, +so you are encouraged to review the file before rename it in install.log. +Note that you can edit manually to modify or add informations. + +At every slackpkg install/upgrade/remove invocation, a new log will be added. +At every slackpkg update invocation, a fast list rebuild will be done. + + ----- FURTHER INFORMATION diff --git a/src/doinst.sh b/src/doinst.sh index 4ea7ade..57c9cd7 100644 --- a/src/doinst.sh +++ b/src/doinst.sh @@ -40,6 +40,9 @@ config etc/slackpkg/greylist.new config etc/slackpkg/notifymsg.conf.new remove var/lib/slackpkg/ChangeLog.txt remove var/lib/slackpkg/pkglist + +( . usr/libexec/slackpkg/makeinstlog.sh >/dev/null ) + echo echo echo "Please, read the README file before using slackpkg+" diff --git a/src/makeinstlog.sh b/src/makeinstlog.sh new file mode 100755 index 0000000..7e6f549 --- /dev/null +++ b/src/makeinstlog.sh @@ -0,0 +1,47 @@ +#!/bin/bash +WORKDIR=/var/lib/slackpkg +. /etc/slackpkg/slackpkg.conf + +( + + ( + cd /var/log/removed_packages + ( ls -l --full-time|tail +2|cut -c11-|sed -r -e 's/\.[0-9]{9}//' -e 's,-,/,' -e 's,-,/,'|awk '{print $8,$5,$6}' + grep -m1 'PACKAGE LOCATION:' *|sed -r 's/:PACKAGE LOCATION:.*(\.t.z)/ \1/' + )|sort|awk '{if(x=!x){printf("%s ", $2)}else{print $2,$3,$1}}' \ + |sed -e 's/$/ removed/' -e 's/-upgraded-.*/ upgraded/'|awk '{print $2,$3,$4,$1,$5}' + cd /var/log/packages + ( ls -l --full-time|tail +2|cut -c11-|sed -r -e 's/\.[0-9]{9}//' -e 's,-,/,' -e 's,-,/,'|awk '{print $8,$5,$6}' + grep -m1 'PACKAGE LOCATION:' *|sed -r 's/:PACKAGE LOCATION:.*(\.t.z)/ \1/' + )|sort|awk '{if(x=!x){printf("%s ", $2)}else{print $2,$3,$1}}' \ + |sed -e 's/$/ installed/'|awk '{print $2,$3,$4,$1,$5}' + )| sed -r -e 's/^([^ ]+) ([^ ]+) (.*)-([^-]+)-([^-]+)-([^ ]+) (\.t.z) (.*)/\1 \2 \3 \3-\4-\5-\6 \7 \8/'|sort|awk '{ + if (!p[$3]) { print $1" "$2" installed: "$4$5" []" ; p[$3]=$4 } + else if ($5=="removed") { print $1" "$2" removed: "$4 ; p[$3]=0 } + else if (p[$3]==$4) { print $1" "$2" reinstalled: "$4$5" []" } + else { print $1" "$2" upgraded: "$4$5" [] (was "p[$3]")"; p[$3]=$4 } + }' + + cat $WORKDIR/install.log 2>/dev/null|grep -v '\[\]' + +)|sort -r|awk '{if(!a[$1$2$3$4]++)print}'|tac >$WORKDIR/install.log.new + +if [ "$1" == "-t" ];then + if [ ! -e $WORKDIR/pkglist ];then + echo "pkglist does not exists; unable to try repository detect" + echo "An install log was created in $WORKDIR/install.log.new ; review it and rename in install.log" + else + cat $WORKDIR/install.log.new |while read a;do + P=$(echo $a|awk '{print $4}') + R=$(grep -m1 \ + "$(echo $P|awk -f /usr/libexec/slackpkg/pkglist.awk | awk '{print " "$1" .* "$3" "$4"$"}'| sed -r 's/ [0-9]+([^\$]*)\$/ [0-9]\\+\1 /')" \ + /var/lib/slackpkg/pkglist|awk '{print $1}'|sed 's/SLACKPKGPLUS_//' + ) + echo "$a"|sed "s/\[\]/[$R]/" + done > $WORKDIR/install.log.tmp + echo "An install log was created in $WORKDIR/install.log.tmp ; review it and rename in install.log" + fi +else + mv $WORKDIR/install.log.new $WORKDIR/install.log + echo "An install log was created in $WORKDIR/install.log" +fi diff --git a/src/slackpkg+.SlackBuild b/src/slackpkg+.SlackBuild index 282b36b..e26c7c5 100644 --- a/src/slackpkg+.SlackBuild +++ b/src/slackpkg+.SlackBuild @@ -22,6 +22,7 @@ mkdir -p install/ cp $CWD/slackpkgplus.sh usr/libexec/slackpkg/functions.d/ cp $CWD/zdialogplus.sh usr/libexec/slackpkg/functions.d/ +cp $CWD/makeinstlog.sh usr/libexec/slackpkg/makeinstlog.sh cp $CWD/README usr/doc/slackpkg+-$VERSION/ cp $CWD/ChangeLog.txt usr/doc/slackpkg+-$VERSION/ cp $CWD/repositories.txt usr/doc/slackpkg+-$VERSION/ @@ -35,6 +36,7 @@ cat $CWD/notifymsg.conf > etc/slackpkg/notifymsg.conf.new chmod +x usr/libexec/slackpkg/functions.d/slackpkgplus.sh chmod +x usr/libexec/slackpkg/functions.d/zdialogplus.sh +chmod +x usr/libexec/slackpkg/makeinstlog.sh chmod +x usr/doc/slackpkg+-$VERSION/setupmultilib.sh diff --git a/src/slackpkgplus.sh b/src/slackpkgplus.sh index 5efd52e..02941fd 100755 --- a/src/slackpkgplus.sh +++ b/src/slackpkgplus.sh @@ -6,7 +6,8 @@ declare -A MIRRORPLUS declare -A NOTIFYMSG if [ -e /etc/slackpkg/slackpkgplus.conf ];then - # You can override WGETOPTS SLACKPKGPLUS VERBOSE USEBL ALLOW32BIT from command-line + # You can override GREYLIST WGETOPTS SLACKPKGPLUS VERBOSE USEBL ALLOW32BIT from command-line + EXTGREYLIST=$GREYLIST EXTALLOW32BIT=$ALLOW32BIT EXTSLACKPKGPLUS=$SLACKPKGPLUS EXTVERBOSE=$VERBOSE @@ -15,6 +16,7 @@ if [ -e /etc/slackpkg/slackpkgplus.conf ];then . /etc/slackpkg/slackpkgplus.conf + GREYLIST=${EXTGREYLIST:-$GREYLIST} ALLOW32BIT=${EXTALLOW32BIT:-$ALLOW32BIT} SLACKPKGPLUS=${EXTSLACKPKGPLUS:-$SLACKPKGPLUS} VERBOSE=${EXTVERBOSE:-$VERBOSE} @@ -32,7 +34,7 @@ fi if [ "$SLACKPKGPLUS" = "on" ];then - SPKGPLUS_VERSION="1.1.0" + SPKGPLUS_VERSION="1.2.0" VERSION="$VERSION / slackpkg+ $SPKGPLUS_VERSION" @@ -40,6 +42,13 @@ if [ "$SLACKPKGPLUS" = "on" ];then mkdir -p "$WORKDIR" fi + if [ "$CMD" == "update" ];then + if [ "$VERBOSE" == "2" ];then + echo "Updating $WORKDIR/install.log" + fi + /usr/libexec/slackpkg/makeinstlog.sh >/dev/null + fi + # Override the slackpkg getfile(). # The new getfile() download all file needed from all defined repositories # then merge all in a format slackpkg-compatible @@ -647,11 +656,15 @@ if [ "$SLACKPKGPLUS" = "on" ];then echo -e "\nPackage: $i" echo -e "\tRemoving... " removepkg $i + if [ ! -e /var/log/packages/$i ];then + FDATE=$(ls -ltr --full-time /var/log/removed_packages/$i|tail -1 |awk '{print $6" "$7}'|sed -r -e 's/\.[0-9]{9}//' -e 's,-,/,' -e 's,-,/,') + echo "$FDATE removed: $i" >> $WORKDIR/install.log + fi done handle_event "remove" } - # Overrides original remove_pkg(). Required by the notification mechanism. + # Overrides original upgrade_pkg(). Required by the notification mechanism. function upgrade_pkg() { local i @@ -663,13 +676,22 @@ if [ "$SLACKPKGPLUS" = "on" ];then done DELALL="$OLDDEL" fi + ls -1 /var/log/packages > $TMPDIR/tmplist + for i in $SHOWLIST; do + PKGFOUND=$(grep -m1 -e "^$(echo $i|rev|cut -f4- -d-|rev)-[^-]\+-[^-]\+-[^-]\+$" $TMPDIR/tmplist) + REPOPOS=$(grep -m1 " $(echo $i|sed 's/\.t.z//') " $TMPDIR/pkglist|awk '{print $1}'|sed 's/SLACKPKGPLUS_//') getpkg $i upgradepkg Upgrading + if [ -e "/var/log/packages/$(echo $i|sed 's/\.t.z//')" ];then + FDATE=$(ls -l --full-time /var/log/packages/$(echo $i|sed 's/\.t.z//') |awk '{print $6" "$7}'|sed -r -e 's/\.[0-9]{9}//' -e 's,-,/,' -e 's,-,/,') + echo "$FDATE upgraded: $i [$REPOPOS] (was $PKGFOUND)" >> $WORKDIR/install.log + fi + done handle_event "upgrade" } - # Overrides original remove_pkg(). Required by the notification mechanism. + # Overrides original install_pkg(). Required by the notification mechanism. function install_pkg() { local i @@ -682,7 +704,16 @@ if [ "$SLACKPKGPLUS" = "on" ];then DELALL="$OLDDEL" fi for i in $SHOWLIST; do + INSTALL_T='installed: ' + if [ -e /var/log/packages/$(echo $i|sed 's/\.t.z//') ];then + INSTALL_T='reinstalled:' + fi + REPOPOS=$(grep -m1 " $(echo $i|sed 's/\.t.z//') " $TMPDIR/pkglist|awk '{print $1}'|sed 's/SLACKPKGPLUS_//') getpkg $i installpkg Installing + if [ -e "/var/log/packages/$(echo $i|sed 's/\.t.z//')" ];then + FDATE=$(ls -l --full-time /var/log/packages/$(echo $i|sed 's/\.t.z//') |awk '{print $6" "$7}'|sed -r -e 's/\.[0-9]{9}//' -e 's,-,/,' -e 's,-,/,') + echo "$FDATE $INSTALL_T $i [$REPOPOS]" >> $WORKDIR/install.log + fi done handle_event "install" } @@ -718,6 +749,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then if [[ "$CMD" == "upgrade" || "$CMD" == "upgrade-all" ]] && [ "$ALLOW32BIT" == "on" ] ; then ARCH="\($ARCH\)\|\([i]*[3456x]86[^_]*\)" + echo -e "i[3456]86\nx86" > $TMPDIR/greylist.32bit fi if [ "$CMD" == "install" ] || [ "$CMD" == "upgrade" ] || [ "$CMD" == "reinstall" ] || [ "$CMD" == "remove" ] ; then @@ -897,6 +929,5 @@ if [ "$SLACKPKGPLUS" = "on" ];then cleanup fi - cat $TMPDIR/greylist*|sort -u >$TMPDIR/unchecklist fi diff --git a/src/slackpkgplus.x86_64.sample b/src/slackpkgplus.x86_64.sample index 543563a..1bd2535 100644 --- a/src/slackpkgplus.x86_64.sample +++ b/src/slackpkgplus.x86_64.sample @@ -41,6 +41,7 @@ GREYLIST=on # If you want a multilib system, uncomment the multilib repository and set: #PKGS_PRIORITY=( multilib:.* ) # +# (Use /usr/doc/slackpkg+-*/setupmultilib.sh to setup a multilib configuration) # List repositories you want to use (defined below) # remember to launch 'slackpkg update' if you modify that row.