[LON-CAPA-cvs] cvs: modules /matthew/LON-CAPA_rpm buildnew.pl
matthew
lon-capa-cvs@mail.lon-capa.org
Fri, 06 Aug 2004 15:48:02 -0000
matthew Fri Aug 6 11:48:02 2004 EDT
Modified files:
/modules/matthew/LON-CAPA_rpm buildnew.pl
Log:
Less restrictive about what we accept for version and release ids.
More careful about the symbolic link used to make the tarball.
Index: modules/matthew/LON-CAPA_rpm/buildnew.pl
diff -u modules/matthew/LON-CAPA_rpm/buildnew.pl:1.1 modules/matthew/LON-CAPA_rpm/buildnew.pl:1.2
--- modules/matthew/LON-CAPA_rpm/buildnew.pl:1.1 Thu Aug 5 15:13:16 2004
+++ modules/matthew/LON-CAPA_rpm/buildnew.pl Fri Aug 6 11:48:02 2004
@@ -20,9 +20,9 @@
my $specfile = $name.'.spec';
my $version = `grep '^Version:' $specfile`;
-$version =~ s/^Version: (\w+)\s*$/$1/;
+$version =~ s/^Version: (.*)\s*$/$1/;
my $release = `grep '^Release:' $specfile`;
-$release =~ s/^Release: (\w+)\s*$/$1/;
+$release =~ s/^Release: (.*)\s*$/$1/;
my $olddir = $name;
my $dirname = $name.'-'.$version;
@@ -34,6 +34,14 @@
unlink($rpmfile);
}
+if (-e $dirname) {
+ if (-l $dirname) {
+ unlink($dirname);
+ } else {
+ die "$dirname already exists and is not a symbolic link";
+ }
+}
+
system("ln -s $olddir $dirname");
system("tar zcf $tarball $dirname --dereference --exclude $dirname/CVS");