summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2014-01-27 09:18:03 -0800
committerWayne Davison <wayned@samba.org>2014-01-27 09:18:03 -0800
commit7fb4c08c24dc33ae15782109351dd91355bcc983 (patch)
treecfb5ae68fbb6cac8eb85a76357fb458bd9300fe8
parent8946cfc6f8018e30740ee1db4cc2e2008e4f7e7e (diff)
downloadrsync-7fb4c08c24dc33ae15782109351dd91355bcc983.tar.gz
rsync-7fb4c08c24dc33ae15782109351dd91355bcc983.tar.bz2
rsync-7fb4c08c24dc33ae15782109351dd91355bcc983.zip
Use the patch's list of generated files for each patch.
-rwxr-xr-xpackaging/patch-update40
1 files changed, 25 insertions, 15 deletions
diff --git a/packaging/patch-update b/packaging/patch-update
index 4ac01ebe..a1cb42c7 100755
--- a/packaging/patch-update
+++ b/packaging/patch-update
@@ -45,20 +45,8 @@ while (<PIPE>) {
close PIPE;
die "Unable to determine commit hash for master branch: $master_branch\n" unless defined $master_commit;
-my @extra_files;
-open(IN, '<', 'Makefile.in') or die "Couldn't open Makefile.in: $!\n";
-while (<IN>) {
- if (s/^GENFILES=//) {
- while (s/\\$//) {
- $_ .= <IN>;
- }
- @extra_files = split(' ', $_);
- last;
- }
-}
-close IN;
-
if ($incl_generated_files) {
+ my @extra_files = get_extra_files();
die "'$tmp_dir' must not exist in the current directory.\n" if -e $tmp_dir;
mkdir($tmp_dir, 0700) or die "Unable to mkdir($tmp_dir): $!\n";
system "$make_gen_cmd && rsync -a @extra_files $tmp_dir/master/" and exit 1;
@@ -171,7 +159,9 @@ sub update_patch
open(OUT, '>', "$patches_dir/$patch.diff") or die $!;
print OUT $description{$patch}, "\nbased-on: $based_on\n";
+ my @extra_files;
if ($incl_generated_files) {
+ @extra_files = get_extra_files();
system "$make_gen_cmd && rsync -a @extra_files $tmp_dir/$patch/" and exit 1;
}
$last_touch = time;
@@ -196,14 +186,15 @@ sub update_patch
} else {
($parent_dir) = $parent =~ m{([^/]+)$};
}
- open(PIPE, '-|', 'diff', '-up', "$tmp_dir/$parent_dir", "$tmp_dir/$patch") or die $!;
+ open(PIPE, '-|', 'diff', '-Nurp', "$tmp_dir/$parent_dir", "$tmp_dir/$patch") or die $!;
while (<PIPE>) {
- s#^(diff -up) $tmp_dir/[^/]+/(.*?) $tmp_dir/[^/]+/(.*)#$1 a/$2 b/$3#o;
+ s#^(diff -Nurp) $tmp_dir/[^/]+/(.*?) $tmp_dir/[^/]+/(.*)#$1 a/$2 b/$3#o;
s#^\Q---\E $tmp_dir/[^/]+/([^\t]+)\t.*#--- a/$1#o;
s#^\Q+++\E $tmp_dir/[^/]+/([^\t]+)\t.*#+++ b/$1#o;
print OUT $_;
}
close PIPE;
+ unlink @extra_files;
}
close OUT;
@@ -213,6 +204,25 @@ sub update_patch
exit;
+sub get_extra_files
+{
+ my @extras;
+
+ open(IN, '<', 'Makefile.in') or die "Couldn't open Makefile.in: $!\n";
+ while (<IN>) {
+ if (s/^GENFILES=//) {
+ while (s/\\$//) {
+ $_ .= <IN>;
+ }
+ @extras = split(' ', $_);
+ last;
+ }
+ }
+ close IN;
+
+ return @extras;
+}
+
sub usage
{
die <<EOT;