X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/aacd188034703acc9d4ab43704d627f5d48a7eb8..56fc9f70d385b20d431d9fa62ef4fd3941949717:/packaging/release-rsync 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, <