]> git.ipfire.org Git - location/debian/libloc-database.git/commitdiff
Update `versionmangle` to handle time in filename
authorValters Jansons <valter.jansons@gmail.com>
Mon, 17 Mar 2025 18:12:09 +0000 (20:12 +0200)
committerValters Jansons <valter.jansons@gmail.com>
Mon, 17 Mar 2025 18:12:09 +0000 (20:12 +0200)
Since 2024-03-19, the database files have a time component in their
filenames. Previously, versionmange handled the date component,
dropping the dashes from 2024-03-19 to 0~20240319. However, now the
time component gets added as a Debian revision, and messes the logic
up. So with this commit the versionmange transforms timestamp into
a similar upstream component, from -03:45 to ~0345.

Upstream filename 2024-03-20-03:45 now becomes 0~20240320~0345,
while retaining 2024-03-19 as 0~20240319 for backwards compatibility.

debian/watch

index 016512aa209f8073c771e654ac27141ad79838bd..ed7967d0aa20918513f4f04cfb628104591b9899 100644 (file)
@@ -1,13 +1,13 @@
 # Automatically importing the new version does not work because mk-origtargz
 # can't handle a single xz compressed file. Use these commands to integrate a new version:
 # uscan
-# unxz ../location-2022-07-06.db.xz
-# mkdir ../libloc-database-0~20220706
-# mv ../location-2022-07-06.db ../libloc-database-0~20220706/location.db
-# tar cJf ../libloc-database_0~20220706.orig.tar.xz ../libloc-database-0~20220706
-# rm -r ../libloc-database-0~20220706
-# gbp import-orig ../libloc-database_0~20220706.orig.tar.xz
+# unxz ../location-2025-03-17-03:45.db.xz
+# mkdir ../libloc-database-0~20250317~0345
+# mv ../location-2025-03-17-03:45.db ../libloc-database-0~20250317~0345/location.db
+# tar cJf ../libloc-database_0~20250317~0345.orig.tar.xz ../libloc-database-0~20250317~0345
+# rm -r ../libloc-database-0~20250317~0345
+# gbp import-orig ../libloc-database_0~20250317~0345.orig.tar.xz
 version=4
-opts="versionmangle=s/(\d+)-(\d+)-(\d+)/0~$1$2$3/" \
+opts="versionmangle=s/-(\d+):(\d+)/~$1$2/;s/(\d+)-(\d+)-(\d+)/0~$1$2$3/" \
 https://location.ipfire.org/databases/1/archive/ \
     location@ANY_VERSION@.db.xz