Skip to content

Commit a3a64a1

Browse files
committedJun 1, 2016
creatensis.pl: retrieve version earlier from CMakeLists.txt for
preremove
1 parent 56d5046 commit a3a64a1

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed
 

‎ms-windows/osgeo4w/creatensis.pl

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,24 @@ sub getDeps {
265265
chdir "..";
266266
}
267267

268+
my($major, $minor, $patch);
269+
270+
open F, "../../CMakeLists.txt";
271+
while(<F>) {
272+
if(/SET\(CPACK_PACKAGE_VERSION_MAJOR "(\d+)"\)/) {
273+
$major = $1;
274+
} elsif(/SET\(CPACK_PACKAGE_VERSION_MINOR "(\d+)"\)/) {
275+
$minor = $1;
276+
} elsif(/SET\(CPACK_PACKAGE_VERSION_PATCH "(\d+)"\)/) {
277+
$patch = $1;
278+
} elsif(/SET\(RELEASE_NAME "(.+)"\)/) {
279+
$releasename = $1 unless defined $releasename;
280+
}
281+
}
282+
close F;
283+
284+
$version = "$major.$minor.$patch" unless defined $version;
285+
268286
#
269287
# Create postinstall.bat
270288
#
@@ -337,24 +355,6 @@ sub getDeps {
337355

338356
close F;
339357

340-
my($major, $minor, $patch);
341-
342-
open F, "../../CMakeLists.txt";
343-
while(<F>) {
344-
if(/SET\(CPACK_PACKAGE_VERSION_MAJOR "(\d+)"\)/) {
345-
$major = $1;
346-
} elsif(/SET\(CPACK_PACKAGE_VERSION_MINOR "(\d+)"\)/) {
347-
$minor = $1;
348-
} elsif(/SET\(CPACK_PACKAGE_VERSION_PATCH "(\d+)"\)/) {
349-
$patch = $1;
350-
} elsif(/SET\(RELEASE_NAME "(.+)"\)/) {
351-
$releasename = $1 unless defined $releasename;
352-
}
353-
}
354-
close F;
355-
356-
$version = "$major.$minor.$patch" unless defined $version;
357-
358358
unless( defined $binary ) {
359359
if( -f "binary$archpostfix-$version" ) {
360360
open P, "binary$archpostfix-$version";

0 commit comments

Comments
 (0)
Please sign in to comment.