.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Debian::Packages::Compare 3" .TH Debian::Packages::Compare 3 "2011-03-27" "perl v5.12.3" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "Name" .IX Header "Name" Debian::Packages::Compare \- emdebian repository comparison support .SH "VERSION" .IX Header "VERSION" Version 3.0.0 .SH "Synopsis" .IX Header "Synopsis" Read the Packages file, create a hash of Package and version \- once per arch, one per suite, one pair per repo. The underlying libparse-debian-packages-perl is a very simple module, there probably isn't any point putting extra data into the comparison hashes, get the data necessary and load the full Packages data separately using get_single_package. .PP 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. .PP The module expects to find all repositories beneath a single base directory: .PP .Vb 1 \& $base/$repo_name/conf/distributions .Ve .PP If \f(CW$base\fR is undefined or if the repository directories cannot be found, subsequent functions each return undef. .PP etc. .PP Example code: .PP .Vb 1 \& use Debian::Packages::Compare; \& \& my $base = \*(Aq/path/to/repositories/\*(Aq \& &set_base($base); \& \& my $debu = &read_packages (\*(Aqunstable\*(Aq, \*(Aqfilter\*(Aq); \& my $gripu = &read_packages (\*(Aqunstable\*(Aq, \*(Aqgrip\*(Aq); \& my %debianunstable = %$debu if (defined $debu); \& my %gripunstable = %$gripu if (defined $gripu); \& foreach my $pkg (sort keys %debianunstable) \& { \& if ($debianunstable{$pkg}{\*(Aqsource\*(Aq} ne $gripunstable{$pkg}{\*(Aqsource\*(Aq}) \& { \& # $pkg is either not in grip repository or is a different version \& } \& } .Ve .PP The main features for subsequent versions will involve more verbose error handling. .PP .Vb 2 \& perl \-MDebian::Packages::Compare \-MData::Dumper \-e \*(Aq&set_base("/opt/reprepro"); \e \& $c = &read_packages("testing","grip"); print Dumper ($$c{"dpkg"});\*(Aq; .Ve .SH "get_archlist" .IX Header "get_archlist" Requires the reprepro file layout, currently. .PP Reads the supported architectures and returns a list. .SH "get_locale_roots" .IX Header "get_locale_roots" Requires the reprepro file layout, currently. .PP Reads the supported locale roots and returns a list. .SH "get_components" .IX Header "get_components" Similar to get_locale_roots but for ordinary repositories so that component splits (like dev and doc in Emdebian Grip) can be implicitly supported. Note that repositories with contrib or non-free will likely get confused results with this kind of support. .SH "get_suite_names" .IX Header "get_suite_names" Parses the conf/distributions file for the specified repository and retrieves the list of configured suite names \- a collated unique list of the Suite: and Codename: variables in conf/distributions. .SH "get_unfrozen_suite_names" .IX Header "get_unfrozen_suite_names" Parses the conf/distributions file for the specified repository and retrieves the list of configured suite names that are \s-1NOT\s0 ReadOnly. Codename: variables are \s-1NOT\s0 included. .SH "set_base" .IX Header "set_base" Set the base directory of the repository (repositories) to be compared. The module expects to find all repositories beneath a single base directory: .PP .Vb 2 \& $base/$repo_name/dists/$suite/main/binary\-$arch/Packages \& $base/$repo_name/dists/$suite/main/source/Sources.gz .Ve .SH "read_sources" .IX Header "read_sources" Similar to read_binaries but expects a GZip compressed Sources.gz file. Not usually called directly. .SH "read_binaries" .IX Header "read_binaries" Reads the Packages file and creates a hash of the packages, architectures and versions in the respective repository (under the \f(CW$base\fR directory) and suite for the defined \f(CW@archlist\fR, including details of Sources. .PP Takes two parameters \- the suite name and the repository name. .PP Returns undef if the Packages file cannot be found. .PP e.g. for the Grip repository: .PP .Vb 3 \& $hash{\*(Aqsed\*(Aq}{\*(Aqsource\*(Aq} => \*(Aq4.1.5\-8\*(Aq \& $hash{\*(Aqsed\*(Aq}{\*(Aqarmel\*(Aq} => \*(Aq4.1.5\-8em1\*(Aq \& ... .Ve .SH "read_locale" .IX Header "read_locale" Specialised function that handles the locale-root organisation of the TDeb repository. The internal locale root component structure is hidden in the returned hash, the component name is listed separately and contained in the package name. Source data is retained under the original source package name and referenced in the hash: .PP The locale root is contained in \f(CW$list{$package}{\*(Aqlocale\*(Aq}\fR and the source package name in \f(CW$list{$package}{\*(Aqsource\*(Aq}\fR .PP e.g. .PP .Vb 5 \& $hash{\*(Aqsed\-locale\-pt\-br}{\*(Aqsource\*(Aq} => \*(Aqsed\*(Aq \& $hash{\*(Aqsed\-locale\-pt\-br}{\*(Aqlocale\*(Aq} => \*(Aqpt\*(Aq \& $hash{\*(Aqsed\-locale\-pt\-br}{\*(Aqarmel\*(Aq} => \*(Aq4.1.5\-8\*(Aq \& ... \& $hash{\*(Aqsed\*(Aq}{\*(Aqsource\*(Aq} => \*(Aq4.1.5\-8\*(Aq .Ve .SH "get_single_package" .IX Header "get_single_package" Retrieve the full Packages record for a single package, binary (single architecture) or source (.dsc). .SH "get_missing_sources" .IX Header "get_missing_sources" Compare two repositories for the same suite and return a list of source packages that are in the first repository but not in the second. (Older versions are ignored.) .PP \&\s-1TODO:\s0 need a get_outdated_sources and get_outdated_binaries too. .SH "get_missing_binaries" .IX Header "get_missing_binaries" Compare two repositories for the same suite and return a list of binary packages that exist in both repositories as source packages but only exist as binary packages in the first repository, not in the second. .PP Emdebian version suffixes are automatically cleared in the comparison. .SH "get_britney_list" .IX Header "get_britney_list" Compare two repositories, each with unstable and testing, return a list of source packages that are suitable for migration. .PP 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. .PP 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. .PP All data is reloaded fresh each time the function is run. .PP .Vb 4 \& 1. repo1 unstable must match repo1 testing \& 2. repo1 unstable must match repo2 unstable \& 3. repo2 unstable must B than repo2 testing \& 4. All architectures are compared, including source. .Ve .PP Returns undef in case of error. .PP The returned hash is indexed under the source package name. .PP 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. .SH "get_britney_complaint" .IX Header "get_britney_complaint" If get_britney_list comes up with source packages that are missing for a testing migration, get_britney_complaint returns the list of source package names that were identified. .PP If get_britney_list has not been called, returns undef. .PP If there are no complaints, also returns undef. .SH "Copyright and Licence" .IX Header "Copyright and Licence" .Vb 1 \& Copyright (C) 2008 Neil Williams \& \& 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 . .Ve .SH "AUTHOR" .IX Header "AUTHOR" Neil Williams, \f(CW\*(C`\*(C'\fR .SH "BUGS" .IX Header "BUGS" Please report any bugs or feature requests to the Debian Bug Tracking System using \f(CW\*(C`reportbug libdebian\-packages\-compare\-perl\*(C'\fR.