diff --git a/srcpkgs/xbps/patches/xbps-create-unexistent-target-symlink-assert.patch b/srcpkgs/xbps/patches/xbps-create-unexistent-target-symlink-assert.patch new file mode 100644 index 0000000000..8daba35162 --- /dev/null +++ b/srcpkgs/xbps/patches/xbps-create-unexistent-target-symlink-assert.patch @@ -0,0 +1,39 @@ +commit 42c21e1c3c0fbc98b56bedbc63022c5e086feb40 +Author: Juan RP +Date: Thu Oct 4 09:40:52 2012 +0200 + + xbps-create: if a symlink points to an unexistent file store symlink target as is. + + Seen in recent builds when building the systemd binpkg: + + [chroot] => Building systemd-194_1.x86_64.xbps... + xbps-create.real: main.c:219: ftw_cb: Assertion `p' failed. + + Which was asserting in a symlink that was pointing to a file provided by the udev + pkg, therefore realpath(3) failed. + +diff --git a/bin/xbps-create/main.c b/bin/xbps-create/main.c +index 2a098ca..beb79df 100644 +--- bin/xbps-create/main.c ++++ bin/xbps-create/main.c +@@ -216,9 +216,17 @@ ftw_cb(const char *fpath, const struct stat *sb, int type, struct FTW *ftwbuf) + */ + if (strncmp(buf, "../", 3) == 0) { + p = realpath(fpath, NULL); +- assert(p); +- xe->target = strdup(p + strlen(destdir)); +- free(p); ++ if (p == NULL) { ++ /* ++ * This symlink points to an unexistent file, ++ * which might be provided in another package. ++ * So let's use the same target. ++ */ ++ xe->target = strdup(buf); ++ } else { ++ xe->target = strdup(p + strlen(destdir)); ++ free(p); ++ } + } else if (strchr(buf, '/') == NULL) { + p = strdup(filep); + assert(p); diff --git a/srcpkgs/xbps/template b/srcpkgs/xbps/template index 52f8f21566..61323ca781 100644 --- a/srcpkgs/xbps/template +++ b/srcpkgs/xbps/template @@ -1,7 +1,7 @@ # Template file for 'xbps' pkgname=xbps version=0.17 -revision=1 +revision=2 build_style=configure configure_args="--prefix=/ --exec-prefix=/usr --sbindir=/usr/sbin --with-tests --with-static" depends="xbps-triggers"