mirror of
https://github.com/zuno/slackpkgplus
synced 2024-12-27 09:58:34 +01:00
Version 1.3.2 - 13/Jul/2014
- Patched to reflect changes on slackpkg 2.82.0-13
This commit is contained in:
parent
b60e8adf1f
commit
682c49aea7
7 changed files with 58 additions and 43 deletions
|
@ -1,3 +1,6 @@
|
|||
Version 1.3.2 - 13/Jul/2014
|
||||
- Patched to reflect changes on slackpkg 2.82.0-13
|
||||
|
||||
Version 1.3.1 - 7/Mar/2014
|
||||
- Improved check-updates function (thanks to phenixia2003)
|
||||
- Improved debug-mode
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
Version 1.3.2 - 13/Jul/2014
|
||||
- Patched to reflect changes on slackpkg 2.82.0-13
|
||||
|
||||
Version 1.3.1 - 7/Mar/2014
|
||||
- Improved check-updates function (thanks to phenixia2003)
|
||||
- Improved debug-mode
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/bash
|
||||
WORKDIR=/var/lib/slackpkg
|
||||
. /etc/slackpkg/slackpkg.conf
|
||||
|
||||
CONF=${CONF:-/etc/slackpkg} # needed if you're running slackpkg 2.28.0-12
|
||||
|
||||
. $CONF/slackpkg.conf
|
||||
|
||||
if [ -e $WORKDIR/pkglist ];then
|
||||
cp $WORKDIR/pkglist $WORKDIR/pkglist.tmp
|
||||
|
@ -8,12 +10,12 @@ fi
|
|||
(
|
||||
|
||||
(
|
||||
cd /var/log/removed_packages
|
||||
cd $ROOT/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:' * 2>/dev/null|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
|
||||
cd $ROOT/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:' * 2>/dev/null|sed -r 's/:PACKAGE LOCATION:.*(\.t.z)/ \1/'
|
||||
)|sort|awk '{if(x=!x){printf("%s ", $2)}else{print $2,$3,$1}}' \
|
||||
|
|
|
@ -9,10 +9,11 @@ Supported Repositories:
|
|||
> slacky: http://repository.slacky.eu/slackware{,64}-{13.37,14.0,14.1}/
|
||||
> mled: http://www.microlinux.fr/slackware/MLED-{14.0,14.1}-{32,64}bit/
|
||||
> mles: http://www.microlinux.fr/slackware/MLES-{14.0,14.1}-{32,64}bit/
|
||||
> msb: http://slackware.org.uk/msb/{14.0,14.1}/1.6/{x86,x86_64}/
|
||||
> msb: http://slackware.org.uk/msb/{14.0,14.1}/{1.6,1.8}/{x86,x86_64}/
|
||||
> slackers: http://www.slackers.it/repository/
|
||||
> slacke17: http://ngc891.blogdns.net/pub/slacke17/slackware{,64,arm}-{14.0,14.1}/
|
||||
> studioware: http://studioware.org/files/packages/slackware{,64}-{13.37,14.0,14.1}/
|
||||
> slackonly: http://slackonly.com/pub/packages/14.1-x86_64/
|
||||
>
|
||||
> Does NOT support GPG
|
||||
> salixos(*): http://download.salixos.org/{i486,x86_64}/{13.37,14.0,14.1}/
|
||||
|
|
|
@ -1,17 +1,21 @@
|
|||
#!/bin/bash
|
||||
|
||||
CONF=${CONF:-/etc/slackpkg} # needed if you're running slackpkg 2.28.0-12
|
||||
|
||||
. $CONF/slackpkg.conf
|
||||
|
||||
cd $(dirname $(readlink -f $0))
|
||||
if [ ! -e repositories.txt ];then
|
||||
echo "Fatal. repositories.txt not found!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ISX64=$(ls /var/log/packages/aaa_base-*-x86_64-*|wc -l)
|
||||
ISX64=$(ls $ROOT/var/log/packages/aaa_base-*-x86_64-*|wc -l)
|
||||
if [ $ISX64 -ne 1 ];then
|
||||
echo "Slackware multilib's are supported only from slackware x86_64!"
|
||||
exit 1
|
||||
fi
|
||||
SVER=$(grep -v ^\# /etc/slackpkg/mirrors|sed -r 's,^.*/slackware64-(current|14.1|14.0|13.37|13.0)/,\1,'|head -1)
|
||||
SVER=$(grep -v ^\# $CONF/mirrors|sed -r 's,^.*/slackware64-(current|14.1|14.0|13.37|13.0)/,\1,'|head -1)
|
||||
if [ -z "$SVER" ];then
|
||||
echo "I can't detect your Slackware version."
|
||||
echo "Which Slackware version are you running? (current/14.1/14.0/13.37/13.0)"
|
||||
|
@ -22,17 +26,17 @@ if ! echo $SVER|egrep -q '^(current|14.1|14.0|13.37|13.0)$';then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if grep -q -e '^PKGS_PRIORITY=.* multilib:\.\* .*$' -e '^MIRRORPLUS..multilib..=.*multilib.*' /etc/slackpkg/slackpkgplus.conf;then
|
||||
if grep -q -e '^PKGS_PRIORITY=.* multilib:\.\* .*$' -e '^MIRRORPLUS..multilib..=.*multilib.*' $CONF/slackpkgplus.conf;then
|
||||
echo "slackpkg+ seems to be already configured for multilib support. Would you like to remove multilib support from the configuration? (y/N)"
|
||||
read ANS
|
||||
if [ "$ANS" == "y" -o "$ANS" == "Y" ];then
|
||||
cp /etc/slackpkg/slackpkgplus.conf /etc/slackpkg/slackpkgplus.conf.backup
|
||||
cp $CONF/slackpkgplus.conf $CONF/slackpkgplus.conf.backup
|
||||
sed -i -r \
|
||||
-e 's/^PKGS_PRIORITY=(.*) multilib:\.\* (.*)$/PKGS_PRIORITY=\1 \2/' \
|
||||
-e 's/^(PKGS_PRIORITY=\( +\).*)$/#\1/' \
|
||||
-e 's/^(MIRRORPLUS..multilib..=.*multilib.*)$/#\1/' \
|
||||
-e 's/^REPOPLUS=(.*) multilib (.*)/REPOPLUS=\1 \2/' \
|
||||
-e 's/^(REPOPLUS=\( +\).*)$/#\1/' /etc/slackpkg/slackpkgplus.conf
|
||||
-e 's/^(REPOPLUS=\( +\).*)$/#\1/' $CONF/slackpkgplus.conf
|
||||
echo "Multilib support has been removed from slackpkg+. Now you need to remove the installed packages (using slackpkg)."
|
||||
echo "Would you like this script to run slackpkg for you and remove the Multilib packages? (y/N)"
|
||||
read ANS
|
||||
|
@ -59,14 +63,14 @@ echo "Would you like to setup slackpkg+ to add multilib support? (y/N)"
|
|||
read ANS
|
||||
if [ "$ANS" == "y" -o "$ANS" == "Y" ];then
|
||||
MULTILIBREPO="MIRRORPLUS['multilib']="$(grep -m1 '> multilib: ' repositories.txt|awk '{print $3}'|sed "s/{.*}/$SVER/")
|
||||
cp /etc/slackpkg/slackpkgplus.conf /etc/slackpkg/slackpkgplus.conf.backup
|
||||
if grep -q ^PKGS_PRIORITY= /etc/slackpkg/slackpkgplus.conf;then
|
||||
sed -i -r -e 's/^PKGS_PRIORITY=\( (.*) \)/PKGS_PRIORITY=( multilib:.* \1 )/' /etc/slackpkg/slackpkgplus.conf
|
||||
cp $CONF/slackpkgplus.conf $CONF/slackpkgplus.conf.backup
|
||||
if grep -q ^PKGS_PRIORITY= $CONF/slackpkgplus.conf;then
|
||||
sed -i -r -e 's/^PKGS_PRIORITY=\( (.*) \)/PKGS_PRIORITY=( multilib:.* \1 )/' $CONF/slackpkgplus.conf
|
||||
else
|
||||
sed -i -r -e 's/^(REPOPLUS=.*)$/PKGS_PRIORITY=( multilib:.* )\n\1/' /etc/slackpkg/slackpkgplus.conf
|
||||
sed -i -r -e 's/^(REPOPLUS=.*)$/PKGS_PRIORITY=( multilib:.* )\n\1/' $CONF/slackpkgplus.conf
|
||||
fi
|
||||
sed -i -r -e 's|^(REPOPLUS=.*)$|\1\n'"$MULTILIBREPO|" /etc/slackpkg/slackpkgplus.conf
|
||||
sed -i.backup -r -e 's/^(\[0-9\]\+compat32)$/\#\1/' /etc/slackpkg/blacklist
|
||||
sed -i -r -e 's|^(REPOPLUS=.*)$|\1\n'"$MULTILIBREPO|" $CONF/slackpkgplus.conf
|
||||
sed -i.backup -r -e 's/^(\[0-9\]\+compat32)$/\#\1/' $CONF/blacklist
|
||||
echo "slackpkg+ is now configured for multilib support."
|
||||
echo "Do you want to install the multilib now? (y/N)"
|
||||
read ANS
|
||||
|
@ -75,10 +79,10 @@ if [ "$ANS" == "y" -o "$ANS" == "Y" ];then
|
|||
slackpkg update
|
||||
slackpkg upgrade multilib
|
||||
COMPATPKGS=$(
|
||||
cd /var/log/packages
|
||||
cd $ROOT/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}'
|
||||
grep -f /tmp/installed_packages1 $WORKDIR/pkglist|awk '{print "SLACKPKGPLUS_multilib "$2"-compat32 "}' > /tmp/installed_packages2
|
||||
grep -f /tmp/installed_packages2 $WORKDIR/pkglist|awk '{print "multilib:"$2}'
|
||||
)
|
||||
slackpkg install $COMPATPKGS
|
||||
echo "Multilib installed"
|
||||
|
|
|
@ -4,7 +4,9 @@
|
|||
declare -A MIRRORPLUS
|
||||
declare -A NOTIFYMSG
|
||||
|
||||
if [ -e /etc/slackpkg/slackpkgplus.conf ];then
|
||||
CONF=${CONF:-/etc/slackpkg} # needed if you're running slackpkg 2.28.0-12
|
||||
|
||||
if [ -e $CONF/slackpkgplus.conf ];then
|
||||
# You can override GREYLIST WGETOPTS SLACKPKGPLUS VERBOSE USEBL ALLOW32BIT from command-line
|
||||
EXTGREYLIST=$GREYLIST
|
||||
EXTALLOW32BIT=$ALLOW32BIT
|
||||
|
@ -13,7 +15,7 @@ if [ -e /etc/slackpkg/slackpkgplus.conf ];then
|
|||
EXTUSEBL=$USEBL
|
||||
EXTWGETOPTS=$WGETOPTS
|
||||
|
||||
. /etc/slackpkg/slackpkgplus.conf
|
||||
. $CONF/slackpkgplus.conf
|
||||
|
||||
GREYLIST=${EXTGREYLIST:-$GREYLIST}
|
||||
ALLOW32BIT=${EXTALLOW32BIT:-$ALLOW32BIT}
|
||||
|
@ -26,8 +28,8 @@ 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
|
||||
if [ "$ENABLENOTIFY" = "on" -a -e $CONF/notifymsg.conf ];then
|
||||
. $CONF/notifymsg.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -39,7 +41,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
|||
|
||||
|
||||
|
||||
SPKGPLUS_VERSION="1.3.1"
|
||||
SPKGPLUS_VERSION="1.3.2"
|
||||
VERSION="$VERSION / slackpkg+ $SPKGPLUS_VERSION"
|
||||
|
||||
|
||||
|
@ -283,7 +285,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
|||
echo 1
|
||||
fi
|
||||
if [ "$(basename $1)" == "CHECKSUMS.md5" ];then
|
||||
X86_64=$(ls /var/log/packages/aaa_base*x86_64* 2>/dev/null|head -1)
|
||||
X86_64=$(ls $ROOT/var/log/packages/aaa_base*x86_64* 2>/dev/null|head -1)
|
||||
for PREPO in $REPOPLUS;do
|
||||
if [ ! -z "$X86_64" ];then
|
||||
if [ "$ALLOW32BIT" == "on" ];then
|
||||
|
@ -397,9 +399,9 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
|||
|
||||
grep -vE "(^#|^[[:blank:]]*$)" ${CONF}/blacklist > ${TMPDIR}/blacklist
|
||||
if echo $CMD | grep -q install ; then
|
||||
ls -1 /var/log/packages/* | awk -f /usr/libexec/slackpkg/pkglist.awk > ${TMPDIR}/tmplist
|
||||
ls -1 $ROOT/var/log/packages/* | awk -f /usr/libexec/slackpkg/pkglist.awk > ${TMPDIR}/tmplist
|
||||
else
|
||||
ls -1 /var/log/packages/* | awk -f /usr/libexec/slackpkg/pkglist.awk | applyblacklist > ${TMPDIR}/tmplist
|
||||
ls -1 $ROOT/var/log/packages/* | awk -f /usr/libexec/slackpkg/pkglist.awk | applyblacklist > ${TMPDIR}/tmplist
|
||||
fi
|
||||
cat ${WORKDIR}/pkglist | applyblacklist > ${TMPDIR}/pkglist
|
||||
|
||||
|
@ -503,8 +505,8 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
|||
# First is the package already installed?
|
||||
# Amazing what a little sleep will do
|
||||
# exclusion is so much nicer :)
|
||||
INSTPKG=$(ls -1 /var/log/packages | grep -e "^${BASENAME}-[^-]\+-[^-]\+-[^-]\+")
|
||||
#INSTPKG=$(ls -1 /var/log/packages | grep -e "^${BASENAME}-[^-]\+-\(${ARCH}\|fw\|noarch\)-[^-]\+")
|
||||
INSTPKG=$(ls -1 $ROOT/var/log/packages | grep -e "^${BASENAME}-[^-]\+-[^-]\+-[^-]\+")
|
||||
#INSTPKG=$(ls -1 $ROOT/var/log/packages | grep -e "^${BASENAME}-[^-]\+-\(${ARCH}\|fw\|noarch\)-[^-]\+")
|
||||
|
||||
# INSTPKG is local version
|
||||
if [ ! "${INSTPKG}" = "" ]; then
|
||||
|
@ -534,8 +536,8 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
|||
}
|
||||
|
||||
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
|
||||
if [ -e $CONF/greylist ];then
|
||||
cat $CONF/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
|
||||
|
||||
|
@ -554,7 +556,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
|||
fi
|
||||
done
|
||||
|
||||
if [ /etc/slackpkg/slackpkgplus.conf -nt $WORKDIR/pkglist -a "$CMD" != "update" ];then
|
||||
if [ $CONF/slackpkgplus.conf -nt $WORKDIR/pkglist -a "$CMD" != "update" ];then
|
||||
echo
|
||||
echo "NOTICE: remember to re-run 'slackpkg update' after modifing slackpkgplus.conf"
|
||||
echo
|
||||
|
@ -644,7 +646,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
|||
local MSGLIST=""
|
||||
local USERKEY
|
||||
|
||||
find /var/log/packages/ -type f -printf "%f\n" | sort > ${TMPDIR}/installed.tmp
|
||||
find $ROOT/var/log/packages/ -type f -printf "%f\n" | sort > ${TMPDIR}/installed.tmp
|
||||
|
||||
# -- Get the basename of packages which have been effectively
|
||||
# installed, upgraded, or removed
|
||||
|
@ -697,8 +699,8 @@ 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,-,/,')
|
||||
if [ ! -e $ROOT/var/log/packages/$i ];then
|
||||
FDATE=$(ls -ltr --full-time $ROOT/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
|
||||
|
@ -717,14 +719,14 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
|||
done
|
||||
DELALL="$OLDDEL"
|
||||
fi
|
||||
ls -1 /var/log/packages > $TMPDIR/tmplist
|
||||
ls -1 $ROOT/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,-,/,')
|
||||
if [ -e "$ROOT/var/log/packages/$(echo $i|sed 's/\.t.z//')" ];then
|
||||
FDATE=$(ls -l --full-time $ROOT/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
|
||||
|
||||
|
@ -746,13 +748,13 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
|||
fi
|
||||
for i in $SHOWLIST; do
|
||||
INSTALL_T='installed: '
|
||||
if [ -e /var/log/packages/$(echo $i|sed 's/\.t.z//') ];then
|
||||
if [ -e $ROOT/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,-,/,')
|
||||
if [ -e "$ROOT/var/log/packages/$(echo $i|sed 's/\.t.z//')" ];then
|
||||
FDATE=$(ls -l --full-time $ROOT/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
|
||||
|
|
|
@ -27,7 +27,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
|||
rm -f $TMPDIR/dialog.tmp
|
||||
|
||||
if [ "$2" = "upgrade" ]; then
|
||||
ls -1 /var/log/packages > $TMPDIR/tmplist
|
||||
ls -1 $ROOT/var/log/packages > $TMPDIR/tmplist
|
||||
for i in $1; do
|
||||
TMPONOFF=$ONOFF
|
||||
BASENAME=$(cutpkg $i)
|
||||
|
@ -74,7 +74,7 @@ if [ "$SLACKPKGPLUS" = "on" ];then
|
|||
cat $TMPDIR/dialog.out >> $TMPDIR/error.log
|
||||
echo -e "-------------
|
||||
If you want to continue using slackpkg, disable the DIALOG option in
|
||||
/etc/slackpkg/slackpkg.conf and try again.
|
||||
$CONF/slackpkg.conf and try again.
|
||||
|
||||
Help us to make slackpkg a better tool - report bugs to the slackpkg
|
||||
developers" >> $TMPDIR/error.log
|
||||
|
|
Loading…
Reference in a new issue