~ubuntu-branches/ubuntu/trusty/rsync/trusty

« back to all changes in this revision

Viewing changes to packaging/git-status.pl

  • Committer: Package Import Robot
  • Author(s): Paul Slootman
  • Date: 2013-10-27 12:01:10 UTC
  • mfrom: (1.1.13) (2.1.11 sid)
  • Revision ID: package-import@ubuntu.com-20131027120110-mpr03n5scqmf40mi
Tags: 3.1.0-2
fix build failure if zlib1g-dev package is not installed;
solved by building without the included zlib source and adding a
build-depends on zlib1g-dev >= 1:1.2.8
closes:32379

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
    my($master_branch, $fatal_unless_clean, $check_patches_dir) = @_;
7
7
 
8
8
    my($cur_branch) = check_git_status($fatal_unless_clean);
9
 
    if ($cur_branch ne $master_branch) {
 
9
    (my $branch = $cur_branch) =~ s{^patch/([^/]+)/[^/]+$}{$1}; # change patch/BRANCH/PATCH_NAME into BRANCH
 
10
    if ($branch ne $master_branch) {
10
11
        print "The checkout is not on the $master_branch branch.\n";
11
12
        exit 1 if $master_branch ne 'master';
12
 
        print "Do you want me to continue with --branch=$cur_branch? [n] ";
 
13
        print "Do you want me to continue with --branch=$branch? [n] ";
13
14
        $_ = <STDIN>;
14
15
        exit 1 unless /^y/i;
15
 
        $_[0] = $master_branch = $cur_branch; # Updates caller's $master_branch too.
 
16
        $_[0] = $master_branch = $branch; # Updates caller's $master_branch too.
16
17
    }
17
18
 
18
19
    if ($check_patches_dir && -d 'patches/.git') {
19
 
        ($cur_branch) = check_git_status($fatal_unless_clean, 'patches');
20
 
        if ($cur_branch ne $master_branch) {
21
 
            print "The *patches* checkout is on branch $cur_branch, not branch $master_branch.\n";
 
20
        ($branch) = check_git_status($fatal_unless_clean, 'patches');
 
21
        if ($branch ne $master_branch) {
 
22
            print "The *patches* checkout is on branch $branch, not branch $master_branch.\n";
22
23
            print "Do you want to change it to branch $master_branch? [n] ";
23
24
            $_ = <STDIN>;
24
25
            exit 1 unless /^y/i;
25
26
            system "cd patches && git checkout '$master_branch'";
26
27
        }
27
28
    }
 
29
 
 
30
    return $cur_branch;
28
31
}
29
32
 
30
33
sub check_git_status