Slackcurrent - Keep your Slack box updated!
Versão em Português
What is Slackcurrent?
Slackcurrent is a package to check for newer packages installed on your Slackware box
on the current set on some mirror site you select on a list.
It get the list of packages installed local, if needed update the list of remote
files available on the mirror site, and compares they all. If some local package
is outdated, you'll be informed about that.
I thought it makes more stuff.
No, I does not. It's strongly based on the KISS (Keep It Simple, Stupid) principle,
so it is a really tiny program that can help you only to check for new packages.
There is some other apps that do that.
Yeah, but they presume you want to check for new packages and download it automatically.
Suppose you have a dial up connection with a 56k modem at home and a fast connection on
your job (I'm presuming you can use it at your job without problems) and wants to upgrade
your home Slackware box. Better yet, you don't have even Slackware at your job, you're
using another distro or that other ugly operating system. Will be a good idea you just
check for new packages at home and download it at your job, right?
Yeah, that looks good. But how can I do that?
Slackcurrent will generate a file with the list of packages that needs to be upgraded.
Just the list. You make what you want with it. Copy to a floppy and take it with you to your
job to download it, send it to your email, send it by ftp to your job computer, send to your
uncle, make a list of the newest files and put it on your site, you choose.
The file is named slackcurrent.list.
Ok, now what? I have the list.
Use a download manager like
wget to get your files. You can use like this:
wget <your wget options here> -i slackcurrent.list
Is there a way to check the files integrity?
Yes, sure. Slackcurrent presumes that each package that needs upgrade have
a .asc file with the same name of the package, and tries to download it. Maybe there
is one, maybe there is not. But after downloading the packages and the .asc is
up to you to check their signatures. Keep it simple. :-)
You can use the -cs/--check-sign option (see below) for this.
But I don't want to download the kernel files! I compile my kernels!
Two options: you can edit the list and remove the files you don't want to download
or you can use the blacklist file on the /etc/slackcurrent directory.
I think the second one is a good idea. :-)
What are the options I have to run it?
They are:
- -v ,--version Show Slackcurrent header with current version.
- -ul,--update-list Update the list of the remote files with a newer one.
- -ll,--list-local List your local packages (basically same as ls /var/log/packages).
- -lr,--list-remote List the remote files that are on your latest upgrade of the remote list.
- -lb,--list-blacklist List the files on your blacklist.
- -ln,--list-new List new packages since the latest list update.
- -cs,--check-sign Check the packages ASC signatures.
- -um,--update-mirrors Update the mirrors list file.
- -u ,--upgrade Checks for upgrade and creates (and show you, if you want) the list of files that needs upgrade.
- -ut,--upgradetesting Make the same testing as above, but includes also the testing directory.
- -df,--download-from Check and download your needed packages from some directory on some server on your local network.
I'm still a little confused on how to use it ...
Ok, get the latest package
here, install it on your Slackware box
and type,
as root:
slackcurrent.py -u <software set>
Since it's the first time you run
Slackcurrent, it will see that there is no
a list with the remote files and will tell you and ask if you want to download it.
If you don't download the list you'll have no way to check your local packages against
the files on the current set, so it's
mandatory you download the list. It's a
500kb +/- file.
But, it will only asks you to download the file list if it knows where the file list is.
Uncomment
only one row with the server you want to download your packages in the
/etc/slackcurrent/mirrors file. You can update the list using the
-um option also.
After choosing a server and downloading the list of newest remote files, you'll have the
list of the packages you need very quickly.
A quick tip:
Slackcurrent will tell you if your list of remote files are older
than 1 week.
Some samples usages:
slackcurrent.py -u slackware
slackcurrent.py -u slackware/xap
slackcurrent.py -u slackware/gnome
slackcurrent.py -u extra
What do I need to run it?
A Slackware box and
Python installed.
Where can I download Slackcurrent?
Here. Is a tiny file.
And the license is ...
GPL. Always.
Is there some other docs about it?
Martin Sinkovec wrote a HOWTO about
upgrading to Slackware-current using slackcurrent. Thanks Martin!
Another fine article
here, by Mike Oliveri. Thanks Mike!
An Underlinux article by Vagner "BugReport" Rodrigues Fernandes (Portuguese only). Thanks, Vagner!
Hey, cool, I know Python programming!
Good! So you can use the Slackcurrent stuff inside your programs. Let me show some options:
Python 2.4.1 (#1, Apr 10 2005, 22:30:36)
[GCC 3.3.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import slackcurrent
>>> p1 = slackcurrent.SlackPack("xyz-1.2.3-i386-1.tgz")
>>> p2 = slackcurrent.SlackPack("xyz-1.2.4-i386-1.tgz")
>>> p1 > p2
False
>>> p2 > p1
True
Using the code above, I imported the Slackcurrent objects and methods inside my current program and
created two fictional packages to check if the comparison is working. As we can see, the first one
is older than the second.
>>> slackcurrent.downloadremotelist()
Downloading
http://www.slackware.at/data/slackware-current/FILELIST.TXT
This download the newest list to our local computer. Is a good idea make this before checking for
upgrades. It just download a file with about 500 kb (FILELIST.TXT).
>>> locallist = slackcurrent.getlocallist()
>>> print locallist[10].name,locallist[10].version
alsa-lib 1.0.9
Getting the local package list and returning the
object (pay attention here, it's a SlackPack object
with name, version blah blah blah) on the 10th. position (just a random choice).
>>> remotelist = slackcurrent.getremotelist()
>>> print remotelist[10].name,remotelist[10].version
xpaint 2.7.0
Getting the remote package list and returning another random package.
>>> upgradelist = slackcurrent.getupgradelist()
>>> print upgradelist[0]
http://www.slackware.at/data/slackware-current/slackware/kde/koffice-1.4.2-i486-1.tgz
>>> print upgradelist[1]
http://www.slackware.at/data/slackware-current/slackware/kde/koffice-1.4.2-i486-1.tgz.asc
Getting the list with packages that needs upgrade. Please notice that on this case is not a list of packages
objects, but a list with the a) the package URL b) the package signature file URL. To know how many packages
need upgrade, you can use
>>> len(upgradelist)/2
1
And we can use
>>> p = [i for i in upgradelist if i.endswith("tgz")]
>>> p
['http://www.slackware.at/data/slackware-current/slackware/kde/koffice/1.4.2-i486-1.tgz']
to get only the packages and
>>> p = [i for i in upgradelist if i.endswith("asc")]
>>> p
['http://www.slackware.at/data/slackware-current/slackware/kde/koffice/1.4.2-i486-1.tgz.asc']
to get only the signature files.
Who the hell are you?
People knows me as "TaQ". Here is
my email,
my website (sorry, Portuguese only there).
More about ...
50% of the donation amount will go to The Python Software Foundation