Friday, October 10, 2014

Modification to rsync_slackware_patches.sh

On the Slackware docs page, in the beginners_guide--Watching for updated packages section--I noticed a flaw/feature/something I didn't like in the example script provided. Just a simple mod really. The script by default has the arch hardcoded, when honestly it would be better pulled from the system.

There is the option to set the arch to something different, which is fine if you want to rsync for a different arch than whats on your system (say have a local copy for another machine at your employ), but I believe it should have been set to the following:

# What architecture will we be mirroring? The default is 'x86' meaning 32bit.
# Alternatively you can specify 'x86_64' meaning 64bit. The value of SARCH
# determines the name of the slackware directories.
# This value can be overruled via the '-a' commandline parameter;
SARCH=${SARCH:-"x86"}


It should be changed to this:

SARCH=$(arch)

This will set the correct arch according to what your system has. Using the case statement -a switch will also allow you to set it should you need to still.


Links:

http://docs.slackware.com/slackware:beginners_guide

rsync_slackware_patches.sh - original

rsync_slackware_patches.sh - modified

No comments:

Post a Comment