This module is currently tied to the repository layout used by reprepro in order to identify the architecture list and various other pieces of meta-data. In time, functions can be added to provide such lists.
The module expects to find all repositories beneath a single base directory:
$base/$repo_name/conf/distributions
If $base is undefined or if the repository directories cannot be found, subsequent functions each return undef.
etc.
Example code:
use Debian::Packages::Compare;
my $base = '/path/to/repositories/'
&set_base($base);
my $debu = &read_packages ('unstable', 'filter');
my $gripu = &read_packages ('unstable', 'grip');
my %debianunstable = %$debu if (defined $debu);
my %gripunstable = %$gripu if (defined $gripu);
foreach my $pkg (sort keys %debianunstable)
{
if ($debianunstable{$pkg}{'source'} ne $gripunstable{$pkg}{'source'})
{
# $pkg is either not in grip repository or is a different version
}
}
The main features for subsequent versions will involve more verbose error handling.
perl -MDebian::Packages::Compare -MData::Dumper -e '&set_base("/opt/reprepro"); \
$c = &read_packages("testing","grip"); print Dumper ($$c{"dpkg"});';
Reads the supported architectures and returns a list.
Reads the supported locale roots and returns a list.
$base/$repo_name/dists/$suite/main/binary-$arch/Packages $base/$repo_name/dists/$suite/main/source/Sources.gz
Takes two parameters - the suite name and the repository name.
Returns undef if the Packages file cannot be found.
e.g. for the Grip repository:
$hash{'sed'}{'source'} => '4.1.5-8'
$hash{'sed'}{'armel'} => '4.1.5-8em1'
...
The locale root is contained in $list{$package}{'locale'} and the source package name in $list{$package}{'source'}
e.g.
$hash{'sed-locale-pt-br}{'source'} => 'sed'
$hash{'sed-locale-pt-br}{'locale'} => 'pt'
$hash{'sed-locale-pt-br}{'armel'} => '4.1.5-8'
...
$hash{'sed'}{'source'} => '4.1.5-8'
TODO: need a get_outdated_sources and get_outdated_binaries too.
Emdebian version suffixes are automatically cleared in the comparison.
To be suitable for migration, a package must exist in the first repository at the same version in both unstable and testing. It must also exist in the second repository for unstable and be the same version as in the first repository. Finally, the source package must either be absent from testing in the second repository or be at a lower version than in unstable.
This is a Debian-only feature and no support is available for repositories that do not implement unstable and testing suites in precisely the same manner as Debian.
All data is reloaded fresh each time the function is run.
1. repo1 unstable must match repo1 testing 2. repo1 unstable must match repo2 unstable 3. repo2 unstable must B<be newer> than repo2 testing 4. All architectures are compared, including source.
Returns undef in case of error.
The returned hash is indexed under the source package name.
To get the list of packages that raised a complaint about missing sources, call get_britney_complaint - the returned list will be undefined unless get_britney_list has already been called.
If get_britney_list has not been called, returns undef.
If there are no complaints, also returns undef.
Copyright (C) 2008 Neil Williams <codehelp@debian.org> This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.