Selaa lähdekoodia

move tardir creation into the prep_tar function

It was annoying that the tardir was created even if the build failed due
to uncommitted changes, this avoids that problem.
Joey Hess 19 vuotta sitten
vanhempi
commit
c0cf5584b0
2 muutettua tiedostoa jossa 4 lisäystä ja 5 poistoa
  1. 3 1
      scripts/Dpkg/Source/VCS/git.pm
  2. 1 4
      scripts/dpkg-source.pl

+ 3 - 1
scripts/Dpkg/Source/VCS/git.pm

@@ -135,7 +135,9 @@ sub prep_tar {
 
 	# TODO support for creating a shallow clone for those cases where
 	# uploading the whole repo history is not desired
-	
+
+	mkdir($tardir,0755) ||
+            &syserr(sprintf(_g("unable to create `%s'"), $tardir));
 	system("cp -a $srcdir/.git $tardir");
 	$? && main::subprocerr("cp -a $srcdir/.git $tardir");
 

+ 1 - 4
scripts/dpkg-source.pl

@@ -478,14 +478,11 @@ if ($opmode eq 'build') {
 	$tarname="$basenamerev.$vcs.tar.gz";
         $tardirbase= $dirbase; $tardirname= "$tarname.tmp";
 
-        mkdir($tardirname,0755) ||
-            &syserr(sprintf(_g("unable to create `%s'"), $tardirname));
-	push @exit_handlers, sub { erasedir($tardirname) };
-        
 	eval qq{Dpkg::Source::VCS::${vcs}::prep_tar(\$dir, \$tardirname)};
 	if ($@) {
             &syserr($@);
 	}
+	push @exit_handlers, sub { erasedir($tardirname) };
     }
     elsif ($sourcestyle ne 'n') {
 	my $origdirbase = $origdir;