You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2016/01/26 13:27:18 UTC
[1/2] lucy-clownfish git commit: Add support for CPAN developer
releases
Repository: lucy-clownfish
Updated Branches:
refs/heads/master 1893bc788 -> 9fd7fb5bf
Add support for CPAN developer releases
Now the "update_version" script can be used to set CPAN developer
versions containing an underscore.
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/4e0508aa
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/4e0508aa
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/4e0508aa
Branch: refs/heads/master
Commit: 4e0508aa778b4c5d2fc313f007cea958e4094ee0
Parents: 1893bc7
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Thu Jan 21 18:21:48 2016 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Tue Jan 26 12:48:41 2016 +0100
----------------------------------------------------------------------
devel/bin/update_version | 31 ++++++++++++++++++++++---------
1 file changed, 22 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/4e0508aa/devel/bin/update_version
----------------------------------------------------------------------
diff --git a/devel/bin/update_version b/devel/bin/update_version
index dc01d4b..6df810d 100755
--- a/devel/bin/update_version
+++ b/devel/bin/update_version
@@ -26,18 +26,29 @@ my $usage = "$0 version\n";
my $version = shift(@ARGV) or die $usage;
# standardize version strings
-my ( $x, $y, $z );
+my ( $x, $y, $z, $dev );
if ( $version =~ m/^(\d+)\.(\d+)\.(\d+)$/ ) {
( $x, $y, $z ) = ( $1, $2, $3 );
}
+elsif ( $version =~ m/^(\d+)\.(\d+)\.(\d+)_(\d+)$/ ) {
+ ( $x, $y, $z, $dev ) = ( $1, $2, $3, $4 );
+}
elsif ( $version =~ m/^(\d+)\.(\d\d\d)(\d\d\d)$/ ) {
( $x, $y, $z ) = ( int($1), int($2), int($3) );
}
+elsif ( $version =~ m/^(\d+)\.(\d\d\d)(\d\d\d)_(\d\d\d)$/ ) {
+ ( $x, $y, $z, $dev ) = ( int($1), int($2), int($3), int($4) );
+}
else {
die "Unknown version syntax. Try X.Y.Z or X.YYYZZZ\n";
}
-my $x_y_z_version = sprintf( "%d.%d.%d", $x, $y, $z );
-my $x_yyyzzz_version = sprintf( "%d.%03d%03d", $x, $y, $z );
+my $x_y_z_version = sprintf( "%d.%d.%d", $x, $y, $z );
+my $x_y_z_d_version = $dev
+ ? sprintf( "%d.%d.%d_%d", $x, $y, $z, $dev )
+ : sprintf( "%d.%d.%d", $x, $y, $z );
+my $x_yyyzzz_version = $dev
+ ? sprintf( "%d.%03d%03d_%03d", $x, $y, $z, $dev )
+ : sprintf( "%d.%03d%03d", $x, $y, $z );
print "Using version: $x_y_z_version ( $x_yyyzzz_version )\n";
@@ -57,7 +68,7 @@ for my $path ('runtime/common/charmonizer.c', 'runtime/common/charmonizer.main')
$buf = read_file('compiler/perl/lib/Clownfish/CFC.pm');
$buf =~ s/(our \$VERSION\ +=\ +)'.+?'/$1'$x_yyyzzz_version'/g
or die "no match";
-$buf =~ s/XSLoader::load\( 'Clownfish::CFC', '(.+?)'/XSLoader::load\( 'Clownfish::CFC', '$x_y_z_version'/
+$buf =~ s/XSLoader::load\( 'Clownfish::CFC', '(.+?)'/XSLoader::load\( 'Clownfish::CFC', '$x_y_z_d_version'/
or die "no match";
write_file( 'compiler/perl/lib/Clownfish/CFC.pm', $buf );
@@ -65,27 +76,27 @@ write_file( 'compiler/perl/lib/Clownfish/CFC.pm', $buf );
$buf = read_file('runtime/perl/lib/Clownfish.pm');
$buf =~ s/(our \$VERSION\ +=\ +)'.+?'/$1'$x_yyyzzz_version'/g
or die "no match";
-$buf =~ s/(bootstrap Clownfish ')(.+?)'/$1$x_y_z_version'/
+$buf =~ s/(bootstrap Clownfish ')(.+?)'/$1$x_y_z_d_version'/
or die "no match";
-$buf =~ s/^\d+\.\d+\.\d+\b$/$x_y_z_version/m
+$buf =~ s/^\d+\.\d+\.\d+(_\d+)?\b$/$x_y_z_d_version/m
or die "no match";
write_file( 'runtime/perl/lib/Clownfish.pm', $buf );
# Update Clownfish.pod.
$buf = read_file('runtime/perl/lib/Clownfish.pod');
-$buf =~ s/(^=head1\s+VERSION\s+)([\d.]+)/$1$x_y_z_version/m
+$buf =~ s/(^=head1\s+VERSION\s+)([\d._]+)/$1$x_y_z_d_version/m
or die "no match";
write_file( 'runtime/perl/lib/Clownfish.pod', $buf );
# Update compiler Build.PL
$buf = read_file('compiler/perl/Build.PL');
-$buf =~ s/(dist_version\ +=>\ +)'.+?'/$1'$x_y_z_version'/
+$buf =~ s/(dist_version\ +=>\ +)'.+?'/$1'$x_y_z_d_version'/
or die "no match";
write_file( 'compiler/perl/Build.PL', $buf );
# Update runtime Build.PL
$buf = read_file('runtime/perl/Build.PL');
-$buf =~ s/(dist_version\ +=>\ +)'.+?'/$1'$x_y_z_version'/
+$buf =~ s/(dist_version\ +=>\ +)'.+?'/$1'$x_y_z_d_version'/
or die "no match";
$buf =~ s/(Clownfish::CFC::Perl::Build'\s*=>\s*)(.*?),/$1$x_yyyzzz_version,/g
or die "no match";
@@ -180,7 +191,9 @@ depending on the file format and type.
I<version> may be specified in either format:
X.Y.Z
+ X.Y.Z_D (CPAN developer release)
X.YYYZZZ
+ X.YYYZZZ_DDD (CPAN developer release)
and update_version will convert the specified string into the
correct format for each relevant file.
[2/2] lucy-clownfish git commit: Regenerate charmonizer.c to fix OS
detection
Posted by nw...@apache.org.
Regenerate charmonizer.c to fix OS detection
Fixes CLOWNFISH-3.
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/9fd7fb5b
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/9fd7fb5b
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/9fd7fb5b
Branch: refs/heads/master
Commit: 9fd7fb5bf4d7230e83d8025360948d69ccb03390
Parents: 4e0508a
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Tue Jan 26 13:00:00 2016 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Tue Jan 26 13:00:00 2016 +0100
----------------------------------------------------------------------
compiler/common/charmonizer.c | 30 ++++++++++++++++++------------
runtime/common/charmonizer.c | 30 ++++++++++++++++++------------
2 files changed, 36 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/9fd7fb5b/compiler/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/compiler/common/charmonizer.c b/compiler/common/charmonizer.c
index fc8833e..cf724af 100644
--- a/compiler/common/charmonizer.c
+++ b/compiler/common/charmonizer.c
@@ -5307,8 +5307,20 @@ chaz_OS_init(void) {
printf("Trying to find a bit-bucket a la /dev/null...\n");
}
- /* Detect shell based on whether the bitbucket is "/dev/null" or "nul". */
- if (chaz_Util_can_open_file("/dev/null")) {
+ /* Detect shell based on whether the bitbucket is "/dev/null" or "nul".
+ * Start with "nul" as some Windows boxes seem to have a "/dev/null".
+ */
+ if (chaz_Util_can_open_file("nul")) {
+ strcpy(chaz_OS.name, "windows");
+ strcpy(chaz_OS.dev_null, "nul");
+ strcpy(chaz_OS.dir_sep, "\\");
+ strcpy(chaz_OS.exe_ext, ".exe");
+ strcpy(chaz_OS.shared_lib_ext, ".dll");
+ strcpy(chaz_OS.static_lib_ext, ".lib");
+ strcpy(chaz_OS.local_command_start, ".\\");
+ chaz_OS.shell_type = CHAZ_OS_CMD_EXE;
+ }
+ else if (chaz_Util_can_open_file("/dev/null")) {
char *uname;
size_t uname_len;
size_t i;
@@ -5341,20 +5353,14 @@ chaz_OS_init(void) {
}
strcpy(chaz_OS.local_command_start, "./");
}
- else if (chaz_Util_can_open_file("nul")) {
- strcpy(chaz_OS.name, "windows");
- strcpy(chaz_OS.dev_null, "nul");
- strcpy(chaz_OS.dir_sep, "\\");
- strcpy(chaz_OS.exe_ext, ".exe");
- strcpy(chaz_OS.shared_lib_ext, ".dll");
- strcpy(chaz_OS.static_lib_ext, ".lib");
- strcpy(chaz_OS.local_command_start, ".\\");
- chaz_OS.shell_type = CHAZ_OS_CMD_EXE;
- }
else {
/* Bail out because we couldn't find anything like /dev/null. */
chaz_Util_die("Couldn't find anything like /dev/null");
}
+
+ if (chaz_Util_verbosity) {
+ printf("Detected OS: %s\n", chaz_OS.name);
+ }
}
const char*
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/9fd7fb5b/runtime/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/runtime/common/charmonizer.c b/runtime/common/charmonizer.c
index b062d94..c0a75ad 100644
--- a/runtime/common/charmonizer.c
+++ b/runtime/common/charmonizer.c
@@ -5307,8 +5307,20 @@ chaz_OS_init(void) {
printf("Trying to find a bit-bucket a la /dev/null...\n");
}
- /* Detect shell based on whether the bitbucket is "/dev/null" or "nul". */
- if (chaz_Util_can_open_file("/dev/null")) {
+ /* Detect shell based on whether the bitbucket is "/dev/null" or "nul".
+ * Start with "nul" as some Windows boxes seem to have a "/dev/null".
+ */
+ if (chaz_Util_can_open_file("nul")) {
+ strcpy(chaz_OS.name, "windows");
+ strcpy(chaz_OS.dev_null, "nul");
+ strcpy(chaz_OS.dir_sep, "\\");
+ strcpy(chaz_OS.exe_ext, ".exe");
+ strcpy(chaz_OS.shared_lib_ext, ".dll");
+ strcpy(chaz_OS.static_lib_ext, ".lib");
+ strcpy(chaz_OS.local_command_start, ".\\");
+ chaz_OS.shell_type = CHAZ_OS_CMD_EXE;
+ }
+ else if (chaz_Util_can_open_file("/dev/null")) {
char *uname;
size_t uname_len;
size_t i;
@@ -5341,20 +5353,14 @@ chaz_OS_init(void) {
}
strcpy(chaz_OS.local_command_start, "./");
}
- else if (chaz_Util_can_open_file("nul")) {
- strcpy(chaz_OS.name, "windows");
- strcpy(chaz_OS.dev_null, "nul");
- strcpy(chaz_OS.dir_sep, "\\");
- strcpy(chaz_OS.exe_ext, ".exe");
- strcpy(chaz_OS.shared_lib_ext, ".dll");
- strcpy(chaz_OS.static_lib_ext, ".lib");
- strcpy(chaz_OS.local_command_start, ".\\");
- chaz_OS.shell_type = CHAZ_OS_CMD_EXE;
- }
else {
/* Bail out because we couldn't find anything like /dev/null. */
chaz_Util_die("Couldn't find anything like /dev/null");
}
+
+ if (chaz_Util_verbosity) {
+ printf("Detected OS: %s\n", chaz_OS.name);
+ }
}
const char*