Just wanted to share a small script I wrote to install and update alien bob's multilib packages, I know there are other tools already but they were a bit overwhelming for me so I wrote my own.
It simply makes some sanity checks and then rsyncs /var/cache/multilib/ with alien bob's slackware 14 multilib packages(or whatever folder/slackware version you set up in the script) and upgradepkg --install-new the packages.
Anyway I hope it's of help to someone :-)
Code:
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
LOCALDIR="/var/cache/multilib/"
REMOTEDIR="rsync://taper.alienbase.nl/mirrors/people/alien/multilib/14.0/"
BLACKLISTFILE="/etc/slackpkg/blacklist"
LOG="/tmp/multilib-rsync.log"
if [ ! -d "$LOCALDIR" ]; then
echo The local directory does not exists!;
while true; do
read -p "Do you want me to create the folder $LOCALDIR?" yn
case $yn in
[Yy]* ) mkdir $LOCALDIR; break;;
[Nn]* ) echo "Aborting! Please fix your local dir"; exit 1;;
* ) echo "Please answer Y/y or N/n";;
esac
done
fi
grep -q "\[0\-9\]+alien" $BLACKLISTFILE ##comment out from here to ...
if [ $? -eq 1 ]
then
echo "Warning no [0-9]+alien found in $BLACKLISTFILE ! Updating with slackpkg might break your system!"
while true; do
read -p "Do you want me to add it?" yn
case $yn in
[Yy]* ) echo "[0-9]+alien" >> $BLACKLISTFILE; echo "[0-9]+alien added to $BLACKLISTFILE"; echo -e "\n"; break;;
[Nn]* ) break;;
* ) echo "Please answer Y/y or N/n";;
esac
done
fi
grep -q "\[0\-9\]+compat32" $BLACKLISTFILE
if [ $? -eq 1 ]
then
echo -e "\n"
echo "Warning no [0-9]+compact32 found in $BLACKLISTFILE ! Updating with slackpkg might break your system!"
while true; do
read -p "Do you want me to add it?" yn
case $yn in
[Yy]* ) echo "[0-9]+compat32" >> $BLACKLISTFILE; echo "[0-9]+compat32 added to $BLACKLISTFILE"; echo -e "\n"; break;;
[Nn]* ) break;;
* ) echo "Please answer Y/y or N/n";;
esac
done
fi ##here to stop the script from checking the blacklist file
echo "Downloading packages... Please wait"
rsync -azv --progress --delete --exclude "/debug/*" $REMOTEDIR $LOCALDIR | tee $LOG
output=$(grep .txz$ $LOG)
if [ $? -eq 0 ]
then
echo $output | tr ' ' '\n'
while true; do
read -p "There have been changes, do you want to update these packages?" yn
case $yn in
[Yy]* ) for i in $output; do upgradepkg --install-new $LOCALDIR$i || echo "Error while upgrading!" && exit 1 ; done; echo "All packages updated!"; break;;
[Nn]* ) echo "Aborting!"; exit 1;;
* ) echo "Please answer Y/y or N/n";;
esac
done
else
echo "No updates found!"
fi