&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 ),
foreach my $patch (@patches) {
my $branch = ($local_patch{$patch} ? '' : 'origin/') . "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 (<PIPE>) {
last if /^@@ /;
}
}
$parent = "patch/$parent";
} else {
- $parent = 'master';
+ $parent = $master_branch;
}
print "======== $patch ========\n";
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 (<PIPE>) {
s#^(diff -up) $tmp_dir/[^/]+/(.*?) $tmp_dir/[^/]+/(.*)#$1 a/$2 b/$3#o;
s#^\Q---\E $tmp_dir/[^/]+/([^\t]+)\t.*#--- a/$1#o;
# ~/samba-rsync-ftp dir will be ready to be rsynced to samba.org.
use Cwd;
+use Getopt::Long;
use Term::ReadKey;
use Date::Format;
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);
my $status = join('', <IN>);
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 $!;
About to:
- commit all version changes
- - merge the master branch into the patch/* branches
+ - merge the $master_branch branch into the patch/* branches
- update the files in the "patches" dir and OPTIONALLY
(if you type 'y') to launch a shell for each patch
and rsync the release files. Remember to announce the release on *BOTH*
rsync-announce@lists.samba.org and rsync@lists.samba.org (and the web)!
EOT
+
+exit;
+
+sub usage
+{
+ die <<EOT;
+Usage: release-rsync [OPTIONS]
+
+-b, --branch=BRANCH The branch to release (default: master)
+-h, --help Display this help message
+EOT
+}