From e12ec6aabf385390679b1a73ef4be0d431145261 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 6 Feb 2008 13:40:09 -0500 Subject: [PATCH] refactor --- pristine-tar | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pristine-tar b/pristine-tar index 1b4e550..fcd588a 100755 --- a/pristine-tar +++ b/pristine-tar @@ -434,24 +434,24 @@ sub gendelta { $tarball="$tempdir/origtarball"; } - my $sourcedir="$tempdir/tmp"; - doit("mkdir", $sourcedir); - doit("tar", "xf", File::Spec->rel2abs($tarball), "-C", $sourcedir); - # if all files were in a subdir, use the subdir as the sourcedir - my @out=grep { $_ ne "$sourcedir/.." && $_ ne "$sourcedir/." } - (glob("$sourcedir/*"), glob("$sourcedir/.*")); - if ($#out == 0 && -d $out[0]) { - $sourcedir=$out[0]; - } - - genmanifest($tarball, "$tempdir/manifest"); my $recreatetarball; if (! exists $opts{recreatetarball}) { + my $sourcedir="$tempdir/tmp"; + doit("mkdir", $sourcedir); + doit("tar", "xf", File::Spec->rel2abs($tarball), "-C", $sourcedir); + # if all files were in a subdir, use the subdir as the sourcedir + my @out=grep { $_ ne "$sourcedir/.." && $_ ne "$sourcedir/." } + (glob("$sourcedir/*"), glob("$sourcedir/.*")); + if ($#out == 0 && -d $out[0]) { + $sourcedir=$out[0]; + } my $recreatetarball=recreatetarball($tempdir, $sourcedir, clobber_source => 1); } else { $recreatetarball=$opts{recreatetarball}; } + + genmanifest($tarball, "$tempdir/manifest"); my $ret=system("xdelta delta -0 --pristine $recreatetarball $tarball $tempdir/delta") >> 8; # xdelta exits 1 on success if there were differences -- 2.7.4