3 ################################################################
5 # Copyright (c) 1995-2014 SUSE Linux Products GmbH
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License version 2 or 3 as
9 # published by the Free Software Foundation.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program (see the file COPYING); if not, write to the
18 # Free Software Foundation, Inc.,
19 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
21 ################################################################
24 unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
32 Getopt::Long::Configure("no_ignore_case");
38 GetOptions ("root=s" => \$opt_root, "type=s" => \$opt_type, "extraname" => \$opt_extraname) or exit(1);
42 my $ql = Build::queryinstalled($opt_type, $opt_root);
43 die("cannot get list of installed packages for type $opt_type\n") unless $ql;
46 next unless defined($q->{'name'}) && defined($q->{'arch'});
47 next if $q->{'arch'} eq 'src' || $q->{'arch'} eq 'nosrc';
48 my $id = "$q->{'name'}.$q->{'arch'}-0/0/0: ";
49 my $evr = $q->{'version'};
50 $evr = "$q->{'epoch'}:$evr" if $q->{'epoch'};
51 $evr .= "-$q->{'release'}" if defined $q->{'release'};
52 my $buildtime = $q->{'buildtime'} || 0;
54 print "I:$id$q->{'name'} $q->{'name'}-$evr $buildtime-$q->{'arch'}\n";
56 print "I:$id$q->{'name'}-$evr $buildtime-$q->{'arch'}\n";