diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2020-06-30 02:46:30 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2020-06-30 02:46:30 (EDT) |
commit | 72f1bbe9f1bb82d3b340eea50924529942c93ace (patch) | |
tree | ce6e405c9202fb083d647d08e06f0e2d9052a0f9 | |
parent | b6626e0e23ee817383e29fc1f2428bca169a20db (diff) |
opkbuild: Run ob-* commands from a child shell
This basically reverts commit ab654dadd640164b7ddf01a3599c2a8beb6d6302.
-rw-r--r-- | NEWS | 5 | ||||
-rw-r--r-- | src/opkbuild.sh | 15 |
2 files changed, 14 insertions, 6 deletions
@@ -31,6 +31,11 @@ Utilities: - oh-fixperms (used in most packages) also sets owners and groups - "build" makefile "install" targets are run with (fake) superuser privileges. + * opkbuild now runs the "build" makefile's "install" target and all + ob-* commands under the same (fake) superuser environment. This was + the behavior in versions 3.0.0-alpha1 through 3.0.0-beta7. Since + version 4.0.0, commands were run in separate (fake) superuser + environments, which may not preserve superuser ownership of files. libopkbuild: diff --git a/src/opkbuild.sh b/src/opkbuild.sh index e6dc730..ab768eb 100644 --- a/src/opkbuild.sh +++ b/src/opkbuild.sh @@ -351,13 +351,16 @@ build() { case "${opt_target}" in '') - ../build build && - ${opt_uid0_cmd} -- ../build install && - ${opt_uid0_cmd} -- "${bindir}/ob-installdocs" && - ${opt_uid0_cmd} -- "${bindir}/ob-gencontrol" && - ${opt_uid0_cmd} -- "${bindir}/ob-buildopk" && - ${opt_uid0_cmd} -- "${bindir}/ob-genchanges" || + if ! ../build build || ! ${opt_uid0_cmd} -- ${SH} <<-EOF + ../build install && + "${bindir}/ob-installdocs" && + "${bindir}/ob-gencontrol" && + "${bindir}/ob-buildopk" && + "${bindir}/ob-genchanges" + EOF + then return 1 + fi ;; 'install'|'install-'*) if ! ${opt_uid0_cmd} -- ../build -- "${opt_target}" |