From b56eb12a1d02584feb32d46eec7a278cf72cffd5 Mon Sep 17 00:00:00 2001 From: Radu Ursu Date: Thu, 26 Feb 2004 07:18:14 +0000 Subject: [PATCH] 26 February 2004 Radu Ursu - replaced set_version_in_config with create_version_file in create_internal_release script. the script creates a new version.h file with every new release --- Packages/Scripts/changes.txt | 5 +++ .../developer_scripts/create_internal_release | 40 +++++++++++-------- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/Packages/Scripts/changes.txt b/Packages/Scripts/changes.txt index d38ee7c5fde..820043eafb2 100644 --- a/Packages/Scripts/changes.txt +++ b/Packages/Scripts/changes.txt @@ -1,3 +1,8 @@ +26 February 2004 Radu Ursu +- replaced set_version_in_config with create_version_file + in create_internal_release script. + the script creates a new version.h file with every new release + 30/01/2004 Sylvain Pion - Remove cgal_submit diff --git a/Packages/Scripts/developer_scripts/create_internal_release b/Packages/Scripts/developer_scripts/create_internal_release index 14be712e985..7e853bad3a0 100755 --- a/Packages/Scripts/developer_scripts/create_internal_release +++ b/Packages/Scripts/developer_scripts/create_internal_release @@ -25,7 +25,7 @@ Exactly one of the options -h or -r must be present. -l lockfile, default is releasedir/release_creation.lock -p packagesfile, default is releasedir/include_in_release - The version number is stored in include/CGAL/config.h. + The version number is stored in include/CGAL/version.h. The RELEASEDIR is the place where the new release will be created. The ALLPACKAGESDIR is the directory that contains the checked out packages from the CVS. Could be a taged version (<>) or some @@ -197,34 +197,40 @@ sub install_packages() { unlink 'temppack.tar', 'description.txt', 'long_description.txt', 'changes.txt', 'submission_info', 'long_description.txt.old'; } + #-----------------------------------------------------------------------# -# set the version information in the include/CGAL/config.h include file.# +# set the version information in the include/CGAL/version.h # #-----------------------------------------------------------------------# -sub set_version_in_config() +sub create_version_file() { chdir "$RELEASEDIR/$VERSION/include/CGAL" or die; - open(SOURCE_FILE, 'tempfile") or die; + +#if VERSION starts with CGAL-, we remove "CGAL-" from version +#the $newver variable will store the right version if ($result = $VERSION =~ /CGAL-(.*)/){ - $newver = $1; + $newver = $1; } else { - $newver = $VERSION; + $newver = $VERSION; } - while ( ) { - s|^\s*\#\s*define\s+CGAL_VERSION\b.*$|#define CGAL_VERSION $newver|; - s|^\s*\#\s*define\s*CGAL_VERSION_NR\b.*$|#define CGAL_VERSION_NR $VERSION_NR|; - print TEMPFILE $_; - } - close SOURCE_FILE || die "Error closing config.h_with_dir: $!"; + + print TEMPFILE << 'EOF'; +// This file is automatically created by create_internal_release. +// Do not edit manually. + +#ifndef CGAL_VERSION_H +#define CGAL_VERSION_H + +EOF + print TEMPFILE "#define CGAL_VERSION $newver\n"; + print TEMPFILE "#define CGAL_VERSION_NR $VERSION_NR\n\n#endif\n"; + close TEMPFILE || die "Error closing temporary file: $!\n"; -# rename($TEMPFILE, 'config.h' ); - system('mv', "tempfile", 'config.h'); -# || warn "Could not update file config.h"; + system('mv', "tempfile", 'version.h'); chdir '../..' or die; } - sub make_src_makefiles(){ chdir "$RELEASEDIR/$VERSION" or die; chdir 'src' or die; @@ -921,7 +927,7 @@ install_packages(); CreateConfigurationTestdir(); CreateDemoTestDirs(); CreateExampleTestDirs(); -set_version_in_config(); +create_version_file(); make_testscripts(); set_file_headers(); make_src_makefiles();