~ubuntu-branches/ubuntu/precise/devscripts/precise

« back to all changes in this revision

Viewing changes to scripts/debcommit.pl

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2011-05-22 19:49:16 UTC
  • mfrom: (10.9.4 sid) (10.7.8 squeeze)
  • Revision ID: james.westby@ubuntu.com-20110522194916-tmmamo4499eh1z0a
Tags: 2.10.73ubuntu1
* Merge from Debian unstable (LP: #717389); remaining changes:
  - Demote Recommends to Suggests:
    + libcrypt-ssleay-perl: only needed for a corner case (uscan on SSL
      download sites), wasn't installed by default in previous releases
      either, and seems quite dead upstream; universe only.
    + debian-{keyring,maintainers}: not useful enough in Ubuntu; universe
      only.
    + equivs: too much of a hack to install by default; universe only.
    + libyaml-syck-perl: transition-check is fairly Debian-specific.
  - scripts/debchange.{pl,1}:
    + Adjust --security template for Ubuntu.
    + Add -U/--upstream flag that forces original "just increment
      the end" behaviour; Ubuntu is upstream for some pieces of software.
    + Add --distributor= and DEBCHANGE_DISTRIBUTOR to override lsb_release
      output.
    + Default to "oneiric" as distribution.
    + Add "ubuntu1" to version string for new versions, with tweaks for
      special cases.
    + Add -R/--rebuild flag for Ubuntu's no-change rebuilds.
    + Don't use the last distribution in debian/changelog when doing
      "dch -r" on Ubuntu. "Just because it was last uploaded to jaunty
      doesn't mean that's the right thing to do now." Thanks to Colin
      Watson. (LP: #429288)
  - scripts/debsign.{sh,1}: Implement DEBSIGN_ALWAYS_RESIGN variable to skip
    the "Would you like to use the current signature?" question. (Debian
    #447955)
  - scripts/debuild.pl: Enforce Ubuntu merge policy.
  - scripts/dscverify.pl: Add Ubuntu keyrings.
  - scripts/rmadison.pl: Change default URL parameter to ubuntu.
  - Add test/debchange.pl, test/Makefile: debchange test suite.
  - Rename XS-Vcs-* to XS-Debian-Vcs-*.
* debchange: Use dpkg-vendor instead of lsb_release.
* debchange: Add DEBCHANGE_DISTRIBUTOR to array of config variables. Thanks
  to Adam Dorsey for the patch. (LP: #783693)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
=over 4
22
22
 
23
 
=item B<-c> B<--changelog> I<path>
 
23
=item B<-c>, B<--changelog> I<path>
24
24
 
25
25
Specify an alternate location for the changelog. By default debian/changelog is
26
26
used.
27
27
 
28
 
=item B<-r> B<--release>
 
28
=item B<-r>, B<--release>
29
29
 
30
30
Commit a release of the package. The version number is determined from
31
31
debian/changelog, and is used to tag the package in the repository.
34
34
svnpath(1) to determine where the tag should be placed in the
35
35
repository.
36
36
 
37
 
=item B<-R> B<--release-use-changelog>
 
37
=item B<-R>, B<--release-use-changelog>
38
38
 
39
39
When used in conjunction with --release, if there are uncommited
40
40
changes to the changelog then derive the commit message from those
41
41
changes rather than using the default message.
42
42
 
43
 
=item B<-m> I<text> B<--message> I<text>
 
43
=item B<-m> I<text>, B<--message> I<text>
44
44
 
45
45
Specify a commit message to use. Useful if the program cannot determine
46
46
a commit message on its own based on debian/changelog, or if you want to
47
47
override the default message.
48
48
 
49
 
=item B<-n> B<--noact>
 
49
=item B<-n>, B<--noact>
50
50
 
51
51
Do not actually do anything, but do print the commands that would be run.
52
52
 
53
 
=item B<-d> B<--diff>
 
53
=item B<-d>, B<--diff>
54
54
 
55
55
Instead of committing, do print the diff of what would have been committed if
56
56
this option were not given. A typical usage scenario of this option is the
57
57
generation of patches against the current working copy (e.g. when you don't have
58
58
commit access right).
59
59
 
60
 
=item B<-C> B<--confirm>
 
60
=item B<-C>, B<--confirm>
61
61
 
62
62
Display the generated commit message and ask for confirmation before committing
63
63
it. It is also possible to edit the message at this stage; in this case, the
64
64
confirmation prompt will be re-displayed after the editing has been performed.
65
65
 
66
 
=item B<-e> B<--edit>
 
66
=item B<-e>, B<--edit>
67
67
 
68
68
Edit the generated commit message in your favorite editor before committing
69
69
it.
70
70
 
71
 
=item B<-a> B<--all>
 
71
=item B<-a>, B<--all>
72
72
 
73
73
Commit all files. This is the default operation when using a VCS other 
74
74
than git.
78
78
Specify which files to commit (debian/changelog is added to the list
79
79
automatically.)
80
80
 
81
 
=item B<-s> B<--strip-message>, B<--no-strip-message>
 
81
=item B<-s>, B<--strip-message>, B<--no-strip-message>
82
82
 
83
83
If this option is set and the commit message has been derived from the 
84
84
changelog, the characters "* " will be stripped from the beginning of 
336
336
    push @files_to_commit, $changelog;
337
337
}
338
338
 
 
339
# Main program
 
340
 
339
341
my $prog=getprog();
340
342
if (! defined $changelog) {
341
343
    die "debcommit: Could not find a Debian changelog\n";
383
385
    tag($version) if $release;
384
386
}
385
387
 
 
388
# End of code, only subs below
 
389
 
386
390
sub getprog {
387
391
    if (-d "debian") {
388
392
        if (-d "debian/.svn") {
523
527
            : action($prog, "commit", "-m", $message, @files_to_commit);
524
528
    }
525
529
    elsif ($prog eq 'git') {
526
 
        if (! @files_to_commit && $all) {
 
530
        if (! @files_to_commit && ($all || $release)) {
527
531
            # check to see if the WC is clean. git-commit would exit
528
 
            # nonzero, so don't run it.
 
532
            # nonzero, so don't run it in --all or --release mode.
529
533
            my $status=`LANG=C git status`;
530
534
            if ($status=~/nothing to commit \(working directory clean\)/) {
531
535
                    print $status;
834
838
    system $command;
835
839
    return ($? >> 8 == 0) ? 1 : 0;
836
840
}
 
841
 
837
842
=head1 LICENSE
838
843
 
839
844
This code is copyright by Joey Hess <joeyh@debian.org>, all rights reserved.