void-packages/srcpkgs/xbps/patches/0001-xbps-checkvers-8-fix-manually-added-packages-as-argu.patch

40 lines
1.3 KiB
Diff

From acb00d52e48ad6486c1dccc6cfa26ce57370a8b9 Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Sat, 7 Mar 2015 09:11:12 +0100
Subject: [PATCH] xbps-checkvers(8): fix manually added packages as arguments.
Regression introduced in the 0.44 changes.
---
bin/xbps-checkvers/main.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/bin/xbps-checkvers/main.c b/bin/xbps-checkvers/main.c
index 5a6ac65..a57b370 100644
--- bin/xbps-checkvers/main.c
+++ bin/xbps-checkvers/main.c
@@ -589,6 +589,7 @@ rcv_check_version(rcv_t *rcv)
xbps_dictionary_get_cstring_nocopy(rcv->pkgd, "pkgver", &repover);
+
if (repover == NULL && (rcv->show_missing || rcv->manual )) {
printf("pkgname: %.*s repover: ? srcpkgver: %s\n",
(int)pkgname.v.len, pkgname.v.s, srcver+pkgname.v.len+1);
@@ -732,7 +733,13 @@ main(int argc, char **argv)
for (i = 0; i < argc; i++) {
tmpl = argv[i] + (strlen(argv[i]) - strlen("template"));
if ((strcmp("template", tmpl)) == 0) {
- rcv_process_file(&rcv, argv[i], rcv_check_version);
+ /* strip "srcpkgs/" prefix if found */
+ if (strncmp(argv[i], "srcpkgs/", 8) == 0)
+ tmpl = strchr(argv[i], '/') + 1;
+ else
+ tmpl = argv[i];
+
+ rcv_process_file(&rcv, tmpl, rcv_check_version);
}
}
rcv_end(&rcv);
--
2.3.1