From 56fc9f70d385b20d431d9fa62ef4fd3941949717 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Wed, 23 Jul 2008 23:21:42 -0700 Subject: [PATCH] Enhanced the release scripts to be able to handle a branch release. --- NEWS | 18 +----------------- packaging/patch-update | 41 ++++++++++++++++++++++++----------------- packaging/release-rsync | 30 +++++++++++++++++++++++++----- 3 files changed, 50 insertions(+), 39 deletions(-) diff --git a/NEWS b/NEWS index bc1640ef..02be9350 100644 --- a/NEWS +++ b/NEWS @@ -1,22 +1,12 @@ NEWS for rsync 3.1.0 (UNRELEASED) Protocol: 30 (unchanged) -Changes since 3.0.3: +Changes since 3.0.4: BUG FIXES: - - Fixed a bug in the hard-linking code where it would sometimes try to - allocate 0 bytes of memory (which fails on system OSes). - - Changed the way --progress overwrites its prior output in order to make it nearly impossible for the progress to get overwritten by an error. - - Improved the keep-alive in-loop check in the generator to work properly - in incremental recursion mode. - - - Fixed a couple issues in the --fake-super handling of xattrs when the - destination files have root-level attributes (e.g. selinux values) that - a non-root copy can't affect. - ENHANCEMENTS: - Added the --remote-option=OPT (-M OPT) command-line option that is useful @@ -30,9 +20,6 @@ Changes since 3.0.3: MD5 checksum of any transferred file, or all files if --checksum was specified (when protocol 30 or above is in effect). - - Rsync will not send an -e option to the server if the user specifies the - --protocol=29 option. This lets rsync3 use an overly-restrictive server. - DEVELOPER RELATED: - Added more conditional debug output. @@ -42,6 +29,3 @@ Changes since 3.0.3: - The pool_alloc library has received some minor improvements in alignment handling. - - - The Makefile will not halt for just a timestamp change on the Makefile - or the configure files, only for actual changes in content. diff --git a/packaging/patch-update b/packaging/patch-update index 62f9980e..46d9ff8f 100755 --- a/packaging/patch-update +++ b/packaging/patch-update @@ -13,6 +13,7 @@ my $tmp_dir = "patches.$$"; &Getopt::Long::Configure('bundling'); &usage if !&GetOptions( + 'branch|b=s' => \( my $master_branch = 'master' ), 'skip-check' => \( my $skip_branch_check ), 'shell|s' => \( my $launch_shell ), 'gen:s' => \( my $incl_generated_files ), @@ -53,15 +54,13 @@ if ($incl_generated_files) { } our $last_touch = time; -my(%patches, %local_patch); +my %patches; # Start by finding all patches so that we can load all possible parents. -open(PIPE, '-|', 'git', 'branch', '-a') or die $!; +open(PIPE, '-|', 'git', 'branch', '-l') or die $!; while () { - if (m# origin/patch/(.*)#) { + if (m# patch/(.*)#) { $patches{$1} = 1; - } elsif (m# patch/(.*)#) { - $patches{$1} = $local_patch{$1} = 1; } } close PIPE; @@ -70,19 +69,23 @@ my @patches = sort keys %patches; my(%parent, %description); foreach my $patch (@patches) { - my $branch = ($local_patch{$patch} ? '' : 'origin/') . "patch/$patch"; + my $branch = "patch/$patch"; my $desc = ''; - open(PIPE, '-|', 'git', 'diff', '-U1000', "master...$branch", '--', "PATCH.$patch") or die $!; + open(PIPE, '-|', 'git', 'diff', '-U1000', "$master_branch...$branch", '--', "PATCH.$patch") or die $!; while () { last if /^@@ /; } while () { next unless s/^[ +]//; if (m#patch -p1 = time; - if ($local_patch{$patch}) { - system "git checkout patch/$patch" and return 0; - } else { - system "git checkout --track -b patch/$patch origin/patch/$patch" and return 0; - } + system "git checkout patch/$patch" and return 0; my $ok = system("git merge $parent") == 0; if (!$ok || $launch_shell) { @@ -174,8 +176,13 @@ sub update_patch close PIPE; if ($incl_generated_files) { - $parent =~ s#.*/##; - open(PIPE, '-|', 'diff', '-up', "$tmp_dir/$parent", "$tmp_dir/$patch") or die $!; + my $parent_dir; + if ($parent eq $master_branch) { + $parent_dir = 'master'; + } else { + ($parent_dir) = $parent =~ m{([^/]+)$}; + } + open(PIPE, '-|', 'diff', '-up', "$tmp_dir/$parent_dir", "$tmp_dir/$patch") or die $!; while () { s#^(diff -up) $tmp_dir/[^/]+/(.*?) $tmp_dir/[^/]+/(.*)#$1 a/$2 b/$3#o; s#^\Q---\E $tmp_dir/[^/]+/([^\t]+)\t.*#--- a/$1#o; diff --git a/packaging/release-rsync b/packaging/release-rsync index 50c940a5..6fa42137 100755 --- a/packaging/release-rsync +++ b/packaging/release-rsync @@ -7,6 +7,7 @@ use strict; # ~/samba-rsync-ftp dir will be ready to be rsynced to samba.org. use Cwd; +use Getopt::Long; use Term::ReadKey; use Date::Format; @@ -14,6 +15,13 @@ my $dest = $ENV{HOME} . '/samba-rsync-ftp'; my $passfile = $ENV{HOME} . '/.rsyncpass'; my $path = $ENV{PATH}; +&Getopt::Long::Configure('bundling'); +&usage if !&GetOptions( + 'branch|b=s' => \( my $master_branch = 'master' ), + 'help|h' => \( my $help_opt ), +); +&usage if $help_opt; + my $now = time; my $cl_today = time2str('* %a %b %d %Y', $now); my $year = time2str('%Y', $now); @@ -56,7 +64,7 @@ open(IN, '-|', 'git status') or die $!; my $status = join('', ); close IN; die "The checkout is not clean:\n", $status unless $status =~ /\nnothing to commit \(working directory clean\)/; -die "The checkout is not on the master branch.\n" unless $status =~ /^# On branch master\n/; +die "The checkout is not on the $master_branch branch.\n" unless $status =~ /^# On branch $master_branch\n/; my $confversion; open(IN, '<', 'configure.in') or die $!; @@ -221,7 +229,7 @@ print $break, <; system "git commit -a -m 'Preparing for release of $version'" and exit 1; print "Updating files in \"patches\" dir ...\n"; -system "packaging/patch-update"; +system "packaging/patch-update --branch=$master_branch"; if ($ans =~ /^y/i) { print "\nVisiting all \"patch/*\" branches ...\n"; - system "packaging/patch-update --shell"; + system "packaging/patch-update --branch=$master_branch --shell"; } print $break, <