autoslack The Slackware Linux System Currentizer and All-Around Spamifier by: David Cantrell ========================================================================== Autoslack is designed to keep your Slackware Linux system up to date automatically. It reads a configuration file to get the FTP site you wish to use, the distribution directory to use, and where to store the packages on your system. It will show what's been updated based on what you have installed, what's new since you installed, and optionally download and install the packages. Autoslack is provided under the terms of GNU General Public License, version 2.0. A copy of this license can be found in the included "GPL" file in this directory. Under no circumstances shall the author or BSD, Inc. be held responsible for any damage caused by the use of this program, either accidental or intentional. -------------------------------------------------------------------------- TOC of Contents -------------------------------------------------------------------------- 0. autoslack Requirements 1. Setting Up autoslack 1.0 Running configure 1.1 make && make install 1.2 Writing Your Configuration File 1.3 The CHECKSUMS.md5 files 2. Using autoslack 2.0 Seeing What's New, Updated, and Deprecated On Your System 2.1 Downloading the Updates and New Packages 2.2 Having autoslack Update The System 2.3 Having autoslack Add New Packages to the System 2.4 Having autoslack Remove Deprecated Packages 2.5 Deleting Downloaded Packages 2.6 Using autoslack to Bring Your System Into Bleeding Edge Bliss 2.7 Selecting packages to update, install, or remove 2.8 Using NFS 2.9 Using the Bulk Ignore Facility 3. Getting Help 3.0 The Obvious First Choices 3.1 The man Pages 3.2 Online Resources 4. Miscellaneous 4.0 Reporting Bugs 4.1 Greets -------------------------------------------------------------------------- 0. autoslack Requirements -------------------------------------------------------------------------- autoslack is a pretty simple program. Some of the requirements listed are obvious, but others may surprise you. To take advantage of all of autoslack's features (and flaws), you'll need: - A system running Slackware Linux - root access on said system - Access to the Internet (that's activated before running autoslack) - Perl - The /slakware/CHECKSUMS.md5 and /contrib/CHECKSUMS.md5 files (see section 1.3) - Getopt::Mixed (Perl module) - Net::FTP (Perl module) - Term::ReadKey (Perl module) Installing Slackware on your computer should take care of the first 4 requirements. The last four can be satisfied by completing the steps in the next section. -------------------------------------------------------------------------- 1. Setting Up autoslack -------------------------------------------------------------------------- 1.0 Running configure ---------------------- autoslack is pieced together with the GNU autoconf system. It makes installation very simple. To prepare the sources to be "built" and then installed, run the configure script: ./configure The script can take several arguments. A list of all available arguments is available through the --help option on configure. The most common options are --prefix, --sysconfdir, --with-spool-dir, and --with-sum-dir. Most of the other default autoconf options are ignored. Here's an example configure line: ./configure --prefix=/usr \ --sysconfdir=/etc/autoslack \ --localstatedir=/var/state/autoslack This will "build" an autoslack that looks for the config files in the /etc/autoslack directory and stores the CHECKSUMS.md5 files in /var/state/autoslack. All of these options are optional, of course, with the default prefix and conf dir being /usr/local and /usr/local/etc. The default directory for the CHECKSUMS.md5 files is /var/state/autoslack. 1.1 make && make install ------------------------- After you've configured autoslack, the next step is to make and install it. To do that, we use these commands: make make install That's it. Autoslack is now installed. Be sure to follow the next steps to properly set up your configuration file and place your CHECKSUMS.md5 file(s). 1.2 Writing Your Configuration File ------------------------------------ The configuration file is a plain text file that contains a lot of comments (denoted by the hash mark at the beginning of the line) and setting=value lines. The example file is self-documented. You can use it as a template for your own configuration file. If you ran the autoslack installer, you already have a configuration file. The only reason you'd need to see it is if you wanted to change a setting. 1.3 The CHECKSUMS.md5 files ---------------------------- How does autoslack work? Well, it has to get information about the distribution from somewhere. It does this by reading the CHECKSUMS.md5 files in the /slakware and /contrib directories. It compares these to ones on your system to see what can be upgraded, installed, or removed. So, before you start using autoslack, you'll need to copy the /slakware/CHECKSUMS.md5 and /contrib/CHECKSUMS.md5 files to the local state directory. This directory is set by the configure script. If you are using the prebuilt Slackware package for autoslack, then the local state directory is /var/state/autoslack. Make sure to get these files from the copy of Slackware you install from. Otherwise, it won't represent what's on your system. Since the files have the same basename, autoslack expects them to be named: CHECKSUMS.md5-slakware CHECKSUMS.md5-contrib This is pretty much the guiding force behind autoslack. Without these files, it doesn't work. -------------------------------------------------------------------------- 2. Using autoslack -------------------------------------------------------------------------- ***************************** W A R N I N G! ***************************** * You've got autoslack installed and ready to go. Remember, it can be a * * very dangerous program when used incorrectly. Backups are always a * * good idea whenever upgrading things. In other words, if you screw * * over your system, it ain't my fault. Consider yourself warned. * ************************************************************************** autoslack has a good number of command line options. The ones explained below use the long option. Each long option has an equivalent short option that can be found in help screen and man page. Pass --help to get help. Also remember that options can be combined in many ways to get added functionality. For example, typing "autoslack --download --update --purge" would download any new and updated packages, install only the updated packages and then purge the packages it installs. You'd be left with a directory of new packages. Pretty cool, eh? 2.0 Seeing What's New, Updated, and Deprecated On Your System -------------------------------------------------------------- When you run autoslack with no arguments, it will fetch the latest distribution information, compare it to what's on your system, and then report what can be done to your system. To see the report: # autoslack It will display what it's doing at each major step and then report what can be upgraded, installed, or removed from the system. 2.1 Downloading the Updates and New Packages --------------------------------------------- From time to time, you may want to just download the updates and new packages without actuall installing them. Crazy as it may sound, autoslack does support this feature. Just pass the --download option: # autoslack --download It will see what can be downloaded and do just that. Nothing will be installed or removed from your system. The --purge option is also ignored if you specify the --download option. 2.2 Having autoslack Update The System --------------------------------------- Many people may want to just keep up to date with the packages they have installed. The --update option will satisfy that: # autoslack --update The program will collect the updated packages and run upgradepkg on each one. 2.3 Having autoslack Add New Packages to the System ---------------------------------------------------- To get autoslack to download new packages that are found in the distribution and install those, you'll want to use the --install option: # autoslack --install Any package found in the distribution that you don't already have will be downloaded and installpkg will be run on it. 2.4 Having autoslack Remove Deprecated Packages ------------------------------------------------ From time to time we remove packages in the distribution. autoslack accounts for this and offers you the option of removing these deprecated packages. Just use the --remove option. # autoslack --remove Be advised that this WILL NOT remove any packages that you make on your own and install. It will only remove packages that have been in the distribution. Of course, if you use the same package name that we used, well, I can't help you there. :) 2.5 Deleting Downloaded Packages --------------------------------- If you don't want to examine the packages that autoslack downloaded and applied to your system, you can have the program immediately purge them after installing them. # autoslack --purge This option must be used with --update or --install. It will only purge packages that correspond to the options used. For example, if you only specify --install and --purge, only packages that are new to your system will be purged from the spool directory. 2.6 Using autoslack to Bring Your System Into Bleeding Edge Bliss ------------------------------------------------------------------ You've seen several of autoslack's option. Now, how do you make it keep your system up to date with whatever's on the FTP site? Here's the command line that I usually run: # autoslack --update --install --remove --verbose It updates anything that needs updating, installs any new packages found in /slakware or /contrib, and removes deprecated packages. The verbose mode displays a really cool download status screen. 2.7 Selecting packages to update, install, or remove ----------------------------------------------------- Starting in autoslack 1.1, you now have the option of running autoslack in "select" mode. By passing the --select command line switch, you will be presented with dialog-based menus of packages that you can add, update, or remove. This is useful for users not wanting to maintain a full install of Slackware, but rather a pick-and-choose install. 2.8 Using NFS -------------- By using the --nfs command line option, you can avoid having to download anything from the Slackware site. The idea is that somewhere on your network, you have an NFS server with a mirror of slackware-current installed on it. For most home users this option is probably not useful, but if you work in Industry or at a University, such a server may exist. You have to set up the name of the server and it's exported file system in the config file. For example, say there was a host mirror.slackware.com that had a copy of Slackware mirrored and exported on /usr/local/mirrors/slackware-current. You would set NFSERVER in autoslack.conf to be; NFSSERVER mirror.slackware.com:/usr/local/mirrors/slackware-current 2.9 Using the Bulk Ignore Facility ----------------------------------- This facility allows you to tell autoslack not to even consider getting the files in certain directories. It is intended primarily for those who have restricted disc space or only have a slow dial-up connection and do not want to download large blocks of the total Slackware issue. It cannot be invoked from the command line. If you hated emacs (for example) you might want to not consider the e1 'disc' of the Slackware install set and the xemacs directories in the contrib set. If you name those in the skip files then they are never presented to you for consideration and never downloaded. The facility requires you to create a file called 'SKIPLIST' whose contents are the top-level directory names you want to ignore (i.e. the directories immediately below 'slakware' and/or 'contrib'). These should be on a one per line basis. Trailing comments and leading spaces are permitted, but nothing else should be on the line, e.g. to ignore the emacs directories have two lines as below: e1 xemacs When you have created this file (in whatever directory you wish) you need to identify the directory to autoslack. You do this by specifying the directory in autoslack.conf using the tag 'SKIPDIR'. A good directory to use is /var/log/packages, if you did this then the SKIPDIR line would be: SKIPDIR = /var/log/packages Until you have set the parameter in autoslack.conf then the skip facility is not activated - this is the state in which autoslack is shipped. To deactivate the whole skip facility you can remove the SKIPDIR lines from the config file, comment it out, or just delete the directory name part. If you leave the line alone and delete the skip list file then the run will halt with the message that it cannot find the file. Having an empty skip list file is allowed. To deactivate the skip of a particular directory just edit it out of the skiplist file. Note that the facility deals with directories and their subordinate directories and files not individual files. So suppressing Afterstep (for example) from the contrib tree is not supported as afterstep.tgz is in the contrib directory itself rather than in a subordinate directory. -------------------------------------------------------------------------- 3. Getting Help -------------------------------------------------------------------------- 3.0 The Obvious First Choices ------------------------------ The README file should provide enough information to get you going. Also, the --help screen on the autoslack program will help. The autoslack.conf is also pretty well commented...enough for you to figure out each option. 3.1 The man Pages ------------------ Man pages are provided for autoslack(8) and autoslack.conf(5). The installer will place them in appropriate directories on your system. They try to provide even more information than the above mentioned sources. 3.2 Online Resources --------------------- There's no online help yet. -------------------------------------------------------------------------- 4. Miscellaneous -------------------------------------------------------------------------- 4.0 Reporting Bugs ------------------- I usually don't like to hear about bugs, but I hear that's not a good position to take when developing software. If you find a bug, feel free to let me know: David Cantrell If it's not a bug, I'll let you know (and why). If it's a bug that I can fix easily, I'll usually reply that same day. Otherwise, I may sit on it for a while so I can come up with a fix for it. 4.1 Greets ----------- Patrick Volkerding For humoring me by listening to my crazy ideas about autoslack and throwing in show-stoppers in the ChangeLogs. Logan Johnson Answering Perl questions so I didn't have to look it Chris Lumens up in the Cookbook. The Perl Cookbook For when Logan or Chris were not available for questions.