xbps{,-static}: sync with git master for alternatives bugfixes.
This commit is contained in:
parent
05c7da7955
commit
568bc96981
3 changed files with 47 additions and 43 deletions
|
@ -3,7 +3,7 @@
|
||||||
# NOTE: keep this package synchronized with "srcpkgs/xbps".
|
# NOTE: keep this package synchronized with "srcpkgs/xbps".
|
||||||
pkgname=xbps-static
|
pkgname=xbps-static
|
||||||
version=0.50
|
version=0.50
|
||||||
revision=3
|
revision=4
|
||||||
build_style=configure
|
build_style=configure
|
||||||
short_desc="The XBPS package system utilities - static binaries"
|
short_desc="The XBPS package system utilities - static binaries"
|
||||||
maintainer="Juan RP <xtraeme@voidlinux.eu>"
|
maintainer="Juan RP <xtraeme@voidlinux.eu>"
|
||||||
|
|
|
@ -1,19 +1,5 @@
|
||||||
From b3c7d27c6b9ffddda9914a9110680df91c6b17ff Mon Sep 17 00:00:00 2001
|
|
||||||
From: Juan RP <xtraeme@voidlinux.eu>
|
|
||||||
Date: Sat, 14 Nov 2015 07:26:27 +0100
|
|
||||||
Subject: [PATCH 1/2] alternatives: fix creation of symlinks with unexistent
|
|
||||||
dirs.
|
|
||||||
|
|
||||||
If an alternative needs to create /usr/bin/foo, and /usr/bin
|
|
||||||
does not exist, this directory must be created prior to create
|
|
||||||
the symlink.
|
|
||||||
---
|
|
||||||
lib/package_alternatives.c | 24 +++++++++++++++++++++++-
|
|
||||||
tests/xbps/xbps-alternatives/main.sh | 8 ++++----
|
|
||||||
2 files changed, 27 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/lib/package_alternatives.c b/lib/package_alternatives.c
|
diff --git a/lib/package_alternatives.c b/lib/package_alternatives.c
|
||||||
index e4d94e3..510b536 100644
|
index e4d94e3..08a8e5b 100644
|
||||||
--- lib/package_alternatives.c
|
--- lib/package_alternatives.c
|
||||||
+++ lib/package_alternatives.c
|
+++ lib/package_alternatives.c
|
||||||
@@ -150,7 +150,7 @@ create_symlinks(struct xbps_handle *xhp, xbps_array_t a, const char *grname)
|
@@ -150,7 +150,7 @@ create_symlinks(struct xbps_handle *xhp, xbps_array_t a, const char *grname)
|
||||||
|
@ -25,21 +11,42 @@ index e4d94e3..510b536 100644
|
||||||
char *l, *lnk, *tgt = NULL;
|
char *l, *lnk, *tgt = NULL;
|
||||||
const char *tgt0;
|
const char *tgt0;
|
||||||
int rv;
|
int rv;
|
||||||
@@ -171,12 +171,34 @@ create_symlinks(struct xbps_handle *xhp, xbps_array_t a, const char *grname)
|
@@ -164,19 +164,44 @@ create_symlinks(struct xbps_handle *xhp, xbps_array_t a, const char *grname)
|
||||||
xbps_dbg_printf(xhp, "failed to create symlink"
|
tgt_dup = strdup(tgt0);
|
||||||
"target dir '%s' for group '%s': %s\n",
|
assert(tgt_dup);
|
||||||
tgt, grname, strerror(errno));
|
tgt_dir = dirname(tgt_dup);
|
||||||
|
- tgt = xbps_xasprintf("%s%s", xhp->rootdir, tgt_dir);
|
||||||
|
- if (xbps_mkpath(tgt, 0755) != 0) {
|
||||||
|
- if (errno != EEXIST) {
|
||||||
|
- rv = errno;
|
||||||
|
- xbps_dbg_printf(xhp, "failed to create symlink"
|
||||||
|
- "target dir '%s' for group '%s': %s\n",
|
||||||
|
- tgt, grname, strerror(errno));
|
||||||
|
- free(tgt);
|
||||||
|
- free(l);
|
||||||
|
- return rv;
|
||||||
|
+ if (strcmp(tgt_dir, ".")) {
|
||||||
|
+ tgt = xbps_xasprintf("%s%s", xhp->rootdir, tgt_dir);
|
||||||
|
+ if (xbps_mkpath(tgt, 0755) != 0) {
|
||||||
|
+ if (errno != EEXIST) {
|
||||||
|
+ rv = errno;
|
||||||
|
+ xbps_dbg_printf(xhp, "failed to create "
|
||||||
|
+ "target dir '%s' for group '%s': %s\n",
|
||||||
|
+ tgt, grname, strerror(errno));
|
||||||
+ free(tgt_dup);
|
+ free(tgt_dup);
|
||||||
free(tgt);
|
+ free(tgt);
|
||||||
free(l);
|
+ free(l);
|
||||||
return rv;
|
+ return rv;
|
||||||
|
+ }
|
||||||
}
|
}
|
||||||
|
+ free(tgt);
|
||||||
}
|
}
|
||||||
free(tgt);
|
- free(tgt);
|
||||||
+ /* always create link dir, for dangling symlinks */
|
+ /* always create link dir, for dangling symlinks */
|
||||||
+ lnk_dup = strdup(l);
|
+ lnk_dup = strdup(l);
|
||||||
+ assert(lnk_dup);
|
+ assert(lnk_dup);
|
||||||
+ lnk_dir = dirname(lnk_dup);
|
+ lnk_dir = dirname(lnk_dup);
|
||||||
|
+ if (strcmp(lnk_dir, ".")) {
|
||||||
+ lnk = xbps_xasprintf("%s%s", xhp->rootdir, lnk_dir);
|
+ lnk = xbps_xasprintf("%s%s", xhp->rootdir, lnk_dir);
|
||||||
+ if (xbps_mkpath(lnk, 0755) != 0) {
|
+ if (xbps_mkpath(lnk, 0755) != 0) {
|
||||||
+ if (errno != EEXIST) {
|
+ if (errno != EEXIST) {
|
||||||
|
@ -48,7 +55,6 @@ index e4d94e3..510b536 100644
|
||||||
+ "dir '%s' for group '%s': %s\n",
|
+ "dir '%s' for group '%s': %s\n",
|
||||||
+ lnk, grname, strerror(errno));
|
+ lnk, grname, strerror(errno));
|
||||||
+ free(tgt_dup);
|
+ free(tgt_dup);
|
||||||
+ free(tgt);
|
|
||||||
+ free(lnk_dup);
|
+ free(lnk_dup);
|
||||||
+ free(lnk);
|
+ free(lnk);
|
||||||
+ free(l);
|
+ free(l);
|
||||||
|
@ -56,6 +62,7 @@ index e4d94e3..510b536 100644
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ free(lnk);
|
+ free(lnk);
|
||||||
|
+ }
|
||||||
+ free(lnk_dup);
|
+ free(lnk_dup);
|
||||||
|
|
||||||
if (l[0] != '/') {
|
if (l[0] != '/') {
|
||||||
|
@ -86,6 +93,3 @@ index e636894..facd290 100644
|
||||||
rv=0
|
rv=0
|
||||||
fi
|
fi
|
||||||
echo "A lnk: $lnk"
|
echo "A lnk: $lnk"
|
||||||
--
|
|
||||||
2.6.3
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Template file for 'xbps'
|
# Template file for 'xbps'
|
||||||
pkgname=xbps
|
pkgname=xbps
|
||||||
version=0.50
|
version=0.50
|
||||||
revision=3
|
revision=4
|
||||||
bootstrap=yes
|
bootstrap=yes
|
||||||
build_style=configure
|
build_style=configure
|
||||||
short_desc="The XBPS package system utilities"
|
short_desc="The XBPS package system utilities"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue