[open-ils-commits] [GIT] Evergreen ILS branch master updated. c58587837f40948650c71823818b60c5239ef5d9
Evergreen Git
git at git.evergreen-ils.org
Tue May 24 22:29:35 EDT 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via c58587837f40948650c71823818b60c5239ef5d9 (commit)
via c81793be60b63195bb712927d16672bd919a97f5 (commit)
from 38e65097b64be3cd141c6807655bf570fc9bc094 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c58587837f40948650c71823818b60c5239ef5d9
Author: Galen Charlton <gmc at esilibrary.com>
Date: Tue May 24 22:29:39 2011 -0400
trival whitespace cleanup
Signed-off-by: Galen Charlton <gmc at esilibrary.com>
diff --git a/Open-ILS/src/sql/Pg/make-db-patch.pl b/Open-ILS/src/sql/Pg/make-db-patch.pl
index 13c8511..c74fd16 100755
--- a/Open-ILS/src/sql/Pg/make-db-patch.pl
+++ b/Open-ILS/src/sql/Pg/make-db-patch.pl
@@ -40,7 +40,7 @@ GetOptions(
) or exit_usage();
exit_usage('--num cannot be used with --nonum') if ($db_patch_nonum && defined $db_patch_num);
-$db_patch_num = 'XXXX' if($db_patch_nonum);
+$db_patch_num = 'XXXX' if ($db_patch_nonum);
exit_usage('--num or --nonum required') unless defined $db_patch_num;
exit_usage('--name required') unless defined $patch_name;
commit c81793be60b63195bb712927d16672bd919a97f5
Author: Thomas Berezansky <tsbere at mvlc.org>
Date: Tue May 24 22:11:10 2011 -0400
Add --nonum to make-db-patch
Makes XXXX.* files.
Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
Signed-off-by: Galen Charlton <gmc at esilibrary.com>
diff --git a/Open-ILS/src/sql/Pg/make-db-patch.pl b/Open-ILS/src/sql/Pg/make-db-patch.pl
index 8a57150..13c8511 100755
--- a/Open-ILS/src/sql/Pg/make-db-patch.pl
+++ b/Open-ILS/src/sql/Pg/make-db-patch.pl
@@ -21,6 +21,7 @@ use warnings;
use Getopt::Long;
my $db_patch_num;
+my $db_patch_nonum;
my $patch_name;
my $patch_from;
my $patch_wrap;
@@ -30,6 +31,7 @@ my @supersedes;
exit_usage() if $#ARGV == -1;
GetOptions(
'num=i' => \$db_patch_num,
+ 'nonum' => \$db_patch_nonum,
'name=s' => \$patch_name,
'from=s' => \$patch_from,
'wrap=s' => \$patch_wrap,
@@ -37,31 +39,42 @@ GetOptions(
'supersedes=i' => \@supersedes,
) or exit_usage();
-exit_usage('--num required') unless defined $db_patch_num;
+exit_usage('--num cannot be used with --nonum') if ($db_patch_nonum && defined $db_patch_num);
+$db_patch_num = 'XXXX' if($db_patch_nonum);
+exit_usage('--num or --nonum required') unless defined $db_patch_num;
exit_usage('--name required') unless defined $patch_name;
$patch_from = 'HEAD' unless defined $patch_from;
# pad to four digits
-$db_patch_num = sprintf('%-04.4d', $db_patch_num);
+$db_patch_num = sprintf('%-04.4d', $db_patch_num) unless $db_patch_nonum ;
$_ = sprintf('%-04.4d', $_) foreach @deprecates;
$_ = sprintf('%-04.4d', $_) foreach @supersedes;
-# basic sanity checks
-my @existing = glob("upgrade/$db_patch_num.*");
-if (@existing) {
- print "Error: $db_patch_num is already used by $existing[0]\n";
- exit(1);
-}
-foreach my $dep (@deprecates) {
- if ($dep gt $db_patch_num) {
- print "Error: deprecated patch $dep has a higher patch number than $db_patch_num\n";
+if($db_patch_num ne 'XXXX') {
+ # basic sanity checks
+ my @existing = glob("upgrade/$db_patch_num.*");
+ if (@existing) {
+ print "Error: $db_patch_num is already used by $existing[0]\n";
exit(1);
}
+ foreach my $dep (@deprecates) {
+ if ($dep gt $db_patch_num) {
+ print "Error: deprecated patch $dep has a higher patch number than $db_patch_num\n";
+ exit(1);
+ }
+ }
+ foreach my $sup (@supersedes) {
+ if ($sup gt $db_patch_num) {
+ print "Error: superseded patch $sup has a higher patch number than $db_patch_num\n";
+ exit(1);
+ }
+ }
}
-foreach my $sup (@supersedes) {
- if ($sup gt $db_patch_num) {
- print "Error: superseded patch $sup has a higher patch number than $db_patch_num\n";
+else {
+ if ( -e "upgrade/XXXX.$patch_name.sql" ) {
+ print "Error: upgrade/XXXX.$patch_name.sql already exists\n";
+ print "Either remove the existing file or pick a new --name\n";
exit(1);
}
}
@@ -125,6 +138,7 @@ usage: $0 --num <patch_num> --name <patch_name> [--deprecates <num1>] [--superse
Make template for a DB patch SQL file.
--num DB patch number
+ --nonum Versionless
--name descriptive part of patch filename
--deprecates patch(es) deprecated by this update
--supersedes patch(es) superseded by this update
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/sql/Pg/make-db-patch.pl | 42 ++++++++++++++++++++++-----------
1 files changed, 28 insertions(+), 14 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list