diff --git a/srcpkgs/xbps/patches/fix-missing-sh.patch b/srcpkgs/xbps/patches/fix-missing-sh.patch new file mode 100644 index 00000000000..a916452c286 --- /dev/null +++ b/srcpkgs/xbps/patches/fix-missing-sh.patch @@ -0,0 +1,30 @@ +diff --git lib/package_script.c lib/package_script.c +index a8c05dcf..919f821b 100644 +--- lib/package_script.c ++++ lib/package_script.c +@@ -40,9 +40,10 @@ xbps_pkg_exec_buffer(struct xbps_handle *xhp, + bool update) + { + ssize_t ret; +- const char *tmpdir, *version; ++ const char *tmpdir, *version, *shell; + char *pkgname, *fpath; + int fd, rv; ++ struct stat st; + + assert(blob); + assert(pkgver); +@@ -100,7 +101,12 @@ xbps_pkg_exec_buffer(struct xbps_handle *xhp, + version = xbps_pkg_version(pkgver); + assert(version); + +- rv = xbps_file_exec(xhp, "/bin/sh", fpath, action, pkgname, version, ++ // Fallback ++ shell = "/bin/sh"; ++ if (stat(shell, &st) < 0) { ++ shell = "/bin/dash"; ++ } ++ rv = xbps_file_exec(xhp, shell, fpath, action, pkgname, version, + update ? "yes" : "no", + "no", xhp->native_arch, NULL); + free(pkgname); diff --git a/srcpkgs/xbps/patches/series b/srcpkgs/xbps/patches/series index 88485bb6382..f47146b9d4b 100644 --- a/srcpkgs/xbps/patches/series +++ b/srcpkgs/xbps/patches/series @@ -3,3 +3,4 @@ d72091a20.patch 7b728f5ac.patch 44692f28d8.patch bb96486b127.patch +fix-missing-sh.patch diff --git a/srcpkgs/xbps/template b/srcpkgs/xbps/template index 0fe61aeca75..b1fd0121cba 100644 --- a/srcpkgs/xbps/template +++ b/srcpkgs/xbps/template @@ -1,7 +1,7 @@ # Template file for 'xbps' pkgname=xbps version=0.56 -revision=5 +revision=6 bootstrap=yes build_style=configure short_desc="XBPS package system utilities"