aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoridl0r <idl0r@gentoo.org>2009-09-12 12:01:05 +0000
committeridl0r <idl0r@gentoo.org>2009-09-12 12:01:05 +0000
commitaf1292620c4c09b5fe38ca8d46896cb45af17c7e (patch)
tree25c923d99150537675d612b113dd22e09dff9a72
parentCleanup. (diff)
downloadgentoolkit-af1292620c4c09b5fe38ca8d46896cb45af17c7e.tar.gz
gentoolkit-af1292620c4c09b5fe38ca8d46896cb45af17c7e.tar.bz2
gentoolkit-af1292620c4c09b5fe38ca8d46896cb45af17c7e.zip
Make --strict default, add --no-strict option.
svn path=/trunk/gentoolkit-dev/; revision=683
-rw-r--r--ChangeLog1
-rwxr-xr-xsrc/echangelog/echangelog21
2 files changed, 16 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index a177bd9..9bf9270 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
* src/echangelog/echangelog: Fix bug 284657, thanks to Andrew Gaffney <agaffney@gentoo.org>.
Cleanup VCS detection.
Cleanup.
+ Make --strict default, add --no-strict option.
2009-09-09: Christian Ruppert <idl0r@gentoo.org>
* src/imlate/imlate: Bump to 0.0.4.
diff --git a/src/echangelog/echangelog b/src/echangelog/echangelog
index af4ad8b..8c6aa76 100755
--- a/src/echangelog/echangelog
+++ b/src/echangelog/echangelog
@@ -23,11 +23,13 @@ $Text::Wrap::unexpand = 0;
# Global variables
my (@files, @ebuilds, @conflicts, @trivial, @unknown, @new_versions, %actions);
my ($input, $editor, $entry, $user, $date, $text, $vcs);
-my ($opt_help, $opt_strict, $opt_version);
+my ($opt_help, $opt_nostrict, $opt_version);
$opt_help = 0;
-$opt_strict = 0;
+$opt_nostrict = 0;
$opt_version = 0;
+# DEPRECATED
+my $opt_strict = 0;
my %vcs = (
bzr => {
@@ -78,7 +80,7 @@ sub usage {
Options:
--help err, this screen ...
- --strict abort on trivial/no changes
+ --no-strict do not abort on trivial/no changes
--version show version info
EOF
print $usage;
@@ -184,13 +186,19 @@ sub mypush(\@@) {
GetOptions(
'help' => \$opt_help,
- 'strict' => \$opt_strict,
+ 'no-strict' => \$opt_nostrict,
'version' => \$opt_version,
+ 'strict' => \$opt_strict,
);
usage() if $opt_help;
version() if $opt_version;
+if($opt_strict) {
+ print STDERR "Warning: The option '--strict' has been deprecated and will be removed soon!\n";
+ print STDERR "--strict behaviour is now default.\n";
+}
+
# Figure out what kind of repo we are in.
# Respect $PATH while looking for the VCS
if (getenv("PATH")) {
@@ -585,9 +593,10 @@ unless (@files) {
print STDERR "** modified. Did you forget to $vcs add?\n";
print STDERR "**\n";
- if ($opt_strict) {
+ if (!$opt_nostrict) {
print STDERR "** In strict mode, exiting\n";
- exit 1;
+ print STDERR "** If you know what you're doing there pass '--no-strict' to echangelog\n";
+ exit(1);
}
@files = sort sortfunc @trivial;