OpenPKG CVS Repository
http://www.openpkg.org/cvsweb/cvsweb.cgi
____________________________________________________________________________
Server: cvs.openpkg.org Name: Thomas Lotterer
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-re Date: 10-Jul-2002 12:06:42
Branch: HEAD Handle: 2002071011064200
Modified files:
openpkg-re buildrdf.pl
Log:
- better progname handling and tmpdir generation
- only accept RPMs with valid OpenPKG filenames
- do not die if spec file cannot be extracted from RPM
Summary:
Revision Changes Path
1.16 +10 -5 openpkg-re/buildrdf.pl
____________________________________________________________________________
Index: openpkg-re/buildrdf.pl
============================================================
$ cvs diff -u -r1.15 -r1.16 buildrdf.pl
--- openpkg-re/buildrdf.pl 9 Jul 2002 19:35:33 -0000 1.15
+++ openpkg-re/buildrdf.pl 10 Jul 2002 10:06:42 -0000 1.16
@@ -18,8 +18,8 @@
# - program skips inaccessible folders and prints a warning
# - modifying filesystem during operation causes unpredictable results
#
-# $Id: buildrdf.pl,v 1.15 2002/07/09 19:35:33 thl Exp $
-# $Revision: 1.15 $
+# $Id: buildrdf.pl,v 1.16 2002/07/10 10:06:42 thl Exp $
+# $Revision: 1.16 $
#
# (C)20011022 Cable & Wireless Deutschland GmbH
# Application Services, Development Team
@@ -30,6 +30,7 @@
use Getopt::Long;
#file global
+my $progname = $0; $progname =~ s|^.*/||;
my $rdffile='index.rdf';
my $verbose=0;
my $quietmode=0;
@@ -40,7 +41,7 @@
my $help = 0;
my $compress = 0;
my $rpm = "rpm";
-my $tmpdir = "/tmp/$0-$$";
+my $tmpdir = "/tmp/$progname-$$";
#main
Getopt::Long::Configure("bundling");
@@ -145,7 +146,7 @@
closedir FOLDER;
foreach $entry (@entries) {
$i=$prefix.$folder.$entry;
- if (-f $i and not -l $i and ($entry =~ m|\.rpm$|)) {
+ if (-f $i and not -l $i and ($entry =~
m|^[^-]+-[^-]+-[^-]+(\.src)?\.rpm$|)) {
rpm2rdf($prefixname, $prefix, $folder, $entry);
}
if (-d $i and not -l $i) {
@@ -277,7 +278,11 @@
print STDERR "$0: ERROR: $rpm cannot read $name.spec from $rpmsource,
error $?\n"; #report but ignore errors
return;
}
- open(SPEC, "<$tmpdir/$name.spec") || die;
+ open(SPEC, "<$tmpdir/$name.spec");
+ if ( $? != 0 ) {
+ print STDERR "$0: ERROR: $rpm cannot open $name.spec from $rpmsource,
error $?\n"; #report but ignore errors
+ return;
+ };
my $spec = '';
$spec .= $_ while (<SPEC>);
close(SPEC);
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]