Gentoo Archives: gentoo-commits

From: "Christian Ruppert (idl0r)" <idl0r@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoolkit r738 - in trunk/gentoolkit-dev: . src/echangelog
Date: Tue, 02 Feb 2010 18:26:16
Message-Id: E1NcNS1-0008CD-JB@stork.gentoo.org
1 Author: idl0r
2 Date: 2010-02-02 18:26:13 +0000 (Tue, 02 Feb 2010)
3 New Revision: 738
4
5 Modified:
6 trunk/gentoolkit-dev/ChangeLog
7 trunk/gentoolkit-dev/src/echangelog/echangelog
8 Log:
9 echangelog: Add --vcs switch to specify the vcs without
10 autodetection as requested per bug 302784, thanks to Martin von Gagern
11 <Martin.vGagern@×××.net>. Sort the VCS during autodetection.
12
13
14 Modified: trunk/gentoolkit-dev/ChangeLog
15 ===================================================================
16 --- trunk/gentoolkit-dev/ChangeLog 2010-02-02 17:06:55 UTC (rev 737)
17 +++ trunk/gentoolkit-dev/ChangeLog 2010-02-02 18:26:13 UTC (rev 738)
18 @@ -1,3 +1,8 @@
19 +2010-02-02: Christian Ruppert <idl0r@g.o>
20 + src/echangelog/echangelog: Add --vcs switch to specify the vcs without
21 + autodetection as requested per bug 302784, thanks to Martin von Gagern
22 + <Martin.vGagern@×××.net>. Sort the VCS during autodetection.
23 +
24 2010-01-02: Christian Ruppert <idl0r@g.o>
25 src/echangelog/echangelog: Improve vcs detection, might fix bug 302784 as
26 well.
27
28 Modified: trunk/gentoolkit-dev/src/echangelog/echangelog
29 ===================================================================
30 --- trunk/gentoolkit-dev/src/echangelog/echangelog 2010-02-02 17:06:55 UTC (rev 737)
31 +++ trunk/gentoolkit-dev/src/echangelog/echangelog 2010-02-02 18:26:13 UTC (rev 738)
32 @@ -23,7 +23,7 @@
33 # Global variables
34 my (@files, @ebuilds, @conflicts, @trivial, @unknown, @new_versions, %actions);
35 my ($input, $editor, $entry, $user, $date, $text, $vcs);
36 -my ($opt_help, $opt_nostrict, $opt_version);
37 +my ($opt_help, $opt_nostrict, $opt_force_vcs, $opt_version);
38
39 $opt_help = 0;
40 $opt_nostrict = 0;
41 @@ -86,7 +86,11 @@
42 Options:
43 --help err, this screen ...
44 --no-strict do not abort on trivial/no changes
45 + --vcs <vcs> skip vcs autodetection and use the specified vcs instead
46 + for a list of supported version control systems see below
47 --version show version info
48 +
49 + Supported VCS: bzr, cvs, git, hg, svn
50 EOF
51 print $usage;
52 exit 0;
53 @@ -207,7 +211,8 @@
54 GetOptions(
55 'help' => \$opt_help,
56 'no-strict' => \$opt_nostrict,
57 - 'version' => \$opt_version,
58 + 'vcs=s' => \$opt_force_vcs,
59 + 'version|v' => \$opt_version,
60 'strict' => \$opt_strict,
61 );
62
63 @@ -221,17 +226,22 @@
64
65 # Figure out what kind of repo we are in.
66 # Respect $PATH while looking for the VCS
67 -if (getenv("PATH")) {
68 - foreach my $path ( split(":", getenv("PATH")) ) {
69 - foreach my $_vcs (keys(%vcs)) {
70 - if ( -X "${path}/${_vcs}" ) {
71 - $vcs = $_vcs if check_vcs_dir($vcs{$_vcs}{directory});
72 - last if $vcs;
73 +if(! defined($opt_force_vcs)) {
74 + if (getenv("PATH")) {
75 + foreach my $path ( split(":", getenv("PATH")) ) {
76 + foreach my $_vcs (sort(keys(%vcs))) {
77 + if ( -X "${path}/${_vcs}" ) {
78 + $vcs = $_vcs if check_vcs_dir($vcs{$_vcs}{directory});
79 + last if $vcs;
80 + }
81 }
82 + last if $vcs;
83 }
84 - last if $vcs;
85 }
86 }
87 +else {
88 + $vcs = $opt_force_vcs if defined $vcs{$opt_force_vcs};
89 +}
90
91 if ( ! $vcs ) {
92 print STDERR "Either no CVS, .git, .svn, ... directories found, the specific VCS has not been\n";