apt-show-source-0.10+nmu4/0000755000000000000000000000000012640046162012240 5ustar apt-show-source-0.10+nmu4/TODO0000644000000000000000000000014107667072236012742 0ustar ** Code-Cleanup * Output-Sorting * add support for regexp eg. apt-show-source --package='*dpkg*' apt-show-source-0.10+nmu4/debian/0000755000000000000000000000000012640046162013462 5ustar apt-show-source-0.10+nmu4/debian/changelog0000644000000000000000000001165112640033003015326 0ustar apt-show-source (0.10+nmu4) unstable; urgency=medium * Non-maintainer upload. * debian/rules: - Fixed the path to install the executable correctly. (Closes: #809156) - Replaced dh_installmanpages to dh_installman. -- Giovani Augusto Ferreira Sun, 27 Dec 2015 16:31:43 -0200 apt-show-source (0.10+nmu3) unstable; urgency=medium * Non-maintainer upload. * Update DH level to 9. (Closes: #800298) * debian/compat: created. * debian/control: - Added the ${misc:Depends} variable to provide the right install dependencies. - Bumped Standards-Version to 3.9.6. * debian/rules: disabled the DH_COMPAT line. -- Giovani Augusto Ferreira Fri, 11 Dec 2015 18:31:28 -0200 apt-show-source (0.10+nmu2) unstable; urgency=medium * Non-maintainer upload. * Rebuild to fix FTBFS and restore lost binaries (Closes: 797740) -- Scott Kitterman Wed, 02 Sep 2015 03:19:02 -0400 apt-show-source (0.10+nmu1) unstable; urgency=medium * Non-maintainer upload. * Use DESTDIR rather than PREFIX to install; fix FTBFS with perl 5.22 (Closes: #792372) * Move debhelper from Build-Depends-Indep To Build-Depends, fixing Lintian error clean-should-be-satisfied-by-build-depends * Convert debian/copyright to UTF-8, fixing Lintian error debian-copyright-file-uses-obsolete-national-encoding -- Dominic Hargreaves Thu, 20 Aug 2015 22:12:19 +0200 apt-show-source (0.10) unstable; urgency=low * Update Spanish manpage. (closes: #218744) -- OHURA Makoto Sun, 2 Nov 2003 22:04:22 +0900 apt-show-source (0.09) unstable; urgency=low * Change maintainer's address. * Fix typo in apt-show-source. * Add Japanese manpage. * Automatically generate version number in apt-show-source from debian/changelog. -- OHURA Makoto Sat, 11 Oct 2003 23:56:44 +0900 apt-show-source (0.08) unstable; urgency=low * Don't install apt-show-source.fr.1.pod to /usr/share/perl5. * Update MANIFEST. * Include Spanish manpage. (closes: #197396) * Fix typo in French and Spanish manpages, which results from typo of original one. -- OHURA Makoto Mon, 16 Jun 2003 12:25:09 +0900 apt-show-source (0.07-4) unstable; urgency=low * Include POD French manpage instead of the generated one. (closes: #174934) * Fix typo in script documentation. (closes: #182389) * Fix typo in help message. * Add perl to Build-Depens-Indep. (closes: #174939) * Remove gererated manpages in cleaning process. -- OHURA Makoto Mon, 2 Jun 2003 13:47:00 +0900 apt-show-source (0.07-3) unstable; urgency=low * New Maintainer. * Update Standards-Version -- OHURA Makoto Wed, 28 May 2003 19:31:21 +0900 apt-show-source (0.07-2) unstable; urgency=low * included french manpage (CLoses: #166171) -- Dennis Schoen Mon, 28 Oct 2002 15:44:04 -0200 apt-show-source (0.07-1) unstable; urgency=low * fixed typo's in manpage (Closes: #165806) -- Dennis Schoen Tue, 22 Oct 2002 14:02:39 -0200 apt-show-source (0.06-4) unstable; urgency=low * fix lintian warnings: -changed Build-Depends: to Build-Depends-Indep: -updated Standards-Version -removed Dependency on dpkg -- Dennis Schoen Wed, 28 Aug 2002 13:32:30 +0200 apt-show-source (0.06-3) unstable; urgency=low * fixed typo (Closes: #133168) -- Dennis Schoen Mon, 18 Feb 2002 10:16:56 +0100 apt-show-source (0.06-2) unstable; urgency=low * fixed spelling errors (Closes: #124414) -- Dennis Schoen Tue, 18 Dec 2001 11:05:58 +0100 apt-show-source (0.06-1) unstable; urgency=low * New Release * Added new sort routine * Closes:Bug#92221 -- Dennis Schoen Wed, 4 Apr 2001 10:59:02 +0200 apt-show-source (0.05-1) unstable; urgency=low * New Release * Look at Changes file for actual changes. * Closes:Bug#70925 -- Dennis Schoen Wed, 4 Apr 2001 10:58:08 +0200 apt-show-source (0.04-1) unstable; urgency=low * New Release * Closes:Bug#88528 -- Dennis Schoen Thu, 8 Mar 2001 23:31:26 -0800 apt-show-source (0.03-1) unstable; urgency=low * New Release * Sat Sep 30 15:05:22 CEST 2000 Stefan Hornburg option --version-only added, POD typos and style somewhat fixed -- Dennis Schoen Fri, 20 Oct 2000 17:02:36 +0200 apt-show-source (0.02-1) unstable; urgency=low * New Release * Supports now --package= even if is not installed * fixed bug in parse_file() Packages with Status: installed configfiles get parsed correctly now. -- Dennis Schoen Fri, 20 Oct 2000 16:58:17 +0200 apt-show-source (0.01-1) unstable; urgency=low * Initial Release. -- Dennis Schoen Sat, 2 Sep 2000 17:49:07 +0200 apt-show-source-0.10+nmu4/debian/rules0000755000000000000000000000405312640046153014544 0ustar #!/usr/bin/make -f # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # This is the debhelper compatability version to use. #export DH_COMPAT=1 ifndef PERL PERL = /usr/bin/perl endif VERSION=`dpkg-parsechangelog | grep '^Version: ' | sed -e "s/^Version: //g"` #TMP =`pwd`/debian/tmp archlib =`$(PERL) -MConfig -e 'print $$Config{installarchlib}'` build: build-stamp build-stamp: dh_testdir # Add here commands to compile the package. sed -e "s/@VERSION@/${VERSION}/g" \ apt-show-source.in > apt-show-source $(PERL) Makefile.PL INSTALLDIRS=vendor $(MAKE) OPTIMIZE="-O2 -g -Wall" touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp # Add here commands to clean up after the build process. rm -f apt-show-source.1 apt-show-source.fr.1 \ apt-show-source.es.1 apt-show-source.ja.1 \ apt-show-source dh_clean -$(MAKE) distclean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Add here commands to install the package into debian/tmp. if grep ^install_vendor Makefile; then \ $(MAKE) install DESTDIR=$(PWD)/debian/apt-show-source; \ else \ $(MAKE) pure_install DESTDIR=$(PWD)/debian/apt-show-source; \ fi # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. # Build architecture-dependent files here. binary-arch: build install # dh_testversion dh_testdir dh_testroot # dh_installdebconf dh_installdocs TODO Changes # dh_installexamples # dh_installmenu # dh_installemacsen # dh_installpam # dh_installinit # dh_installcron dh_installman apt-show-source.1 apt-show-source.es.1 apt-show-source.fr.1 apt-show-source.ja.1 # dh_installinfo dh_installchangelogs # dh_link # dh_strip dh_compress dh_fixperms # You may want to make some executables suid here. # dh_suidregister # dh_makeshlibs dh_installdeb dh_perl # dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install apt-show-source-0.10+nmu4/debian/compat0000644000000000000000000000000212632631322014657 0ustar 9 apt-show-source-0.10+nmu4/debian/control0000644000000000000000000000113012632634354015067 0ustar Source: apt-show-source Section: admin Priority: optional Maintainer: OHURA Makoto Standards-Version: 3.9.6 Build-Depends-Indep: perl Build-Depends: debhelper (>=9) Package: apt-show-source Architecture: all Depends: ${misc:Depends}, ${perl:Depends}, apt Description: Shows source-package information This program parses the APT lists for source packages and the dpkg status file and then lists every package with a different version number than the one installed. It's very useful if your deb-src sources.list entries point to unstable and your deb entries point to stable. apt-show-source-0.10+nmu4/debian/copyright0000644000000000000000000000047012565432023015417 0ustar This package was debianized by Dennis Schoen on Wed, 30 Aug 2000 14:46:27 +0200. Upstream Author: Dennis Schön Copyright: It may be redistributed under the terms of the GNU GPL, Version 2 or later, found on Debian systems in the file /usr/share/common-licenses/GPL. apt-show-source-0.10+nmu4/apt-show-source.fr.1.pod0000644000000000000000000000342207673234424016564 0ustar =head1 NOM apt-show-source - Énumère les paquets-sources. =head1 DESCRIPTION Ce programme réalise une analyse syntaxique des listes de APT des paquets de source et du fichier d'état de DPKG et liste tous les paquets avec un numéro de version supérieur à celui installé. Il peut se montrer très utile si les entrées «EdebE» dans votre fichier sources.list de APT pointent vers la version stable et les entrées «Edeb-srcE» pointent vers l'instable. Avec ce programme, vous pouvez aisément savoir s'il y a une nouvelle version de par ex. programme XXXX dans l'instable. =head1 PARAMÈTRES EN LIGNE DE COMMANDE Les paramètres en ligne de commandes optionnels sont le fichier d'état de DPKG à utiliser, le chemin d'accès des fichiers listes de APT et le nom d'un paquet. Il y a aussi des options à montrerE: tous les paquets de sources, messages longs, version seule et l'aide de la ligne de commande. =head1 OPTIONS =head2 B<-stf> I, B<--status-file>=I Lit les paquets installés à partir de I à la place de /var/lib/dpkg/status. =head2 B<-ld> I, B<--list-dir>=I I spécifie le chemin d'accès aux fichiers listes de APT, /var/lib/apt/lists/ par défaut. =head2 B<-p> I, B<--package>=I Affiche les données de version du paquet installé/paquet de source pour I. =head2 B<--version-only> Affiche seulement la version si utilisée avec B<--package>. =head2 B<-a>, B<--all> Affiche tous les paquets sources disponibles avec la version. =head2 B<-v>, B<--verbose> Affiche de longs messages. =head2 B<-h>, B<--help> Affiche l'aide en ligne de commande. =head1 AUTEUR Dennis Schoen, dennis@debian.org =head1 VOIR AUSSI apt(1), dpkg(1) =head1 TRADUCTION Younes Zouhair apt-show-source-0.10+nmu4/Changes0000644000000000000000000000325207667072236013553 0ustar Revision history for apt-show-source. * Tue Jul 17 20:16:22 CEST 2001 Stefan Hornburg (Racke) Avoid Perl warnings if package exists, but no source package found. * Wed Apr 4 10:45:44 CEST 2001 Dennis Schön Added new sort routine. fixes bug #92221: report bug doesn't handle all version strings new version 0.06 released * Wed Mar 14 00:57:18 EST 2001 Dennis Schön fixed bug #70925: apt-show-source: Doesn't look for the latest source package If we have more than one source-version of a programm we now correctly use the highest one. Now prints out only packages with _higher_ source-version numbers. Note that until 0.04 we display everything with _different_ source-version numbers. new version 0.05 released * Thu Mar 8 23:29:08 PST 2001 Dennis Schön fixed bug #88528: apt-show-source's default lists path not correct Added error message when no sources lists are found. new version 0.04 released * Fri Oct 20 17:01:02 CEST 2000 Dennis Schön apt-show-source v0.03 released * Sat Sep 30 15:05:22 CEST 2000 Stefan Hornburg option --version-only added, POD typos and style somewhat fixed * Wed Aug 30 14:42:00 CEST 2000 Dennis Schoen apt-show-source v0.01 released * Sat Sep 2 17:17:54 CEST 2000 Dennis Schoen fixed bug in parse_file() where correct status was not parsed. * Sat Sep 2 17:17:54 CEST 2000 Dennis Schoen added method print_package * Sat Sep 2 17:17:54 CEST 2000 Dennis Schoen added support for printing out source-package Information with -p even if package is not installed. apt-show-source-0.10+nmu4/copyright.new0000644000000000000000000000000012565432020014747 0ustar apt-show-source-0.10+nmu4/apt-show-source.ja.1.pod0000644000000000000000000000315007742016550016540 0ustar =head1 ̾Á° apt-show-source - ¥½¡¼¥¹¥Ñ¥Ã¥±¡¼¥¸¤Î¥ê¥¹¥È¤ò½ÐÎϤ¹¤ë =head1 ÀâÌÀ ¤³¤Î¥×¥í¥°¥é¥à¤Ï¥½¡¼¥¹¥Ñ¥Ã¥±¡¼¥¸¤Ë´Ø¤¹¤ë APT ¤Î¥ê¥¹¥È¤È dpkg ¤Î¾õ¶·¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¹þ¤ß¡¢ ¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤è¤ê¤âÂ礭¤¤¥Ð¡¼¥¸¥ç¥ó¤¬¤¢¤ë¤¹¤Ù¤Æ¤Î¥Ñ¥Ã¥±¡¼¥¸¤ò ɽ¼¨¤·¤Þ¤¹¡£ APT ¤Î sources.list ¤Î "deb" ¤Î¹àÌܤ¬ stable ¤ò»Ø¤·¤Æ¤¤¤Æ "deb-src" ¤Î¹àÌܤ¬ unstable ¤ò»Ø¤·¤Æ¤¤¤ë¾ì¹ç¡¢¤³¤ì¤Ï¤È¤Æ¤âÍ­ÍѤǤ·¤ç¤¦¡£ unstable ¤ËÎ㤨¤Ð¥×¥í¥°¥é¥à XXXX ¤Î¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤¬¤¢¤ë¾ì¹ç¡¢ ¤³¤Î¥×¥í¥°¥é¥à¤ò»È¤¦¤È¤½¤ì¤ò´Êñ¤Ë¸«ÉÕ¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ =head1 ¥³¥Þ¥ó¥É¥é¥¤¥ó ¾Êά²Äǽ¤Ê°ú¿ô¤È¤·¤Æ¡¢»ÈÍѤ¹¤ë DPKG ¤Î¾õ¶·¥Õ¥¡¥¤¥ë¡¢APT ¤Î°ìÍ÷¤Î¥Õ¥¡¥¤¥ë¤ä ¥Ñ¥Ã¥±¡¼¥¸¤Î̾Á°¤ò»ØÄê¤Ç¤­¤Þ¤¹¡£ ¤Þ¤¿¡¢É½¼¨¤Î¤¿¤á¤Î¥ª¥×¥·¥ç¥ó¤â¤¢¤ê¤Þ¤¹¡£ ¤¹¤Ù¤Æ¤Î¥½¡¼¥¹¥Ñ¥Ã¥±¡¼¥¸¤Îɽ¼¨¡¢¾éŤÊɽ¼¨¡¢¥Ð¡¼¥¸¥ç¥ó¤Îɽ¼¨¡¢ ¥³¥Þ¥ó¥É¥é¥¤¥ó¤Î¥Ø¥ë¥×¤Îɽ¼¨¤Ê¤É¤Ç¤¹¡£ =head1 °ú¿ô =head2 B<-stf> I, B<--status-file>=I /var/lib/dpkg/status ¤Î Âå¤ï¤ê¤Ë I ¤«¤é¥¤¥ó¥¹¥È¡¼¥ëºÑ¤ß¤Î¥Ñ¥Ã¥±¡¼¥¸¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ =head2 B<-ld> I, B<--list-dir>=I I ¤Ç APT ¤Î°ìÍ÷¤Î¥Õ¥¡¥¤¥ë¤Î PATH ¤ò»ØÄꤹ¤ë¡£ ɸ½à¤Ç¤Ï /var/lib/apt/lists/ ¤ò»È¤¤¤Þ¤¹¡£ =head2 B<-p> I, B<--package>=I I ¤Ë´Ø¤¹¤ë¥¤¥ó¥¹¥È¡¼¥ëºÑ¤ß¤Î¥Ñ¥Ã¥±¡¼¥¸¤È¥½¡¼¥¹¥Ñ¥Ã¥±¡¼¥¸¤Î ¥Ð¡¼¥¸¥ç¥ó¤Î¾ðÊó¤ò½ÐÎϤ·¤Þ¤¹¡£ =head2 B<--version-only> B<--package> ¤È°ì½ï¤Ë»È¤¦¤È¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤À¤±¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ =head2 B<-a>, B<--all> ¤¹¤Ù¤Æ¤ÎÍøÍѲÄǽ¤Ê¥½¡¼¥¹¥Ñ¥Ã¥±¡¼¥¸¤ò¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤È°ì½ï¤Ëɽ¼¨¤·¤Þ¤¹¡£ =head2 B<-v>, B<--verbose> ¾éĹ¤Ê¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Þ¤¹¡£ =head2 B<-h>, B<--help> ¥³¥Þ¥ó¥É¥é¥¤¥ó¥Ø¥ë¥×¤òɽ¼¨¤·¤Þ¤¹¡£ =head1 ºî¼Ô Dennis Schoen, dennis@debian.org =head1 ´ØÏ¢¹àÌÜ apt(1), dpkg(1) =cut apt-show-source-0.10+nmu4/apt-show-source.es.1.pod0000644000000000000000000000377607751201427016572 0ustar # (c) 2003 Software in the Public Interest # Esta traducción ha sido realizada por Rubén Porras Campo # Está basada en la página de manual original: # versión 1.3 del CVS de # /cvs/debian-doc/manpages/english/apt-show-source/apt-show-source.1.pod =head1 NOMBRE apt-show-source - Lista paquetes fuente. =head1 DESCRIPCIÓN Este programa analiza las listas de paquetes fuente de APT y el fichero de estado de dpkg y muestra todos los paquetes con un número de versión mayor que el número de versión del paquete instalado. Puede revelarse muy útil si las entradas "deb" del sources.list de APT apuntan a la distribución estable, y las entradas "deb-src" apuntan a la inestable. Con este programa puede fácilmente encontrar si hay una nueva versión del programa XXXX en inestable. =head1 PARÁMETROS DE LÍNEA DE ÓRDENES Los parámetros opcionales de la línea de órdenes son el fichero de estado de DPKG a usar, la ruta a los ficheros de listas de APT y el nombre del paquete. También hay opciones que permiten mostrar: todos los paquetes fuente, mensajes detallados, sólo las versiones, y la ayuda en línea de órdenes. =head1 OPCIONES =head2 B<-stf> I, B<--status-file>=I Lee los paquetes instalados de I en vez de /var/lib/dpkg/status. =head2 B<-ld> I, B<--list-dir>=I I especifica la ruta a los fichero de listas de APT, por omisión es /var/lib/apt/lists/. =head2 B<-p> I, B<--package>=I Muestra la versión del paquete_instalado/paquete_fuente para I. =head2 B<--version-only> Muestra la versión sólo si se usa junto con B<--package>. =head2 B<-a>, B<--all> Muestra todos los paquetes fuente disponibles junto con su versión. =head2 B<-v>, B<--verbose> Muestra mensajes detallados. =head2 B<-h>, B<--help> Muestra la ayuda en línea de órdenes. =head1 AUTOR Dennis Schoen, dennis@debian.org =head1 VÉASE ADEMÁS apt(1), dpkg(1) =head1 TRADUCTOR Traducción de Rubén Porras Campo apt-show-source-0.10+nmu4/Makefile.PL0000644000000000000000000000123707742003704014217 0ustar use ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. # List here scripts that should be installed my @scripts = ("./apt-show-source"); WriteMakefile( 'NAME' => 'apt-show-source', 'VERSION_FROM' => './apt-show-source', 'MAN1PODS' => { './apt-show-source' => './apt-show-source.1' , './apt-show-source.fr.1.pod' => './apt-show-source.fr.1' , './apt-show-source.es.1.pod' => './apt-show-source.es.1' , './apt-show-source.ja.1.pod' => './apt-show-source.ja.1' }, 'MAN3PODS' => { }, 'PM' => { }, 'EXE_FILES' => \@scripts ); apt-show-source-0.10+nmu4/MANIFEST0000644000000000000000000000032307742015320013366 0ustar apt-show-source.in apt-show-source.es.1.pod apt-show-source.fr.1.pod apt-show-source.ja.1.pod Changes debian/changelog debian/control debian/copyright debian/rules Makefile.PL MANIFEST This list of files TODO apt-show-source-0.10+nmu4/apt-show-source.in0000644000000000000000000002243307742016550015641 0ustar #! /usr/bin/perl -w # apt-show-source - Lists source-packages. # This program parses the APT lists for source packages and the dpkg # status file and then lists every package with an different version # number than the installed. # Copyright (C) 2000 Dennis Schoen # Author: Dennis Schoen # Maintainer: Dennis Schoen # Version: @VERSION@ # This file 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 2, or (at your option) any # later version. # This file 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 file; see the file COPYING. If not, write to the Free # Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. use strict; use Getopt::Long; my $VERSION; $VERSION='@VERSION@'; # process command line parameters my %opts; unless (GetOptions (\%opts,'status-file|stf=s','list-dir|ld=s', 'package|p=s','help|h','all|a','verbose|v', 'version-only')) { exit 1; } if (exists $opts{'help'}) { print < Use as the dpkg status file instead of /var/lib/dpkg/status -ld|list-dir= Use as path to apt's list files instead of /var/lib/apt/lists/ -p|--package= Print source version for . --version-only Prints version only if used together with --package. -a|--all Print out all available source packages. -v|--verbose Verbose messages. -h|--help Print this help. EOF exit; } # Path to apt's list files my $list_dir; if ($opts{'list-dir'}) { $list_dir = $opts{'list-dir'}; } # New APT 5.0 path elsif (-d "/var/lib/apt/lists/") { $list_dir = "/var/lib/apt/lists/"; } # Old APT path elsif (-d "/var/state/apt/lists/") { $list_dir = "/var/state/apt/lists/"; } else {die "Can't find a valid lists directory\n"} # Path to dpkg status file my $status_file = $opts{'status-file'} || "/var/lib/dpkg/status"; opendir(DIR, $list_dir) or die "Can't opendir $list_dir: $!"; my @files = map { $list_dir . $_} grep /Sources$/, readdir(DIR); unless (scalar @files > 0) {die "Error: No information about source packages! (Maybe no deb-src entries?)\n"}; closedir DIR ; # This is the hash ref that stores our Sources Package information my $source_packages; # This is the hash ref that stores our _installed_ Package information my $packages = parse_file ($status_file, 1); foreach (@files) { my $href = &parse_file ($_); foreach (keys %$href) { $source_packages->{$_} = $href->{$_}; } } if (exists $opts{'package'}) { my $key = $opts{'package'}; my $skey = $packages->{$key}->{'Source'} || $key; unless ($packages->{$key}->{'Package'} || $packages->{$key}->{'Version'} || $source_packages->{$skey}->{'Package'} || $source_packages->{$skey}->{'Version'}) { print "Can't find information about $opts{'package'} !\n"; exit 1; } unless (cmp_version(($packages->{$key}->{'Version'} || 0),($source_packages->{$skey}->{'Version'} || 0))) { print "Sorry, no newer source package available for $opts{'package'}\n"; exit 1; } my $package = $packages->{$key}->{'Package'} || "not installed."; my $version = $packages->{$key}->{'Version'} || "not available."; my $spackage = $source_packages->{$skey}->{'Package'} || "not available."; my $sversion = $source_packages->{$skey}->{'Version'} || "not available."; if ($opts{'version-only'}) { print "$sversion\n"; } else { print_package ($package, $version, $spackage, $sversion); } exit; } if (exists $opts{'all'}) { foreach my $key (keys %$source_packages) { my $skey = $packages->{$key}->{'Source'} || $key; my $package = $packages->{$key}->{'Package'} || "not installed."; my $version = $packages->{$key}->{'Version'} || "not available."; my $spackage = $source_packages->{$skey}->{'Package'}; my $sversion = $source_packages->{$skey}->{'Version'}; print_package ($package, $version, $spackage, $sversion); } exit; } foreach my $key (keys %$packages) { my $skey = $packages->{$key}->{'Source'} || $key; my $package = $packages->{$key}->{'Package'}; my $version = $packages->{$key}->{'Version'}; my $sversion = $source_packages->{$skey}->{'Version'} || "not available."; my $spackage = $source_packages->{$skey}->{'Package'} || "not available."; if (cmp_version($sversion,($version || 0))) { print_package ($package, $version, $spackage, $sversion); } } format STDOUT_TOP = Inst. Package (Version) | Newest Source Package (Version) ------------------------------------------------------------------------------- . sub print_package { my ($package, $version, $spackage, $sversion) = @_; my $left = $package . " (" . $version . ")"; my $right = $spackage . " (" . $sversion . ")"; format STDOUT = @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $left, $right . write; } #------------------------------------------------------- # FUNCTION: cmp_version (STRING, STRING) # # Compares complete version numbers ala upstream-debian # and returns true if the first version string is greater # than the second. #-------------------------------------------------------- sub cmp_version { my ($first, $last) = @_; return 0 if ($first eq $last); my ($firstup, $firstdeb) = split /-/, $first; my ($lastup, $lastdeb) = split /-/, $last; my @upstream = ($firstup,$lastup); my @debian = ($firstdeb,$lastdeb); my @index = sort { $upstream[$a] cmp $upstream[$b] or $debian[$a] cmp $debian[$b] } 0 .. $#upstream; if ($debian[0]) { if ("$upstream[0]-$debian[0]" eq $first) { return 1; } else { return 0; } } else { if ($upstream[0] eq $first) { return 1; } else { return 0; } } } # ------------------------------------------------------ # FUNCTION: HASHREF = parse_file FILE (STATUS) # # Parses FILE into an HASHREF of Hashes # Set STATUS when the file should be parsed just for # installed packages (here the dpkg status file) # Returns HASHREF. # ------------------------------------------------------ sub parse_file { my ($file, $status) = @_; my ($key, $value, $package, $packages); open FILE, $file or die "Can't open file $file: $!"; if ($opts{'verbose'}) {print "Parsing $file...";}; while () { if (/^$/){ unless (defined $package) {next}; if (defined $source_packages->{$package->{'Package'}}) { if ($source_packages->{$package->{'Package'}}->{'Version'} gt $package->{'Version'}) { undef $package; next; } } elsif (defined $packages->{$package->{'Package'}}) { if ($packages->{$package->{'Package'}}->{'Version'} gt $package->{'Version'}) { undef $package; next; } } if ($status) { # Are we parsing the status file? unless ($package->{'Status'} =~ /not-installed/ || $package->{'Status'} =~ /config-files/) { $packages->{ $package->{'Package'}} = $package; } } else { $packages->{$package->{'Package'}} = $package; } undef $package; next; } unless ((/^Package/) || (/^Version/) || (/^Status/) || (/^Source/)) {next}; ($key, $value) = split /: /, $_; $value =~ s/\n//; $value =~ s/\s\(.*\)$//; # Remove any Version information in () $package->{$key} = $value; } if ($opts{'verbose'}) {print " completed.\n"}; close FILE; return $packages; } # script documentation (POD style) =head1 NAME apt-show-source - Lists source-packages. =head1 DESCRIPTION This program parses the APT lists for source packages and the dpkg status file and then lists every package with a higher version number than the one installed. It may prove very useful if the "deb" entries in your APT sources.list point to stable and the "deb-src" entries point to unstable. With this program you are easily able to find out if there is a newer version of eg. Program XXXX in unstable. =head1 COMMAND LINE PARAMETERS Optional command line parameters are the DPKG Status file to use, the path to APT's list files and a package name. There are also options to display: all source-packages, verbose messages, version-only and command-line help. =head1 OPTIONS =head2 B<-stf> I, B<--status-file>=I Reads installed packages from I instead of /var/lib/dpkg/status. =head2 B<-ld> I, B<--list-dir>=I I specifies the path to APT's list files, defaults to /var/lib/apt/lists/. =head2 B<-p> I, B<--package>=I Prints out the installed-package/source-package version Information for I. =head2 B<--version-only> Prints version only if used together with B<--package>. =head2 B<-a>, B<--all> Prints out all available source-packages with version. =head2 B<-v>, B<--verbose> Prints out verbose messages. =head2 B<-h>, B<--help> Prints out command-line help. =head1 AUTHOR Dennis Schoen, dennis@debian.org =head1 SEE ALSO apt(1), dpkg(1) =cut