Introduction
Snub is a Python script, it is developed as an alternative to native Slackware install/remove utilities - installpkg and removepkg. It use a SQLite database as store for all data related to installed packages files. Snub is package's file manager.
With snub you can
- install Slackware Linux OS packages
- safely remove installed packages
- check integrity of all installed files through it's md5
- check installed files Linux access rights
- find out package through it's file
- look at any installed file i-node number
You will need
- Python 3.1 with SQLite module
- SQLite libraries
- an Slackware package to install
Using
Package installing
You can install an Slackware Linux OS package using snub with just path where your package is located, as argument to snub. For example to install package zlib-1.2.3-1.tgz from directory /tmp type that command:
# snub /tmp/zlib-1.2.3-1.tgz
As you see there is no any options in it. That is suggested way of package installing. In the other hand, you can put option -i or --install before package name and it would work exactly the same. For example:
# snub -i /tmp/zlib-1.2.3-1.tgz or # snub --install /tmp/zlib-1.2.3-1.tgz
Package removing
Package removing work much alike as installation described above. The difference is that to remove package you was install before, is that you need to put in command a package log file, from previously installed package, from directory var/log/snub/package-name-version-arch-extension_mcookie_date_time as argument to snub. In previos example package zlib-1.2.3-1.tgz was installed and to properly remove it you would type command as in the following example:
# snub var/log/snub/zlib-1.2.3-1.tgz_78md91hd6_120102009_113441
The main difference between an installable package and gzip compressed log file is that log file is to be located in directory of which snub is aware and therefore can distinguish between package that you want to install and an log file through what you want remove package that was previously installed. When you use removing as described above, you can expect that snub will try to remove package which has exactly the same name as name and time of the package's log file. For example, if you had install zlib-1.2.3-1.tgz twice one after another snub will use log file's mtime to understand about of what package you want remove. For example, suppose that you have the same package installed twice:
var/log/snub/zlib-1.2.3-1.tgz_78md91hd1_120102009_113441
var/log/snub/zlib-1.2.3-1.tgz_89hb8nf92h_120102009_113443
As you can see, the difference between them is their mcookies (78md91hd1 and 89hb8nf92h) and time of installation which differ only for two seconds. As you see, removing is simple. If you want know about what packages is installed you can simply look in the directory which hold all saved log files: $ ls var/log/snub/ . After that you can choose a package for removing.
When snub is removing an package, it try to find an installed package with the same name as that which is to be removed. If snub find package which has the name exactly the same as the one for removing snub will try to not remove files that belong to both of them. This is default for any package removing. To that default removing snub also offer a more safe removing method. With this method, check is happen not against the packages with the same name but against all files installed through snub and therefore is registered in it's SQLite based database. If you choose that removing you will suffer from more slowness of it's process. Suppose that you have 100.000 file's records in database and 500 files in package to be removed. It is need to compare each file from that 500 files against all of that 100.000 entries. If check of one file takes 1 second, the whole removing will take 500 seconds, and it is about 8 minutes. But if you fall in situation when you had installed the same packages but under different names, you would need to use that relatively slow removing. To remove an package with such per-file remove-check use snub with -g option, and of course it's need to be used always when you need per-file remove checking. Example:
# snub -g var/log/snub/zlib-1.2.3-1.tgz_89hb8nf92h_120102009_113443
Also, in snub you can find the --short-remove option, -s in short form. This is an opposite side of per-file removing and with default mode removing standing some where in the middle between them. It is "short remove" not in sense of time but in sense of how long way snub is going to get through to understand what package to remove. And it is not much long. To use that, just type:
# snub -S zlib
And if snub find an package with such name, it will be silently removed with no additional measures to understand what exact package going to be removed. Of course, it will not disable default per-name remove checking, but if you has that package installed more than once you can not be sure about of what package will be removed.
So, you can install package as follows:
# snub /tmp/zlib-1.2.3-1.tgz
# snub -i /tmp/zlib-1.2.3-1.tgz
You can remove package as follows:
# snub var/log/snub/zlib-1.2.3-1.tgz_78md91hd6_120102009_113441
# snub -g var/log/snub/zlib-1.2.3-1.tgz_89hb8nf92h_120102009_113443
# snub -s zlib