How do you guys maintain packages from Robby, Eric, and others?
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.
How do you guys maintain packages from Robby, Eric, and others?
I recently started to get my large packages (like openoffice, texlive, and the VLC SlackBuild) from Robby and Eric's webpages. Is there an easy way to keep these packages up to date? The only way I know of is manually checking their websites periodically to see if there has been a change in the package version, but I would much rather be notified in some way when there is an update available.
Does anyone have a script or similar system to do this? I ask here because I want to know if other Slackers have already figured out a better method than what I would be able to think of.
If it ain't on Slackbuilds.org I pretty much ignore it, if possible. SBo has gotten a good selection so meets 95% of my needs - and I only bother with about 5% of what there!. Although I run VLC in my Win boxes, I stick with mplayer + gnome-mplayer + gecko-mediaplayer on Slackware since the dependency headaches are less. Openoffice is also on SBo for both x68 and x86_64. It is easy enough to adjust the scripts for your own preferences (configure options etc).
Even if SBo runs a version (or minor version) behind, their scripts usually don't take too much tweaking to allow compile/packaging of the newer version.
IIRC, there is a script that assists in tracking the SBo content and updates, but at the moment the name eludes me.
sbopkg can be used to track and upgrade the packages and you built/installed from SBo using sbopkg if I'm not mistaken. With Robby and Eric's packages I dunno. I've been following Eric's KDE packages, but I do that manually.
This thread caught my attention in the LQ community bulletin
I have a very ugly script that checks installed packages (/var/log/packages), filters the non-standard ones and then checks for updates for some "known" (that's known *by me*) packagers.
I check for SBo (built from SlackBuilds on SBo w/o modifications), rlw (OpenOffice and some Xfce plugins), alien (vlc basically) and nhh (my own).
For each extension there is a little subscript to check for updates, basically reading the ChangeLogs I download daily.
It is really too ugly (and a few days ago even gave an error on a special package name) to make it public. But the idea of reading rss feeds may give me some inspiration to improve it
Thanks for all the useful posts! I have subscribed to Robby and Eric's RSS feeds. Also, I found this little gem of a script on Eric's site that allows one to locally mirror his repository. It's under http://connie.slackware.com/~alien/tools/ and is called mirror-alien-repository.sh. I wonder if a few modifications would allow me to mirror Robby's packages as well. I wouldn't mind having all of them in /home/ftp/alien and /home/ftp/rlw (now I finally found a use for /home/ftp!), since a few lost gigs of disk space is no harm to me.
The script goes like this:
Code:
#!/bin/sh
# $Id: mirror-alien-repository.sh,v 1.1 2008/03/15 15:15:05 root Exp root $
# Written 2008 Eric Hameleers <alien@slackware.com>, Eindhoven, Netherlands
#
# Mirror the http://www.slackware.com/~alien/slackbuilds repository.
# Since the repository allows only http transfers, use lftp instead of rsync.
# Don't use 'wget' because that does not delete remote files when they
# disappear on the remote server.
#
# The script works by downloading a copy of the remote ChangeLog.txt and then
# comparing it to your local version of this file. If no differences
# are found, the script will stop right there.
# If differences are found, the script will show the 'diff' output and then
# continue to mirror the remote repository. By using lftp, this process will
# be relatively efficient.
# When you want to run this script in a cron job, be sure to filter out STDERR
# so that you will only see emails from cron when there is actually a change.
# Example cron entry if you put the script in /usr/local/bin :
# 30 6 * * * /usr/local/bin/mirror-alien-repository.sh 2>/dev/null
#
# ---------------------------------------------------------------------------
# Do we want more messages? A '1' means 'yes', a '0' means 'no'.
DEBUG=${DEBUG:-0}
# We prevent the mirror script from running more than one instance:
PIDFILE=/var/tmp/$(basename $0 .sh).pid
# Make sure the PID file is removed when we kill the process
trap 'rm -f $PIDFILE; exit 1' TERM INT
if [ -e $PIDFILE ]; then
echo "Another instance (`cat $PIDFILE`) still running?"
echo "If you are sure that no other instance is running, delete the lockfile"
echo "'${PIDFILE}' and re-start this script."
echo "Aborting now..."
exit 1
else
echo $$ > $PIDFILE
fi
# Our local mirror:
LOCALTREE=${LOCALTREE:-"/tmp/alien_repository"}
# The URL for the remote repository:
REMOTEURL=${REMOTEURL:-"http://www.slackware.com/~alien/slackbuilds"}
# Where we store temporary files if needed:
TMP=${TMP:-"/tmp"}
# Tools:
LFTP=${LFTP:-"/usr/bin/lftp"}
# Sanity checks:
if [ ! -d $TMP ]; then
echo "Temp directory '$TMP' does not exist yet, creating directory now..."
mkdir -p $TMP
fi
if [ ! -w $TMP ]; then
echo "Temp directory '$TMP' is not writable! Quitting now..."
rm -f $PIDFILE
exit 1
fi
if [ ! -d $LOCALTREE ]; then
echo "Local tree '$LOCALTREE' does not exist yet, creating directory now..."
mkdir -p $LOCALTREE
fi
if [ ! -w $LOCALTREE ]; then
echo "Local tree '$LOCALTREE' is not writable! Aborting..."
rm -f $PIDFILE
exit 1
fi
# Check for an updated ChangeLog.txt:
[ $DEBUG -eq 1 ] && echo "$(date) [$$]: Getting ChangeLog.txt..."
rm -f $TMP/alien_ChangeLog.txt
cd $TMP
# Direct all output to stderr so that you can filter it out in a cron job:
$LFTP -e "get ChangeLog.txt -o alien_ChangeLog.txt && quit" $REMOTEURL 1>&2
cd -
if [ ! -s $TMP/alien_ChangeLog.txt ]; then
echo "$(date) [$$]: Could not retrieve ChangeLog.txt! Aborting..."
rm -f $PIDFILE
exit 1
fi
# If the ChangeLog.txt on our local mirror doesn't exist, it might mean that
# this is a first-time mirror. To prevent the script from aborting, we
# create an empty ChangeLog.txt file...
if [ ! -e ${LOCALTREE}/ChangeLog.txt ]; then
touch ${LOCALTREE}/ChangeLog.txt
fi
diff -b ${LOCALTREE}/ChangeLog.txt $TMP/alien_ChangeLog.txt
STATUS="$?"
if [ "$STATUS" == "2" ]; then
echo "$(date) [$$]: Trouble when running diff, aborting..."
rm -f $PIDFILE
exit 1
elif [ "$STATUS" == 0 ]; then
[ $DEBUG == 1 ] && echo "$(date) [$$]: No difference found, quitting now..."
rm -f $PIDFILE
exit 0
else
echo "$(date) [$$]: ChangeLog.txt has been updated."
fi
# Starting the mirror:
echo "$(date) [$$]: Starting the mirroring process."
# Direct all output to stderr so that you can filter it out in a cron job:
lftp -c "open $REMOTEURL ; mirror --verbose=0 --delete --continue . $LOCALTREE/" 1>&2
echo "$(date) [$$]: Finished the mirroring process."
rm -f $PIDFILE
Would I just have to modify the $REMOTEURL, the name of the ChangeLog, the $LOCALTREE, and maybe add "x86_64" after "mirror" in the lftp command to only get the appropriate packages? Or is there something else I need to worry about? I ask you because I'm a newbie to shell scripting, and I don't want to mess something up or be left clueless if trouble arises. I can't just try it now because I don't have access to my Slackware box right now
Better yet, instead of having two separate scripts to run, I could have a single script that updates both mirrors. Or maybe I could have these two scripts with different PID files and have another, simple script that calls those two. Oh, the possibilities with Slackware...
I don't really understand what's going on in the line that defines PIDFILE. What is $(basename $0 .sh).pid, and will I need to change that if I modify a copy of the script for Robby's repo.
I could just have the simple script that calls the other two one at a time. Yes, that should work. Again, is there anything else I need to change in Eric's script to work with Robby's repo?
I don't really understand what's going on in the line that defines PIDFILE. What is $(basename $0 .sh).pid, and will I need to change that if I modify a copy of the script for Robby's repo.
I don't have time right now to read the whole script but to answer that specific question, it's using basename to strip the path and the '.sh' from the script and appends '.pid' to the string. So, in this case, since it's named 'mirror-alien-repository.sh' by default, your pid file will be 'mirror-alien-repository.pid'. And if you change it to 'my-variant-to-mirror-robbys-stuff.sh' it'd have a pid file of 'my-variant-to-mirror-robbys-stuff.pid'.
I don't have time right now to read the whole script but to answer that specific question, it's using basename to strip the path and the '.sh' from the script and appends '.pid' to the string. So, in this case, since it's named 'mirror-alien-repository.sh' by default, your pid file will be 'mirror-alien-repository.pid'. And if you change it to 'my-variant-to-mirror-robbys-stuff.sh' it'd have a pid file of 'my-variant-to-mirror-robbys-stuff.pid'.
Beautiful. That's a great system, too. I'm now back on my Slackware box so I'll mess around with the scripts.
Alright everyone I got it working. I am now mirroring Eric's repository in /home/ftp/alien and Robby's in /home/ftp/rlw. I had to change the ownership and permissions of ftp; I made it owned by nobody:ftp instead of root:root and I added write permissions for the group. I also added my normal user (agi) to the ftp group. It allows me to run the scripts without root permission. Is this particularly bad? I just did it for convenience, but I hope I didn't introduce some sort of security or stability risk!
Here is the script I use for Eric's repo:
Code:
#!/bin/sh
# $Id: mirror-alien-repository.sh,v 1.1 2008/03/15 15:15:05 root Exp root $
# Written 2008 Eric Hameleers <alien@slackware.com>, Eindhoven, Netherlands
#
# Mirror the http://www.slackware.com/~alien/slackbuilds repository.
# Since the repository allows only http transfers, use lftp instead of rsync.
# Don't use 'wget' because that does not delete remote files when they
# disappear on the remote server.
#
# The script works by downloading a copy of the remote ChangeLog.txt and then
# comparing it to your local version of this file. If no differences
# are found, the script will stop right there.
# If differences are found, the script will show the 'diff' output and then
# continue to mirror the remote repository. By using lftp, this process will
# be relatively efficient.
# When you want to run this script in a cron job, be sure to filter out STDERR
# so that you will only see emails from cron when there is actually a change.
# Example cron entry if you put the script in /usr/local/bin :
# 30 6 * * * /usr/local/bin/mirror-alien-repository.sh 2>/dev/null
#
# ---------------------------------------------------------------------------
# Do we want more messages? A '1' means 'yes', a '0' means 'no'.
DEBUG=${DEBUG:-0}
# We prevent the mirror script from running more than one instance:
PIDFILE=/var/tmp/$(basename $0 .sh).pid
# Make sure the PID file is removed when we kill the process
trap 'rm -f $PIDFILE; exit 1' TERM INT
if [ -e $PIDFILE ]; then
echo "Another instance (`cat $PIDFILE`) still running?"
echo "If you are sure that no other instance is running, delete the lockfile"
echo "'${PIDFILE}' and re-start this script."
echo "Aborting now..."
exit 1
else
echo $$ > $PIDFILE
fi
# Our local mirror:
#LOCALTREE=${LOCALTREE:-"/tmp/alien_repository"}
LOCALTREE=${LOCALTREE:-"/home/ftp/alien"}
# The URL for the remote repository:
REMOTEURL=${REMOTEURL:-"http://www.slackware.com/~alien/slackbuilds"}
# Where we store temporary files if needed:
TMP=${TMP:-"/tmp"}
# Tools:
LFTP=${LFTP:-"/usr/bin/lftp"}
# Sanity checks:
if [ ! -d $TMP ]; then
echo "Temp directory '$TMP' does not exist yet, creating directory now..."
mkdir -p $TMP
fi
if [ ! -w $TMP ]; then
echo "Temp directory '$TMP' is not writable! Quitting now..."
rm -f $PIDFILE
exit 1
fi
if [ ! -d $LOCALTREE ]; then
echo "Local tree '$LOCALTREE' does not exist yet, creating directory now..."
mkdir -p $LOCALTREE
fi
if [ ! -w $LOCALTREE ]; then
echo "Local tree '$LOCALTREE' is not writable! Aborting..."
rm -f $PIDFILE
exit 1
fi
# Check for an updated ChangeLog.txt:
[ $DEBUG -eq 1 ] && echo "$(date) [$$]: Getting ChangeLog.txt..."
rm -f $TMP/alien_ChangeLog.txt
cd $TMP
# Direct all output to stderr so that you can filter it out in a cron job:
$LFTP -e "get ChangeLog.txt -o alien_ChangeLog.txt && quit" $REMOTEURL 1>&2
cd -
if [ ! -s $TMP/alien_ChangeLog.txt ]; then
echo "$(date) [$$]: Could not retrieve ChangeLog.txt! Aborting..."
rm -f $PIDFILE
exit 1
fi
# If the ChangeLog.txt on our local mirror doesn't exist, it might mean that
# this is a first-time mirror. To prevent the script from aborting, we
# create an empty ChangeLog.txt file...
if [ ! -e ${LOCALTREE}/ChangeLog.txt ]; then
touch ${LOCALTREE}/ChangeLog.txt
fi
diff -b ${LOCALTREE}/ChangeLog.txt $TMP/alien_ChangeLog.txt
STATUS="$?"
if [ "$STATUS" == "2" ]; then
echo "$(date) [$$]: Trouble when running diff, aborting..."
rm -f $PIDFILE
exit 1
elif [ "$STATUS" == 0 ]; then
[ $DEBUG == 1 ] && echo "$(date) [$$]: No difference found, quitting now..."
rm -f $PIDFILE
exit 0
else
echo "$(date) [$$]: ChangeLog.txt has been updated."
fi
# Starting the mirror:
echo "$(date) [$$]: Starting the mirroring process."
# Direct all output to stderr so that you can filter it out in a cron job:
lftp -c "open $REMOTEURL ; mirror --verbose=0 --delete --continue . $LOCALTREE/" 1>&2
echo "$(date) [$$]: Finished the mirroring process."
rm -f $PIDFILE
And here is what I use for Robby's repo. I made some minor modifications and set it to only mirror x86_64 by changing the lftp line at the end:
Code:
#!/bin/sh
# mirror-rlw-repository.sh
#
# Modified from Eric Hameleer's mirror-alien-repository.sh script.
#
# Mirror the http://rlworkman.net/pkgs/13.1/ repository.
# Since the repository allows only http transfers, use lftp instead of rsync.
# Don't use 'wget' because that does not delete remote files when they
# disappear on the remote server.
#
# The script works by downloading a copy of the remote ChangeLog.txt and then
# comparing it to your local version of this file. If no differences
# are found, the script will stop right there.
# If differences are found, the script will show the 'diff' output and then
# continue to mirror the remote repository. By using lftp, this process will
# be relatively efficient.
# When you want to run this script in a cron job, be sure to filter out STDERR
# so that you will only see emails from cron when there is actually a change.
# Example cron entry if you put the script in /usr/local/bin :
# 30 6 * * * /usr/local/bin/mirror-alien-repository.sh 2>/dev/null
#
# ---------------------------------------------------------------------------
# Do we want more messages? A '1' means 'yes', a '0' means 'no'.
DEBUG=${DEBUG:-0}
# We prevent the mirror script from running more than one instance:
PIDFILE=/var/tmp/$(basename $0 .sh).pid
# Make sure the PID file is removed when we kill the process
trap 'rm -f $PIDFILE; exit 1' TERM INT
if [ -e $PIDFILE ]; then
echo "Another instance (`cat $PIDFILE`) still running?"
echo "If you are sure that no other instance is running, delete the lockfile"
echo "'${PIDFILE}' and re-start this script."
echo "Aborting now..."
exit 1
else
echo $$ > $PIDFILE
fi
# Our local mirror:
#LOCALTREE=${LOCALTREE:-"/tmp/alien_repository"}
LOCALTREE=${LOCALTREE:-"/home/ftp/rlw"}
# The URL for the remote repository:
REMOTEURL=${REMOTEURL:-"http://rlworkman.net/pkgs/13.1/"}
# Where we store temporary files if needed:
TMP=${TMP:-"/tmp"}
# Tools:
LFTP=${LFTP:-"/usr/bin/lftp"}
# Sanity checks:
if [ ! -d $TMP ]; then
echo "Temp directory '$TMP' does not exist yet, creating directory now..."
mkdir -p $TMP
fi
if [ ! -w $TMP ]; then
echo "Temp directory '$TMP' is not writable! Quitting now..."
rm -f $PIDFILE
exit 1
fi
if [ ! -d $LOCALTREE ]; then
echo "Local tree '$LOCALTREE' does not exist yet, creating directory now..."
mkdir -p $LOCALTREE
fi
if [ ! -w $LOCALTREE ]; then
echo "Local tree '$LOCALTREE' is not writable! Aborting..."
rm -f $PIDFILE
exit 1
fi
# Check for an updated ChangeLog.txt:
[ $DEBUG -eq 1 ] && echo "$(date) [$$]: Getting ChangeLog.txt..."
rm -f $TMP/rlw_ChangeLog.txt
cd $TMP
# Direct all output to stderr so that you can filter it out in a cron job:
$LFTP -e "get ChangeLog.txt -o rlw_ChangeLog.txt && quit" $REMOTEURL 1>&2
cd -
if [ ! -s $TMP/rlw_ChangeLog.txt ]; then
echo "$(date) [$$]: Could not retrieve ChangeLog.txt! Aborting..."
rm -f $PIDFILE
exit 1
fi
# If the ChangeLog.txt on our local mirror doesn't exist, it might mean that
# this is a first-time mirror. To prevent the script from aborting, we
# create an empty ChangeLog.txt file...
if [ ! -e ${LOCALTREE}/ChangeLog.txt ]; then
touch ${LOCALTREE}/ChangeLog.txt
fi
diff -b ${LOCALTREE}/ChangeLog.txt $TMP/rlw_ChangeLog.txt
STATUS="$?"
if [ "$STATUS" == "2" ]; then
echo "$(date) [$$]: Trouble when running diff, aborting..."
rm -f $PIDFILE
exit 1
elif [ "$STATUS" == 0 ]; then
[ $DEBUG == 1 ] && echo "$(date) [$$]: No difference found, quitting now..."
rm -f $PIDFILE
exit 0
else
echo "$(date) [$$]: ChangeLog.txt has been updated."
fi
# Starting the mirror:
echo "$(date) [$$]: Starting the mirroring process."
# Direct all output to stderr so that you can filter it out in a cron job:
#lftp -c "open $REMOTEURL ; mirror --verbose=0 --delete --continue . $LOCALTREE/" 1>&2
lftp -c "open $REMOTEURL ; mirror --verbose=0 --delete --continue x86_64/ $LOCALTREE/" 1>&2
echo "$(date) [$$]: Finished the mirroring process."
rm -f $PIDFILE
One thing I've noticed is that alien's repository is taking quite a long time to download and quite a bit of space. This seems to be because I'm getting all sorts of packages for different versions of Slackware and different architectures. Is there a way to only mirror the "build" and "pkg64" directories for each package? I can't seem to figure this out since Eric's repository is organized by package rather than architecture (viz. the highest directory is the name of each package, which each has a build/, pkg/ and pkg64/ directory). I'll keep experimenting, but please let me know if you know how to do this!
I tried to change the lftp line near the end of the script:
with the hopes that I could mirror the pkg64 directories of every package as long as it had a 13.1 version. Unfortunately, this resulted in a 404 not found error.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.