From: sgn <sgn@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] xbps-src: retire XBPS_PKGDESTDIR
Date: Sat, 03 Jul 2021 06:03:24 +0200 [thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-31772@inbox.vuxu.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 2007 bytes --]
There is a new pull request by sgn against master on the void-packages repository
https://github.com/sgn/void-packages retire-XBPS_PKGDESTDIR
https://github.com/void-linux/void-packages/pull/31772
xbps-src: retire XBPS_PKGDESTDIR
Historically, PKGDESTDIR was only set during pkg_install, and
XBPS_PKGDESTDIR was set to indicate that we're in subpkg's
pkg_install.
However, from 0b95cb8f5d, (Merge xbps-src code to make it usable in
a standalone mode., 2014-03-22), PKGDESTDIR is always set,
regardless of states.
Let's drop all usages of XBPS_PKGDESTDIR.
While we're at it, error out of vmove is used outside of subpkg.
<!-- Mark items with [x] where applicable -->
#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)
#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR
<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!--
#### Does it build and run successfully?
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
- [ ] aarch64-musl
- [ ] armv7l
- [ ] armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/31772.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-retire-XBPS_PKGDESTDIR-31772.patch --]
[-- Type: text/x-diff, Size: 5294 bytes --]
From b038dacf8acaab2f4e3aa9f011cd8defb855b7f9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
<congdanhqx@gmail.com>
Date: Sat, 3 Jul 2021 10:50:39 +0700
Subject: [PATCH] xbps-src: retire XBPS_PKGDESTDIR
Historically, PKGDESTDIR was only set during pkg_install, and
XBPS_PKGDESTDIR was set to indicate that we're in subpkg's
pkg_install.
However, from 0b95cb8f5d, (Merge xbps-src code to make it usable in
a standalone mode., 2014-03-22), PKGDESTDIR is always set,
regardless of states.
Let's drop all usages of XBPS_PKGDESTDIR.
While we're at it, error out of vmove is used outside of subpkg.
---
common/environment/setup/install.sh | 73 ++++++-------------
common/xbps-src/libexec/xbps-src-doinstall.sh | 1 -
2 files changed, 22 insertions(+), 52 deletions(-)
diff --git a/common/environment/setup/install.sh b/common/environment/setup/install.sh
index 742f13075f8f..f533212b7daf 100644
--- a/common/environment/setup/install.sh
+++ b/common/environment/setup/install.sh
@@ -144,10 +144,9 @@ _vlicense() {
_vinstall() {
local file="$1" mode="$2" targetdir="$3" targetfile="$4"
- local _destdir=
- if [ -z "$DESTDIR" ]; then
- msg_red "$pkgver: vinstall: DESTDIR unset, can't continue...\n"
+ if [ -z "$PKGDESTDIR" ]; then
+ msg_red "$pkgver: vinstall: PKGDESTDIR unset, can't continue...\n"
return 1
fi
@@ -161,24 +160,18 @@ _vinstall() {
return 1
fi
- if [ -n "$XBPS_PKGDESTDIR" ]; then
- _destdir="$PKGDESTDIR"
- else
- _destdir="$DESTDIR"
- fi
-
if [ -z "$targetfile" ]; then
- install -Dm${mode} "${file}" "${_destdir}/${targetdir}/${file##*/}"
+ install -Dm${mode} "${file}" "${PKGDESTDIR}/${targetdir}/${file##*/}"
else
- install -Dm${mode} "${file}" "${_destdir}/${targetdir}/${targetfile##*/}"
+ install -Dm${mode} "${file}" "${PKGDESTDIR}/${targetdir}/${targetfile##*/}"
fi
}
_vcopy() {
- local files="$1" targetdir="$2" _destdir
+ local files="$1" targetdir="$2"
- if [ -z "$DESTDIR" ]; then
- msg_red "$pkgver: vcopy: DESTDIR unset, can't continue...\n"
+ if [ -z "$PKGDESTDIR" ]; then
+ msg_red "$pkgver: vcopy: PKGDESTDIR unset, can't continue...\n"
return 1
fi
if [ $# -ne 2 ]; then
@@ -186,17 +179,11 @@ _vcopy() {
return 1
fi
- if [ -n "$XBPS_PKGDESTDIR" ]; then
- _destdir="$PKGDESTDIR"
- else
- _destdir="$DESTDIR"
- fi
-
- cp -a $files ${_destdir}/${targetdir}
+ cp -a $files ${PKGDESTDIR}/${targetdir}
}
_vmove() {
- local f files="$1" _destdir _pkgdestdir _targetdir
+ local f files="$1" _targetdir
if [ -z "$DESTDIR" ]; then
msg_red "$pkgver: vmove: DESTDIR unset, can't continue...\n"
@@ -204,6 +191,9 @@ _vmove() {
elif [ -z "$PKGDESTDIR" ]; then
msg_red "$pkgver: vmove: PKGDESTDIR unset, can't continue...\n"
return 1
+ elif [ "$DESTDIR" = "$PKGDESTDIR" ]; then
+ msg_red "$pkgver: vmove is intended to be used in pkg_install\n"
+ return 1
fi
if [ $# -ne 1 ]; then
msg_red "$pkgver: vmove: 1 argument expected: <files>\n"
@@ -214,30 +204,22 @@ _vmove() {
break
done
- if [ -n "$XBPS_PKGDESTDIR" ]; then
- _pkgdestdir="$PKGDESTDIR"
- _destdir="$DESTDIR"
- else
- _pkgdestdir="$DESTDIR"
- _destdir="$DESTDIR"
- fi
-
if [ -z "${_targetdir}" ]; then
- [ ! -d ${_pkgdestdir} ] && install -d ${_pkgdestdir}
- mv ${_destdir}/$files ${_pkgdestdir}
+ [ ! -d ${PKGDESTDIR} ] && install -d ${PKGDESTDIR}
+ mv ${DESTDIR}/$files ${PKGDESTDIR}
else
- if [ ! -d ${_pkgdestdir}/${_targetdir} ]; then
- install -d ${_pkgdestdir}/${_targetdir}
+ if [ ! -d ${PKGDESTDIR}/${_targetdir} ]; then
+ install -d ${PKGDESTDIR}/${_targetdir}
fi
- mv ${_destdir}/$files ${_pkgdestdir}/${_targetdir}
+ mv ${DESTDIR}/$files ${PKGDESTDIR}/${_targetdir}
fi
}
_vmkdir() {
- local dir="$1" mode="$2" _destdir
+ local dir="$1" mode="$2"
- if [ -z "$DESTDIR" ]; then
- msg_red "$pkgver: vmkdir: DESTDIR unset, can't continue...\n"
+ if [ -z "$PKGDESTDIR" ]; then
+ msg_red "$pkgver: vmkdir: PKGDESTDIR unset, can't continue...\n"
return 1
fi
@@ -246,16 +228,10 @@ _vmkdir() {
return 1
fi
- if [ -n "$XBPS_PKGDESTDIR" ]; then
- _destdir="$PKGDESTDIR"
- else
- _destdir="$DESTDIR"
- fi
-
if [ -z "$mode" ]; then
- install -d ${_destdir}/${dir}
+ install -d ${PKGDESTDIR}/${dir}
else
- install -dm${mode} ${_destdir}/${dir}
+ install -dm${mode} ${PKGDESTDIR}/${dir}
fi
}
@@ -265,11 +241,6 @@ _vcompletion() {
local _fish_completion_dir=usr/share/fish/vendor_completions.d/
local _zsh_completion_dir=usr/share/zsh/site-functions/
- if [ -z "$DESTDIR" ]; then
- msg_red "$pkgver: vcompletion: DESTDIR unset, can't continue...\n"
- return 1
- fi
-
if [ $# -lt 2 ]; then
msg_red "$pkgver: vcompletion: 2 arguments expected: <file> <shell>\n"
return 1
diff --git a/common/xbps-src/libexec/xbps-src-doinstall.sh b/common/xbps-src/libexec/xbps-src-doinstall.sh
index 14e117a923b9..fb5d35d1a59a 100755
--- a/common/xbps-src/libexec/xbps-src-doinstall.sh
+++ b/common/xbps-src/libexec/xbps-src-doinstall.sh
@@ -58,7 +58,6 @@ if [ ! -f $XBPS_SUBPKG_INSTALL_DONE ]; then
install -d $PKGDESTDIR
if declare -f pkg_install >/dev/null; then
- export XBPS_PKGDESTDIR=1
run_pkg_hooks pre-install
run_func pkg_install
fi
next reply other threads:[~2021-07-03 4:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-03 4:03 sgn [this message]
2021-07-11 9:21 ` [PR PATCH] [Merged]: " sgn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-31772@inbox.vuxu.org \
--to=sgn@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).