Hi all
The script that I wrote (
with a lot of help from the LQ crew) has worked exceptionally well. It is fast (download speed being the limiting factor), secure (it checks md5sums and GPG signatures), and fails in a sane way if something goes wrong.
It requires the user to be logged in as root, and works best when the user:
- Has a full installation of Slackware.
- Is running the -stable branch of Slackware.
- Has a directory set up on the hard drive for a persistent local mirror.
- Has a proper GPG personal key and has imported and signed the Slackware Security GPG key.
- Has not replaced packages from the default installation of Slackware with ones not maintained by the Slackware team.
The above list describes my installation pretty well. In the three and a half years that I've been running Slackware, starting with Slackware 11 in late 2006, I've only ever run a full installation of the stock -stable branch. I've
added packages to Slackware that aren't included, but I've never
replaced any until I decided to use the updated
KDE 4.3.1 packages from Vincent Batts instead of the stock KDE 4.2.4 that comes with Slackware 13.
This last point is important for me because the Slackware developers released a a new patch for the kdebase-workspace-4.2.4 package today. So if I just run my script, I'll end up (most likely) breaking KDE!
That's not a good thing.
The simple solution is to modify the lftp command in the script to exclude KDE patches, like so:
Code:
lftp -c "open slackware.mirrors.tds.net/pub/slackware/slackware64-13.0/patches/ ; mirror -e -n -X kde* packages"
One caveat: I need to test that command to make sure it does what I want it to do,
The larger issue, though, is the fact that so much of this script is hard-coded. The mirror location is hard coded, and with it, the Slackware version. Now I'm going to hard-code the blacklist. When I upgrade to the next version of Slackware, I'll need to update the script with new values.
Personally, I'm not bothered by this state of affairs. This is, after all, a script and not a true application (
like slackpkg ). To make this script more generally useful, I would need to set up variables for the mirror, Slackware version, and blacklist -- all passed to the lftp line of the script. The variables would probably need to be stored in an update_slackware.conf file that I would update from time to time, when needed.
Right now, there's two things stopping me from making the script more general:
- I'm not sure how to pass variables to a command with Bash scripting.
- Editing the script is as easy as editing a configuration file.
The first point is interesting because one of the major points of this exercise was to learn more about using Bash scripting to simplify the computer stuff that I do. So I'm probably going to continue hacking on this script as time permits and see if I
can learn how to create and pass variables to it.
Mostly, though, my main future goals on this script are to improve the comments add a copyright, give credit to those who helped me and contributed code, better document the use assumptions, and add some disclaimers about causing problems with one's installation if one isn't careful.
I also want to refine the error-checking and provide more useful messages when something fails.