From 4cd45ee7d21b94497ef12b64a0e7d5a5f46f9309 Mon Sep 17 00:00:00 2001 From: Matteo Rossini Date: Fri, 6 Dec 2013 10:32:20 +0100 Subject: [PATCH] - 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"