bin/xbps-checkvers: make distdir absolute

Fixes void-linux/xbps#133
This commit is contained in:
Duncan Overbruck 2019-08-05 15:36:25 +02:00
parent e59ded73ae
commit 1d460bc793

View File

@ -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;