From 1d460bc79344d0b13099d613665bf535b709076e Mon Sep 17 00:00:00 2001 From: Duncan Overbruck Date: Mon, 5 Aug 2019 15:36:25 +0200 Subject: [PATCH] bin/xbps-checkvers: make distdir absolute Fixes void-linux/xbps#133 --- bin/xbps-checkvers/main.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/xbps-checkvers/main.c b/bin/xbps-checkvers/main.c index d792e008..b5ab9500 100644 --- a/bin/xbps-checkvers/main.c +++ b/bin/xbps-checkvers/main.c @@ -706,6 +706,17 @@ main(int argc, char **argv) */ if (rcv.distdir == NULL) rcv.distdir = xbps_xasprintf("%s/void-packages", getenv("HOME")); + + { + char *tmp = rcv.distdir; + rcv.distdir = realpath(tmp, NULL); + if (rcv.distdir == NULL) { + fprintf(stderr, "Error: realpath(%s): %s\n", tmp, strerror(errno)); + exit(1); + } + free(tmp); + } + rcv.cachefile = xbps_xasprintf("%s/.xbps-checkvers.plist", rcv.distdir); argc -= optind;