Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
creatensis.pl: retrieve version earlier from CMakeLists.txt for
preremove
  • Loading branch information
jef-n committed Jun 1, 2016
1 parent 56d5046 commit a3a64a1
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions ms-windows/osgeo4w/creatensis.pl
Expand Up @@ -265,6 +265,24 @@ sub getDeps {
chdir "..";
}

my($major, $minor, $patch);

open F, "../../CMakeLists.txt";
while(<F>) {
if(/SET\(CPACK_PACKAGE_VERSION_MAJOR "(\d+)"\)/) {
$major = $1;
} elsif(/SET\(CPACK_PACKAGE_VERSION_MINOR "(\d+)"\)/) {
$minor = $1;
} elsif(/SET\(CPACK_PACKAGE_VERSION_PATCH "(\d+)"\)/) {
$patch = $1;
} elsif(/SET\(RELEASE_NAME "(.+)"\)/) {
$releasename = $1 unless defined $releasename;
}
}
close F;

$version = "$major.$minor.$patch" unless defined $version;

#
# Create postinstall.bat
#
Expand Down Expand Up @@ -337,24 +355,6 @@ sub getDeps {

close F;

my($major, $minor, $patch);

open F, "../../CMakeLists.txt";
while(<F>) {
if(/SET\(CPACK_PACKAGE_VERSION_MAJOR "(\d+)"\)/) {
$major = $1;
} elsif(/SET\(CPACK_PACKAGE_VERSION_MINOR "(\d+)"\)/) {
$minor = $1;
} elsif(/SET\(CPACK_PACKAGE_VERSION_PATCH "(\d+)"\)/) {
$patch = $1;
} elsif(/SET\(RELEASE_NAME "(.+)"\)/) {
$releasename = $1 unless defined $releasename;
}
}
close F;

$version = "$major.$minor.$patch" unless defined $version;

unless( defined $binary ) {
if( -f "binary$archpostfix-$version" ) {
open P, "binary$archpostfix-$version";
Expand Down

0 comments on commit a3a64a1

Please sign in to comment.