Distriblint webpage
The packager killer
Urpmchecker module
Understand it
Error message
Distlint
Standard mode
Interactive mode
Example
Advanced used
Batch file

What is this:

Some tools to check distribution rpm based integrity, it report some error like  conflict, dependencies...
You can use it to check your project, check all is good against the base/main distro (repository), or check the whole distribution.

Understand the urpmchecker module:

How it works ?

Urpmchecker can work from:
Each entry is a repository for next section of this documentation.

Repository level:

On some distributions, or when you manage a project, you have to considere a based distro, and add-ons. A good exemple is on mandrake's distro main (core distrib) and contrib. We should test nothing in main requires somethings in contrib.
You can separate repository or batch of repository by level.

update flag:

Distriblint does not check updated packages, but return an error if a package is older than another. This situation can be normal if you want to check the integrity of officials updates.
To not get VER error you can set the update flag.

Error messages:

BIN
This src package does produce any binary...

BINO
This src package produce binary but in another repository.

CFL
Those rpms contains same file, but files are differents, and those rpm do
not explicitly conflict. rpm will be unable to handle this safety.

CFLO
Those rpms contains same files but files are not own by same user or group.
If those files come from server apps, or contains secret password,
it can create a security hole.

CFLP
Those rpms contains same files but without same permissions.
If those files come from server apps, or contains secret password, 
it can create a security hole.

CFLT
Those rpms contains same file, but files have differents type
(dir vs link, file vs link), those rpm do not explicitly conflict,
rpm will be unable to handle this safety.

DEP
This requirement is missing in the distrib, installation or
building is impossible, maybe it need a rebuild.

DEPB
The package depend on an old o an obsolete package, if thie requirement is remove,
the package will become uninstallable.

DEPO
This requirement is present but in a sublevel repository, you can
install or build it only if you have the second repository in your config.

DIRM
A file is installed by a rpm but no rpm own parent dir.
This mean uninstall the rpm, the parent dir will not be removed.

DIRO
A file is installed but the rpm which parent directory is in
repository level highter. To cleanly install, you should have this level.

OBS
The package in level x is always obsolete by another in level y, 
then why it is in distro? If a package obsolete itself, there is a problem :)

REB
This src need to be build, binary are not found, or not up to date.

SRC
This binary does not have a src.

SRCO
This binary have a src but in another repository.

VER
An highter version of this package was found, so it shoulb be removed.

VERM
Two binary from same source was found, but do not come from same version
of source package, this mean the rpm is obsolete, or old. You should check
if this package should be remove.

VERT
This version of rpm is list twice, it will never update somethings.

Distlint script:

Standard mode:

Argument order on comand line is important, please take care on that.
Each argument can be a repository, a separator, an option or a flag:
repository: a rpm, a glob entry, a hdlist as explain for urpmchecker
flags: each time it is called, it take TRUE or FALSE value, all tag start set as FALSE.
option: if set, is apply to the whole process

repository
add a repository to compute, can be hdlist, dir or rpms
/
update repository level
Flags:
--
rpms in this repsitory will be checked and error reported
--src
assuming those repository contain binary and source packages, it will check that src.rpm produce binary, and binary have a src.rpm
--reb
try to find src which need to be rebuilt, implies --src
--nocf
do not check error about files or dir installed by rpms on those repository
--nodep
do not check dependancies or related error, included versionning problem
--update
repository can contains update rpms
Options:
-p packager
show error only for rpms from "packager" guy (from changelog)
-n package_name
show error only for package named "package_name"
-a arch
set architecture to "arch", this mean incompatible rpm will not be check
Other:
-h / --help
print the help
--ho ERR
print explanation for error type "ERR"
-b BATCH
Read a batch file, uselly used by distlintbatch
-i
Don't compute error, but start interactive mode

Interactive mode

This function provide a command line envirronment to querying rpm. You can add repository, compute dependancies, looking for error, ect...

Command
Description
add [[--nocf] [--nodep] [--src] [--reb] [--update]] repository1 [repository2...]
add a repository, option are same than command line argument, see above
all repository set on same line will be in same level.
listpath
list know shortcut from your ~/.chkdep
listurpmi
list hdlists in /var/lib/urpmi, used by urpmi
listrep
list repository actually in memory
arch
set system architecture to test
--
set/unset checking flag
/
set/unset increase level flag
parse
read rpm header and store info in memory
search [[-p] [-s] [--nosrc] [--nonoarch] regexp
Search package named, apply the regex for searching:
-p search for packager
-s search for package build from package named
--nonoarch do not show noarch rpms
--nosrc do not show src rpms
qi [search option] perform a basic rpm -qi on packages find by search with search options
ql [search option] perform rpm -ql on packages find by search with search options
dep [search option]
print dependencies on this packages, options are apply as search
req [search option]
print package which require those package, options are apply as search
findfile [search option] regexp
search packages which contain files matching regexp
analyze
find error and print concerned packages, you need to run 'parse' before
listerror [search option]
list packages with error, see search for options
error [search option]
print error on package, options are apply as search
noerror [search option]
print package without error
reset
reset all data in memory
quit
Leave this stupid tools :)

Example:

I want to check my package, only in contrib and plf for ppc (my computer is a pIII).
I will run:
distlint -a i586 -p thauvin /var/lib/urpmi/hdlist.nanarmain.cz  / -- /var/lib/urpmi/hdlist.nanarcontrib.cz / --update /var/lib/urpmi/hdlist.nanarplf.cz

Advanced used

Batch file:

Same exemple from a batch file:
#!/usr/bin/perl

$o = {
arch => 'ppc',
# mail value are only used by distlintbatch
# take mailto if present, else eval mailto_eval
#mailto => "me\@serveur"
mailto_eval => "\$maintener ? \$maintener : \$packager",
mailto_summary => "maintener",
mailfrom => "Distlint <me\@myserver>",
mailsubject => "Pb in your mdk packages",
mailheader => "Hi, I found pb in your package, please check it",
mailfoot => "To have explanation, run distlint --ho ERR_CODE",
# smtp => 'localhost.localdomain',
replyto => '',

repository =>
[
{
list => [ "/var/lib/urpmi/hdlist.nanarmain.cz", ],
check => 0,
# Other value are ignore...
chksrc => 1,
nochkdep => 0,
nochkcf => 0,
update => 0,
},
{
list => [ "/var/lib/urpmi/hdlist.nanarcontrib.cz", ],
check => 1,
chksrc => 0,
nochkdep => 0,
nochkcf => 0,
update => 0,
},
{
list => [ "/var/lib/urpmi/hdlist.nanarplf.cz", ],
check => 1,
chksrc => 0,
nochkdep => 0,
nochkcf => 0,
update => 1,
},
],
};

# This is used to get official maintener list into mandrake distro
# Should return a hash: ( src_package_name => maintener_mail )
# Can be missing
sub get_maintener {
my %l;
open CURL, "/usr/bin/curl -s http://qa.mandrakesoft.com/maints.cgi |" or die "Err when retrieving maintener list\n";
while (<CURL>) {
m/(.*)\t(.*)/;
$l{$1}=$2;
}
close CURL;
%l
}

Contact:

Olivier Thauvin: thauvin at aerov dot jussieu dot fr
Cvs: at Mandrake
$Id: index.html.template,v 1.7 2003/06/02 16:29:31 othauvin Exp $