Hello community, here is the log from the commit of package rpmorphan for openSUSE:Factory checked in at 2012-10-07 20:00:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rpmorphan (Old) and /work/SRC/openSUSE:Factory/.rpmorphan.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rpmorphan", Maintainer is "" Changes: -------- --- /work/SRC/openSUSE:Factory/rpmorphan/rpmorphan.changes 2011-09-23 12:44:42.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.rpmorphan.new/rpmorphan.changes 2012-10-07 20:00:19.000000000 +0200 @@ -1,0 +2,9 @@ +Sat Oct 6 18:22:10 UTC 2012 - asterios.dra...@gmail.com + +- Updated to 1.11: + * add suggests option + * add /etc/rpmorphanrc + * fix bug with space in filenames + * add env RPMORPHAN_METHOD for debugging + +------------------------------------------------------------------- Old: ---- rpmorphan-1.10.tar.gz New: ---- rpmorphan-1.11.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rpmorphan.spec ++++++ --- /var/tmp/diff_new_pack.HsERO3/_old 2012-10-07 20:00:20.000000000 +0200 +++ /var/tmp/diff_new_pack.HsERO3/_new 2012-10-07 20:00:20.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package rpmorphan # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,24 +16,21 @@ # - Name: rpmorphan -Version: 1.10 -Release: 1 +Version: 1.11 +Release: 0 Summary: List the orphaned RPM packages - License: GPL-2.0+ -Url: http://rpmorphan.sourceforge.net/ Group: System/Packages +Url: http://rpmorphan.sourceforge.net/ Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-build - Requires: rpm Recommends: logrotate Recommends: perl-Curses-UI Recommends: perl-RPM2 Recommends: perl-Tk BuildArch: noarch +BuildRoot: %{_tmppath}/%{name}-%{version}-build %description Finds "orphaned" packages on your system. It determines which packages @@ -49,13 +46,11 @@ %install make install DESTDIR=%{buildroot} DOCDIR=%{buildroot}%{_defaultdocdir}/%{name} TARGET_LOCALE=%{buildroot}%{_libexecdir}/%{name}/locale -%clean -rm -rf %{buildroot} - %files %defattr(-,root,root,-) -%doc Authors COPYING Changelog NEWS Readme Readme.fr Todo rpmorphan.lsm rpmorphanrc.sample +%doc Authors COPYING Changelog NEWS Readme Readme.fr Todo rpmorphan.lsm %config(noreplace) %{_sysconfdir}/logrotate.d/rpmorphan +%config(noreplace) %{_sysconfdir}/rpmorphanrc %{_bindir}/grpmorphan %{_bindir}/rpmdep %{_bindir}/rpmdep.pl ++++++ rpmorphan-1.10.tar.gz -> rpmorphan-1.11.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmorphan-1.10/Changelog new/rpmorphan-1.11/Changelog --- old/rpmorphan-1.10/Changelog 2011-07-08 14:04:41.000000000 +0200 +++ new/rpmorphan-1.11/Changelog 2012-08-01 20:27:01.000000000 +0200 @@ -1,3 +1,9 @@ +2012-08-03 Eric Gerbier <gerb...@users.sourceforge.net> 1.11 + * add suggests option + * add /etc/rpmorphanrc + * fix bug with space in filenames + * add env RPMORPHAN_METHOD for debugging + 2011-07-08 Eric Gerbier <gerb...@users.sourceforge.net> 1.10 * bugfix eval for Curses (mandriva) * fix bad version display diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmorphan-1.10/Makefile new/rpmorphan-1.11/Makefile --- old/rpmorphan-1.10/Makefile 2011-03-21 13:41:01.000000000 +0100 +++ new/rpmorphan-1.11/Makefile 2012-08-01 20:47:47.000000000 +0200 @@ -1,7 +1,4 @@ -# makefile for rpmorphan -# is used to build rpm package -# or for tar.gz install (not recommended) -# $Id: Makefile 276 2011-03-21 11:59:45Z gerbier $ +# $Id: rpmorphan-1.11 | Makefile | Wed Aug 1 14:09:35 2012 +0200 | Eric Gerbier $ # recommanded by debian install guide DESTDIR= @@ -11,10 +8,12 @@ VERSION=$(shell grep Version rpmorphan.lsm | awk '{print $$2}') BINDIR = $(DESTDIR)/usr/bin -LOGROT = $(DESTDIR)/etc/logrotate.d/ +LOGETC = $(DESTDIR)/etc/ +LOGROT = $(LOGETC)/logrotate.d/ MANDIR = $(DESTDIR)/usr/share/man MAN1DIR = $(MANDIR)/man1 -# on some distribution it is $(PACKAGE) (mandriva) on other $(PACKAGE)-$(VERSION) (fedora) +# on some distribution it is $(PACKAGE)-$(VERSION) (fedora), on others $(PACKAGE) (mandriva) +# we force it with a define in rpm target to be able to build on any host the same way DOCDIR=$(DESTDIR)/usr/share/doc/$(PACKAGE)-$(VERSION) # for keep file DATADIR=$(DESTDIR)/var/lib/rpmorphan @@ -38,6 +37,9 @@ HTMLPAGES := $(addsuffix .1.html, $(PROGS)) SCRIPTS := $(addsuffix .pl, $(PROGS) $(LIB) ) +# file with keyword +KEYWORD_FILES = $(SCRIPTS) Makefile Readme Readme.fr rpmorphanrc.sample + # translations LANGS := en fr_FR LOCALE_BASE := rpmorphan_trans.pl @@ -55,7 +57,7 @@ define check_perl_script for fic in $(SCRIPTS);do \ perl -cw $$fic || exit; \ - perlcritic --verbose 10 -1 $$fic || exit; \ + perlcritic --verbose 10 -3 $$fic || exit; \ done; endef @@ -79,25 +81,23 @@ help : @echo "available target are :" @echo "make all : same as make install" + @echo "make help : this help" + @echo "make install : install software" + @echo "make installdoc : install software documentation" + @echo "make uninstall : remove software" + @echo "make uninstalldoc : remove software documentation" + @echo "### for project packagers only ###########" + @echo "make alldist : build all packages" @echo "make check : check perl syntaxe" @echo "make clean : remove temporary files" @echo "make dist : build a tar.gz package" - @echo "make help : this help" @echo "make html : build html doc from pod" - @echo "make install : install software" - @echo "make installdoc : install software documentation" @echo "make man : build man page from pod" @echo "make rpm : build an rpm package" - @echo "make uninstall : remove software" - @echo "make uninstalldoc : remove software documentation" - -check : $(SCRIPTS) - $(check_perl_script) - -man : $(MANPAGES1) all: install +# install perl scripts install : $(DOC) $(MANPAGES1) $(SCRIPTS) mkdir -p $(BINDIR) install -m 755 $(SCRIPTS) $(BINDIR) @@ -114,9 +114,9 @@ chmod 640 $(LOGDIR)/${LOGFILE} mkdir -p $(LOGROT) install -m 644 ${CONF} $(LOGROT)/rpmorphan + install -m 644 rpmorphanrc.sample $(LOGETC)/rpmorphanrc -# doc install is not in install target as it is not necessary -# for rpm packages +# install doc installdoc : $(DOC) mkdir -p $(DOCDIR) install -m 644 ${DOC} $(DOCDIR) @@ -126,26 +126,53 @@ cd $(MAN1DIR) && rm ${MANPAGES1} rm -rf $(DATADIR) rm -f $(LOGROT)/rpmorphan + rm -f $(LOGETC)/rpmorphanrc uninstalldoc : rm -rf $(DOCDIR) -dist : $(DOC) $(MANPAGES1) $(SCRIPTS) +################################################################################ +# targets for project packagers +################################################################################ + +# build all packages +alldist : check dist rpm html + +# check perl script syntax +check : $(SCRIPTS) + $(check_perl_script) + +# build man pages +man : $(MANPAGES1) + +# build tar.gz package +dist : $(DOC) man $(SCRIPTS) expand mkdir $(PACKAGE)-$(VERSION) cp -a ${CONF} $(DATA) locale $(DOC) $(MANPAGES1) $(SCRIPTS) $(PACKAGE)-$(VERSION) tar cvfz $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION) rm -rf $(PACKAGE)-$(VERSION) ~/bin/gensign.sh $(PACKAGE)-$(VERSION).tar.gz +# build rpm package rpm : dist - rpmbuild -ta --sign $(PACKAGE)-$(VERSION).tar.gz - -clean : + rpmbuild -ta --sign --define '_docdir_fmt %%{NAME}-%%{VERSION}' $(PACKAGE)-$(VERSION).tar.gz + +# clean temp files +clean : unexpand rm -f $(MANPAGES1) - rm -f $(PACKAGE)-$(VERSION).tar.gz + rm -f $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION).tar.gz.sig rm -f pod2* rm -f *.html -# to be done on root account juster after the package install - +# build man page in html for web site html : $(HTMLPAGES) + mv *.html ../web + +# expand svn keywords just for publish +expand: $(KEYWORD_FILES) + git tag -f "$(PACKAGE)-$(VERSION)" + git-svn-keyword-expand $(KEYWORD_FILES) + +# remove svn keywords to keep repository clean +unexpand: $(KEYWORD_FILES) + git-svn-keyword-unexpand $(KEYWORD_FILES) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmorphan-1.10/NEWS new/rpmorphan-1.11/NEWS --- old/rpmorphan-1.10/NEWS 2011-03-21 12:55:17.000000000 +0100 +++ new/rpmorphan-1.11/NEWS 2012-08-01 20:27:01.000000000 +0200 @@ -1,3 +1,29 @@ + 1.11 version + ------------- +new features : +* add suggests option +* add /etc/rpmorphanrc +* add env RPMORPHAN_METHOD for debugging + +bugfix : +* fix bug with space in filenames +------------------------------------------------------------------------------- + 1.10 version + ------------- +new features : +* display package summary in a popup on S key + +bugfix : +* bugfix eval for Curses (mandriva) +* fix bad version display + +improvment : +* reduce size/duplicated code in rpmorphan/rpmusage +* reduce menu length in curses gui (< 72) + +others : +* clean all scripts +------------------------------------------------------------------------------- 1.9 version ------------- new features : diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmorphan-1.10/Readme new/rpmorphan-1.11/Readme --- old/rpmorphan-1.10/Readme 2011-03-21 13:41:01.000000000 +0100 +++ new/rpmorphan-1.11/Readme 2012-08-01 20:47:47.000000000 +0200 @@ -42,4 +42,4 @@ -- Eric Gerbier -$Id: Readme 279 2011-03-21 12:08:17Z gerbier $ +$Id: rpmorphan-1.11 | Readme | Mon Mar 21 12:08:17 2011 +0000 | gerbier $ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmorphan-1.10/Readme.fr new/rpmorphan-1.11/Readme.fr --- old/rpmorphan-1.10/Readme.fr 2011-03-21 13:41:01.000000000 +0100 +++ new/rpmorphan-1.11/Readme.fr 2012-08-01 20:47:47.000000000 +0200 @@ -37,4 +37,4 @@ -- Eric Gerbier -$Id: Readme.fr 279 2011-03-21 12:08:17Z gerbier $ +$Id: rpmorphan-1.11 | Readme.fr | Mon Mar 21 12:08:17 2011 +0000 | gerbier $ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmorphan-1.10/rpmdep.1 new/rpmorphan-1.11/rpmdep.1 --- old/rpmorphan-1.10/rpmdep.1 2011-07-08 14:05:59.000000000 +0200 +++ new/rpmorphan-1.11/rpmdep.1 2012-08-01 20:47:47.000000000 +0200 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "RPMDEP 1" -.TH RPMDEP 1 "2011-07-08" "perl v5.12.3" "User Contributed Perl Documentation" +.TH RPMDEP 1 "2012-08-01" "perl v5.14.2" "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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmorphan-1.10/rpmdep.pl new/rpmorphan-1.11/rpmdep.pl --- old/rpmorphan-1.10/rpmdep.pl 2011-07-08 14:04:41.000000000 +0200 +++ new/rpmorphan-1.11/rpmdep.pl 2012-08-01 20:47:47.000000000 +0200 @@ -4,7 +4,7 @@ # # Copyright (C) 2006 by Eric Gerbier # Bug reports to: gerb...@users.sourceforge.net -# $Id: rpmdep.pl 290 2011-07-04 12:46:50Z gerbier $ +# $Id: rpmorphan-1.11 | rpmdep.pl | Mon Jul 4 12:46:50 2011 +0000 | gerbier $ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmorphan-1.10/rpmduplicates.1 new/rpmorphan-1.11/rpmduplicates.1 --- old/rpmorphan-1.10/rpmduplicates.1 2011-07-08 14:05:59.000000000 +0200 +++ new/rpmorphan-1.11/rpmduplicates.1 2012-08-01 20:47:47.000000000 +0200 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "RPMDUPLICATES 1" -.TH RPMDUPLICATES 1 "2011-07-08" "perl v5.12.3" "User Contributed Perl Documentation" +.TH RPMDUPLICATES 1 "2012-08-01" "perl v5.14.2" "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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmorphan-1.10/rpmduplicates.pl new/rpmorphan-1.11/rpmduplicates.pl --- old/rpmorphan-1.10/rpmduplicates.pl 2011-07-08 14:04:41.000000000 +0200 +++ new/rpmorphan-1.11/rpmduplicates.pl 2012-08-01 20:47:47.000000000 +0200 @@ -3,7 +3,7 @@ # # Copyright (C) 2006 by Eric Gerbier # Bug reports to: gerb...@users.sourceforge.net -# $Id: rpmduplicates.pl 291 2011-07-04 12:47:55Z gerbier $ +# $Id: rpmorphan-1.11 | rpmduplicates.pl | Mon Jul 4 12:47:55 2011 +0000 | gerbier $ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmorphan-1.10/rpmextra.1 new/rpmorphan-1.11/rpmextra.1 --- old/rpmorphan-1.10/rpmextra.1 2011-07-08 14:05:59.000000000 +0200 +++ new/rpmorphan-1.11/rpmextra.1 2012-08-01 20:47:47.000000000 +0200 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "RPMEXTRA 1" -.TH RPMEXTRA 1 "2011-07-08" "perl v5.12.3" "User Contributed Perl Documentation" +.TH RPMEXTRA 1 "2012-08-01" "perl v5.14.2" "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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmorphan-1.10/rpmextra.pl new/rpmorphan-1.11/rpmextra.pl --- old/rpmorphan-1.10/rpmextra.pl 2011-07-08 14:04:41.000000000 +0200 +++ new/rpmorphan-1.11/rpmextra.pl 2012-08-01 20:47:47.000000000 +0200 @@ -4,7 +4,7 @@ # # Copyright (C) 2006 by Eric Gerbier # Bug reports to: gerb...@users.sourceforge.net -# $Id: rpmextra.pl 292 2011-07-04 12:49:43Z gerbier $ +# $Id: rpmorphan-1.11 | rpmextra.pl | Mon Jul 4 12:49:43 2011 +0000 | gerbier $ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmorphan-1.10/rpmorphan-curses-lib.pl new/rpmorphan-1.11/rpmorphan-curses-lib.pl --- old/rpmorphan-1.10/rpmorphan-curses-lib.pl 2011-07-08 14:04:41.000000000 +0200 +++ new/rpmorphan-1.11/rpmorphan-curses-lib.pl 2012-08-01 20:47:47.000000000 +0200 @@ -4,7 +4,7 @@ # # Copyright (C) 2006 by Eric Gerbier # Bug reports to: gerb...@users.sourceforge.net -# $Id: rpmorphan-curses-lib.pl 312 2011-07-06 13:59:20Z gerbier $ +# $Id: rpmorphan-1.11 | rpmorphan-curses-lib.pl | Wed Jul 6 13:59:20 2011 +0000 | gerbier $ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmorphan-1.10/rpmorphan-lib.pl new/rpmorphan-1.11/rpmorphan-lib.pl --- old/rpmorphan-1.10/rpmorphan-lib.pl 2011-07-08 14:04:41.000000000 +0200 +++ new/rpmorphan-1.11/rpmorphan-lib.pl 2012-08-01 20:47:47.000000000 +0200 @@ -4,7 +4,7 @@ # # Copyright (C) 2006 by Eric Gerbier # Bug reports to: gerb...@users.sourceforge.net -# $Id: rpmorphan-lib.pl 310 2011-07-05 13:59:50Z gerbier $ +# $Id: rpmorphan-1.11 | rpmorphan-lib.pl | Wed Aug 1 09:36:43 2012 +0200 | Eric Gerbier $ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -93,6 +93,12 @@ return ${$r_value}; } ######################################################### +sub is_verbose($) { + my $rh_opt = shift @_; # hash of program arguments + + return is_set( $rh_opt, 'verbose' ); +} +######################################################### # apply a filter on package list according program options sub rpmfilter($$) { my $rh_opt = shift @_; @@ -196,13 +202,15 @@ # the main idea is to reduce the number of call to rpm in order to gain time # the ';' separator is used to separate fields - # the ' ' separator is used to separate data in fields arrays + # the ',' separator is used to separate data in fields arrays + + # note : we do not ask for PROVIDEFLAGS PROVIDEVERSION + # REQUIREFLAGS REQUIREVERSION + + my $suggests = ( is_set( $rh_opt, 'suggests' ) ) ? '[%{SUGGESTS},]' : q{}; -# note : we do not ask for PROVIDEFLAGS PROVIDEVERSION REQUIREFLAGS REQUIREVERSION - ## no critic ( RequireInterpolationOfMetachars ); my $rpm_cmd = -'rpm -qa --queryformat "%{NAME};[%{REQUIRENAME} ];[%{PROVIDES} ];[%{FILENAMES} ];%{INSTALLTIME}\n" '; - ## use critic; +"rpm -qa --queryformat '%{NAME};[%{REQUIRENAME},]$suggests;[%{PROVIDES},];[%{FILENAMES},];%{INSTALLTIME}\n' 2>/dev/null"; my $cache_file = '/tmp/rpmorphan.cache'; my $fh_cache; my $cmd; @@ -247,10 +255,10 @@ ######################################################### ## no critic (ProhibitManyArgs) sub analyse_rpm_info($$$$$$$$$$) { - my $name = shift @_; - my $ra_prov = shift @_; - my $ra_req = shift @_; - my $ra_files = shift @_; + my $name = shift @_; # current package name + my $ra_prov = shift @_; # data from database on name + my $ra_req = shift @_; # idem + my $ra_files = shift @_; # idem my $rh_objects = shift @_; my $rh_provides = shift @_; my $rh_files = shift @_; @@ -258,6 +266,8 @@ my $rh_virtual = shift @_; my $rh_requires = shift @_; + ## use critic; + # we do not use version in keys # so we only keep the last seen data for a package name if ( exists $rh_provides->{$name} ) { @@ -265,7 +275,6 @@ } VIRTUAL: foreach my $p ( @{$ra_prov}, @{$ra_files} ) { - ## use critic; # do not add files #next VIRTUAL if ( $p =~ m!^/! ); @@ -343,6 +352,7 @@ my $rh_virtual = shift @_; my $rh_requires = shift @_; + display_status('read rpm data using base RPM'); my ( $cmd, $fh_cache ) = init_cache($rh_opt); # because we can open a pipe or a cache, it is not possible to use @@ -367,10 +377,11 @@ # install time are necessary for install-time option $rh_install_time->{$name} = $install_time; - my $space = q{ }; - my @prov = split /$space/, $prov; - my @req = split /$space/, $req; - my @files = split /$space/, $files; + # see rpm query format in init_cache + my $delim = q{,}; + my @prov = split /$delim/, $prov; + my @req = split /$delim/, $req; + my @files = split /$delim/, $files; analyse_rpm_info( $name, \@prov, \@req, \@files, @@ -404,9 +415,12 @@ # and init_cache works with a command to exec # not with a perl module + display_status('read rpm data using RPM2'); + import RPM2; my $db = RPM2->open_rpm_db(); - display_status('read rpm data using RPM2'); + my $flag_suggests = is_set( $rh_opt, 'suggests' ); + debug('1 : analysis'); my %objects; @@ -421,6 +435,13 @@ my @prov = $pkg->provides; my @files = $pkg->files; + if ($flag_suggests) { + my @suggests = $pkg->tag('SUGGESTS'); + + #debug("suggests for $name : " . join ' ', @suggests); + push @req, @suggests; + } + analyse_rpm_info( $name, \@prov, \@req, \@files, \%objects, $rh_provides, $rh_files, $rh_depends, @@ -457,9 +478,12 @@ # and init_cache works with a command to exec # not with a perl module + display_status('read rpm data using URPM'); + import URPM; my $db = URPM::DB::open(); debug('1 : analysis'); - display_status('read rpm data using URPM'); + + my $flag_suggests = is_set( $rh_opt, 'suggests' ); my %objects; $db->traverse( @@ -474,6 +498,15 @@ clean_rel( \@prov ); my @files = $package->files(); + if ($flag_suggests) { + my $suggests = $package->queryformat('[%{SUGGESTS},]'); + my @suggests = split /,/, $suggests; + + #debug("suggests for $name : " . join ' ', @suggests); + clean_rel( \@suggests ); + push @req, @suggests; + } + analyse_rpm_info( $name, \@prov, \@req, \@files, \%objects, $rh_provides, $rh_files, $rh_depends, @@ -502,32 +535,52 @@ %{$rh_virtual} = (); %{$rh_requires} = (); - # try to detect the fastest way to get database info - eval { require URPM; }; - if ($EVAL_ERROR) { - eval { require RPM2; }; - if ($EVAL_ERROR) { + my %code = ( + 'URPM' => \&read_rpm_data_urpm, + 'RPM2' => \&read_rpm_data_rpm2, + 'basic' => \&read_rpm_data_base, + ); + my @def_list = ( 'URPM', 'RPM2', 'basic' ); + my @list; + if ( exists $ENV{'RPMORPHAN_METHOD'} ) { + my $method = $ENV{'RPMORPHAN_METHOD'}; + + # should be 'URPM', 'RPM2' or 'basic' + if ( exists $code{$method} ) { + push @list, $method; - # no specialized perm module installed, so use "old" basic method - debug('use shell access'); - read_rpm_data_base( $rh_opt, $rh_provides, $rh_install_time, - $rh_files, $rh_depends, $rh_virtual, $rh_requires ); + # for security : basic will allways work + push @list, 'basic'; } else { - - # fedora users and others - import RPM2; - debug('use RPM2'); - read_rpm_data_rpm2( $rh_opt, $rh_provides, $rh_install_time, - $rh_files, $rh_depends, $rh_virtual, $rh_requires ); + warning("unknown method $method, use default"); + @list = @def_list; } } else { - # mandriva : use URPM (also used by urpmi) - import URPM; - debug('use URPM'); - read_rpm_data_urpm( $rh_opt, $rh_provides, $rh_install_time, $rh_files, + # default list (ordered) of perl packages to test + @list = @def_list; + } + my $ok = 0; + foreach my $method (@list) { + debug("try $method"); + eval { require $method . '.pm'; }; + if ($EVAL_ERROR) { + debug("can not use $method"); + } + else { + $ok = 1; + *read_rpm_data_m = $code{$method}; + read_rpm_data_m( $rh_opt, $rh_provides, $rh_install_time, $rh_files, + $rh_depends, $rh_virtual, $rh_requires ); + last; + } + } + if ( !$ok ) { + + # if nothing is working, use default basic method + read_rpm_data_base( $rh_opt, $rh_provides, $rh_install_time, $rh_files, $rh_depends, $rh_virtual, $rh_requires ); } return; @@ -593,8 +646,7 @@ if ( -f $rcfile ) { debug("read rc from $rcfile"); - my $fh_rc; - if ( open $fh_rc, '<', $rcfile ) { + if ( open my $fh_rc, '<', $rcfile ) { read_one_rc( $rh_list, $fh_rc, $rcfile ); close $fh_rc or warning("problem to close rc file $rcfile :$ERRNO"); @@ -720,5 +772,21 @@ return $res; } ######################################################### +# return true is rpm allow SUGGEST tags +sub is_suggests() { + + my $cmd = 'rpm -q --querytags '; + ## no critic ( ProhibitBacktickOperators ); + my @res = `$cmd`; + ## use critic + foreach my $tag (@res) { + chomp $tag; + if ( $tag =~ m/^SUGGESTS/ ) { + return 1; + } + } + return 0; +} +######################################################### 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmorphan-1.10/rpmorphan-tk-lib.pl new/rpmorphan-1.11/rpmorphan-tk-lib.pl --- old/rpmorphan-1.10/rpmorphan-tk-lib.pl 2011-07-08 14:04:41.000000000 +0200 +++ new/rpmorphan-1.11/rpmorphan-tk-lib.pl 2012-08-01 20:47:47.000000000 +0200 @@ -4,7 +4,7 @@ # # Copyright (C) 2006 by Eric Gerbier # Bug reports to: gerb...@users.sourceforge.net -# $Id: rpmorphan-tk-lib.pl 316 2011-07-06 14:15:24Z gerbier $ +# $Id: rpmorphan-1.11 | rpmorphan-tk-lib.pl | Wed Jul 6 14:15:24 2011 +0000 | gerbier $ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmorphan-1.10/rpmorphan.1 new/rpmorphan-1.11/rpmorphan.1 --- old/rpmorphan-1.10/rpmorphan.1 2011-07-08 14:05:58.000000000 +0200 +++ new/rpmorphan-1.11/rpmorphan.1 2012-08-01 20:47:46.000000000 +0200 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "RPMORPHAN 1" -.TH RPMORPHAN 1 "2011-07-08" "perl v5.12.3" "User Contributed Perl Documentation" +.TH RPMORPHAN 1 "2012-08-01" "perl v5.14.2" "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 @@ -162,6 +162,7 @@ \& \-verbose verbose \& \-dry\-run simulate package remove \& \-fullalgo force full algorythm +\& \-suggests use suggested package as if required \& \-use\-cache use cache to avoid rpm query \& \-clear\-cache remove cache file \& \-gui display the graphical interface @@ -276,6 +277,12 @@ for a small list of packages, rpmorphan use a different quicker methode : rpm \-e \-\-test .Sp this option can be used to force the use of the full algo +.IP "\fB\-suggests\fR" 8 +.IX Item "-suggests" +some rpm version offers a meta-data dependency call suggests : it is +for usefull but not necessary packages. if this option is set, the +suggested packages are used in rpmorphan as required packages. +The default value for this option is unset. .IP "\fB\-package\fR" 8 .IX Item "-package" search if the given package(s) is(are) orphaned. @@ -287,7 +294,7 @@ For example lilo or grub are orphaned packages, but are necessary to boot ... .Sp -the \-install\-time and \-access\-time options may be useful to filter the list +the \*(L"\-install\-time\*(R" and \*(L"\-access\-time\*(R" options may be useful to filter the list .IP "\fB\-guess\-perl\fR" 8 .IX Item "-guess-perl" This option tries to find perl modules. It tries to match \*(L"^perl\*(R" @@ -448,6 +455,12 @@ For Mandriva users : the 'urpme \-\-auto\-orphans' command show quickly a a list of unused library packages. +.SH "ENVIRONMENT" +.IX Header "ENVIRONMENT" +.IP "\s-1RPMORPHAN_METHOD\s0" 8 +.IX Item "RPMORPHAN_METHOD" +for experts only : allow to force the method used to get rpm +data. It can be set to \s-1URPM\s0, \s-1RPM2\s0 or 'basic' (for external rpm query) .SH "SEE ALSO" .IX Header "SEE ALSO" \fIrpm\fR\|(1) for rpm call diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmorphan-1.10/rpmorphan.lsm new/rpmorphan-1.11/rpmorphan.lsm --- old/rpmorphan-1.10/rpmorphan.lsm 2011-07-08 14:04:41.000000000 +0200 +++ new/rpmorphan-1.11/rpmorphan.lsm 2012-08-01 20:27:01.000000000 +0200 @@ -1,7 +1,7 @@ Begin4 Title: rpmorphan -Version: 1.10 -Entered-date: 2011-07-08 +Version: 1.11 +Entered-date: 2012-08-03 Description: rpmorphan finds "orphaned" packages on your system. It determines which packages have no other packages depending on their installation, and shows you a list of these packages. @@ -10,7 +10,7 @@ Author: gerb...@users.sourceforge.net (Eric Gerbier) Maintained-by: gerb...@users.sourceforge.net (Eric Gerbier) Primary-site: http://rpmorphan.sourceforge.net - 46 Ko rpmorphan.tar.gz + 46 Ko rpmorphan-1.11.tar.gz Platforms: linux, works with perl Copying-policy: GPL End diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmorphan-1.10/rpmorphan.pl new/rpmorphan-1.11/rpmorphan.pl --- old/rpmorphan-1.10/rpmorphan.pl 2011-07-08 14:04:42.000000000 +0200 +++ new/rpmorphan-1.11/rpmorphan.pl 2012-08-01 20:47:47.000000000 +0200 @@ -4,7 +4,7 @@ # # Copyright (C) 2006 by Eric Gerbier # Bug reports to: gerb...@users.sourceforge.net -# $Id: rpmorphan.pl 327 2011-07-07 14:08:51Z gerbier $ +# $Id: rpmorphan-1.11 | rpmorphan.pl | Wed Aug 1 20:47:14 2012 +0200 | Eric Gerbier $ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -265,7 +265,7 @@ if ( exists $rh_virtual->{$prov} ) { # this feature is a virtual - my @virtuals = keys %{ $rh_virtual->{$prov} }; + my @virtuals = sort keys %{ $rh_virtual->{$prov} }; my $nb_virtual = scalar @virtuals; if ( $nb_virtual == 1 ) { @@ -279,7 +279,7 @@ # name provide virtual but is not the only one # we consider it an orphan - debug("skip virtual $prov"); + debug("$name : skip virtual $prov (@virtuals)"); next PROVIDE; } } @@ -289,8 +289,11 @@ # some packages depends from $prov ... $flag_orphan = 0; - my @depends = keys %{ $rh_depends->{$prov} }; - debug("$name is required by @depends ($prov)"); + # only in verbose mode + if ( is_verbose( \%Opt ) ) { + my @depends = sort keys %{ $rh_depends->{$prov} }; + debug("$name is required by @depends ($prov)"); + } last PROVIDE; } } @@ -546,8 +549,7 @@ my $display = shift @_; # display or not ? my @list; - my $fh; - if ( open $fh, '<', $keep_file ) { + if ( open my $fh, '<', $keep_file ) { @list = <$fh>; chomp @list; close $fh or warning("problem to close keep file : $ERRNO"); @@ -564,8 +566,7 @@ sub zero_keep($) { my $keep_file = shift @_; - my $fh; - if ( open $fh, '>', $keep_file ) { + if ( open my $fh, '>', $keep_file ) { close $fh or warning("problem to close keep file : $ERRNO"); } else { @@ -605,8 +606,7 @@ @new_list = @{$ra_list}; } - my $fh; - if ( open $fh, $mode, $keep_file ) { + if ( open my $fh, $mode, $keep_file ) { foreach my $elem (@new_list) { print {$fh} $elem . "\n"; } @@ -648,8 +648,7 @@ my $logfile = '/var/log/rpmorphan.log'; - my $fh; - if ( open $fh, '>>', $logfile ) { + if ( open my $fh, '>>', $logfile ) { my @date = gmtime; print {$fh} strftime( '%Y/%m/%d %H:%M:%S ', @date ) . $text . "\n"; @@ -775,6 +774,7 @@ my $opt_fullalgo; my $opt_use_cache; my $opt_clear_cache; +my $opt_suggests; my $opt_gui; my $opt_tk; my $opt_curses; @@ -824,6 +824,7 @@ 'guess-custom' => \$opt_guess_custom, 'package' => \@opt_package, 'exclude' => \@opt_exclude, + 'suggests' => \$opt_suggests, 'install-time' => \$opt_install_time, 'access-time' => \$Opt_access_time, 'add-keep' => \@opt_add_keep, @@ -857,6 +858,7 @@ 'install-time=i', 'access-time=i', 'list-keep', 'zero-keep', 'add-keep=s', 'del-keep=s', 'use-cache!', 'clear-cache', 'gui!', 'tk!', 'curses!', 'dry-run!', + 'suggests!', ) or pod2usage(2); if ($opt_help) { @@ -895,6 +897,11 @@ exit; } +# disable suggests option if rpm does not provide it +if ($opt_suggests) { + $opt_suggests = is_suggests(); +} + ana_guess( \%Opt ); # excluded files @@ -992,21 +999,22 @@ -verbose verbose -dry-run simulate package remove - -fullalgo force full algorythm - -use-cache use cache to avoid rpm query - -clear-cache remove cache file - -gui display the graphical interface - -tk display the tk graphical interface - -curses display the curses graphical interface - - -exclude pac exclude pac from results - -install-time +/-d apply on packages which are installed before (after) d days - -access-time d apply on packages which are not been accessed for d days (slow) + -fullalgo force full algorythm + -suggests use suggested package as if required + -use-cache use cache to avoid rpm query + -clear-cache remove cache file + -gui display the graphical interface + -tk display the tk graphical interface + -curses display the curses graphical interface + + -exclude pac exclude pac from results + -install-time +/-d apply on packages which are installed before (after) d days + -access-time d apply on packages which are not been accessed for d days (slow) targets: -package pac search if pac is an orphan package - -all apply on all packages + -all apply on all packages -guess-perl apply on perl packages -guess-python apply on python packages -guess-pike apply on pike packages @@ -1129,6 +1137,13 @@ this option can be used to force the use of the full algo +=item B<-suggests> + +some rpm version offers a meta-data dependency call suggests : it is +for usefull but not necessary packages. if this option is set, the +suggested packages are used in rpmorphan as required packages. +The default value for this option is unset. + =item B<-package> search if the given package(s) is(are) orphaned. @@ -1141,7 +1156,7 @@ For example lilo or grub are orphaned packages, but are necessary to boot ... -the L<-install-time> and L<-access-time> options may be useful to filter the list +the L</-install-time> and L</-access-time> options may be useful to filter the list =item B<-guess-perl> @@ -1339,6 +1354,17 @@ the 'urpme --auto-orphans' command show quickly a a list of unused library packages. +=head1 ENVIRONMENT + +=over 8 + +=item RPMORPHAN_METHOD + +for experts only : allow to force the method used to get rpm +data. It can be set to URPM, RPM2 or 'basic' (for external rpm query) + +=back + =head1 SEE ALSO =for man diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmorphan-1.10/rpmorphan.spec new/rpmorphan-1.11/rpmorphan.spec --- old/rpmorphan-1.10/rpmorphan.spec 2011-07-08 14:04:42.000000000 +0200 +++ new/rpmorphan-1.11/rpmorphan.spec 2012-08-01 20:27:01.000000000 +0200 @@ -1,7 +1,7 @@ %global _binary_filedigest_algorithm 1 %global _source_filedigest_algorithm 1 -%define VERSION 1.10 +%define VERSION 1.11 Summary: List packages that have no dependencies (like deborphan) # The Summary: line should be expanded to about here -----^ Summary(fr): Liste les packages rpm orphelins (sans dependances) @@ -160,6 +160,7 @@ %dir /usr/lib/rpmorphan/locale/fr_FR %attr(644, root, root) /usr/lib/rpmorphan/locale/fr_FR/rpmorphan_trans.pl %config(noreplace) /etc/logrotate.d/rpmorphan +%config(noreplace) /etc/rpmorphanrc %doc %{_mandir}/man1/rpmorphan.1* %doc %{_mandir}/man1/rpmusage.1* %doc %{_mandir}/man1/rpmdep.1* @@ -167,6 +168,12 @@ %doc %{_mandir}/man1/rpmextra.1* %changelog +* Thu Aug 03 2012 Eric Gerbier <gerb...@users.sourceforge.net> 1.11 +- add suggests option +- add /etc/rpmorphanrc +- fix bug with space in filenames +- add env RPMORPHAN_METHOD for debugging + * Thu Jul 8 2011 Eric Gerbier <gerb...@users.sourceforge.net> 1.10 - bugfix eval for Curses (mandriva) - fix bad version display diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmorphan-1.10/rpmorphanrc.sample new/rpmorphan-1.11/rpmorphanrc.sample --- old/rpmorphan-1.10/rpmorphanrc.sample 2007-11-23 14:31:16.000000000 +0100 +++ new/rpmorphan-1.11/rpmorphanrc.sample 2012-08-01 20:47:47.000000000 +0200 @@ -1,5 +1,5 @@ # configuration file exemple for rpmorphan -# $Id: rpmrestorerc.sample 58 2007-03-21 12:15:08Z gerbier $ +# $Id: rpmorphan-1.11 | rpmorphanrc.sample | Tue Jul 31 17:13:56 2012 +0200 | Eric Gerbier $ # it can be used as # - host (general) configuration file as /etc/rpmorphanrc # - home (user) configuration file as ~/.rpmorphanrc @@ -25,6 +25,7 @@ #dry-run = 0 #version = 0 #fullalgo = 0 +#suggests = 0 #all = 0 #guess-perl = 0 #guess-python = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmorphan-1.10/rpmusage.1 new/rpmorphan-1.11/rpmusage.1 --- old/rpmorphan-1.10/rpmusage.1 2011-07-08 14:05:58.000000000 +0200 +++ new/rpmorphan-1.11/rpmusage.1 2012-08-01 20:47:46.000000000 +0200 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "RPMUSAGE 1" -.TH RPMUSAGE 1 "2011-07-08" "perl v5.12.3" "User Contributed Perl Documentation" +.TH RPMUSAGE 1 "2012-08-01" "perl v5.14.2" "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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rpmorphan-1.10/rpmusage.pl new/rpmorphan-1.11/rpmusage.pl --- old/rpmorphan-1.10/rpmusage.pl 2011-07-08 14:04:42.000000000 +0200 +++ new/rpmorphan-1.11/rpmusage.pl 2012-08-01 20:47:47.000000000 +0200 @@ -4,7 +4,7 @@ # # Copyright (C) 2006 by Eric Gerbier # Bug reports to: gerb...@users.sourceforge.net -# $Id: rpmusage.pl 304 2011-07-05 11:28:04Z gerbier $ +# $Id: rpmorphan-1.11 | rpmusage.pl | Tue Jul 5 11:28:04 2011 +0000 | gerbier $ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org