summaryrefslogtreecommitdiff
path: root/src/third_party/timelib-2022.02/zones/update-package-version.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/timelib-2022.02/zones/update-package-version.php')
-rw-r--r--src/third_party/timelib-2022.02/zones/update-package-version.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/third_party/timelib-2022.02/zones/update-package-version.php b/src/third_party/timelib-2022.02/zones/update-package-version.php
new file mode 100644
index 00000000000..6fb25521586
--- /dev/null
+++ b/src/third_party/timelib-2022.02/zones/update-package-version.php
@@ -0,0 +1,13 @@
+<?php
+$e = file_get_contents( $argv[1] . '/php_timezonedb.h' );
+
+/* Grab version info */
+$version_info = file( 'version-info.txt' );
+$tzversion = trim( $version_info[0] );
+$version = trim( $version_info[1] );
+
+/* Use preg_replace to update version in package.xml */
+$f = preg_replace( '@"20[0-2][0-9].*"@', "\"{$version}\"", $e );
+
+file_put_contents( $argv[1] . '/php_timezonedb.h', $f );
+?>