Package: cvs-autoreleasedeb
Version: 0.12-1

Add missing attachment of the previous bug-report (sorry):
  svn-autoreleasedeb improvement(5)

-- 
Oron Peled                                 Voice: +972-4-8228492
o...@actcom.co.il                  http://users.actcom.co.il/~oron
"Those who do not understand Unix are condemned to reinvent it, poorly."
         (H. Spencer)

-------------------------------------------------------
Index: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	(revision 300)
+++ trunk/debian/changelog	(revision 301)
@@ -1,3 +1,14 @@
+cvs-autoreleasedeb (0.12-1.5) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Don't assume source package name is the same as svn module name:
+    - Parse package name from changelog (as well as version).
+    - Store it (indexed by server and svn module name)
+    - Use it for the .changes file to dupload.
+  * Also improve changelog parse, only read one line from file.
+
+ -- Oron Peled <o...@actcom.co.il>  Tue, 15 Dec 2009 20:06:39 +0200
+
 cvs-autoreleasedeb (0.12-1.4) unstable; urgency=low
 
   * Non-maintainer upload.
Index: trunk/svn-autoreleasedeb
===================================================================
--- trunk/svn-autoreleasedeb	(revision 300)
+++ trunk/svn-autoreleasedeb	(revision 301)
@@ -177,6 +177,7 @@
 mkdir $::PACKDIR;
 my %failed_packages;
 my %prev_build_state;
+my %package_names;
 foreach my $s (keys %{$newpacks_struct}) {
 	undef $failed_packages{$s};
 	next if ref($newpacks_struct->{$s}) ne "HASH";
@@ -242,7 +243,8 @@
 		if($stripedVer =~ m/^[^:]+:(.+)$/) {
 			$stripedVer = $1;
 		}
-		$cmd = "dupload --to ".$s." ".$p."_".$stripedVer."_*.changes 2>&1";
+		my $pkgname = $package_names{$s}{$p};
+		$cmd = "dupload --to '$s' ${pkgname}_${stripedVer}_*.changes 2>&1";
 
 		print $cmd."\n";
 
@@ -407,10 +409,12 @@
 			$cmd = "$::SVN cat ".$conf_struct->{$s}{$p}{svnserver}.q(/).$conf_struct->{$s}{$p}{prefix}.
                           q(/).$p.q(/).$conf_struct->{$s}{$p}{tag}."/debian/changelog";
                         print $cmd."\n";
-			my $changelog = `$cmd`;
+			open(F, "$cmd |") || die "$0: Failed running '$cmd'";
+			my $changelog = <F>;	# Read first line only
+			chomp($changelog);
+			close F || die "$0: Command '$cmd' failed";
 			my $version;
 			my $pkgname;
-			($changelog) = split(/\n/, $changelog);
 			($pkgname, $version, undef) = split(/\s+/, $changelog);
 			if(defined($version) && $version =~ /^\((.*)\)$/) {
 				$version = $1;
@@ -418,7 +422,8 @@
 				$version = 'UNKNOWN';
 			}
 			my $prev_build_state = $prev_build_state{$s}{$p};
-			print "Package $p in version $version (prev_build=$prev_build_state)\n";
+			print "Package $p ($pkgname) in version $version (prev_build=$prev_build_state)\n";
+			$package_names{$s}{$p} = $pkgname;
 			$newstate_struct->{$s}{$p} = $version;
 		}
 	}

Reply via email to