From: paper42 <paper42@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] base-files: remove non-portable behaviour
Date: Fri, 24 Sep 2021 16:21:32 +0200 [thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-33088@inbox.vuxu.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 526 bytes --]
There is a new pull request by paper42 against master on the void-packages repository
https://github.com/paper42/void-packages base-files-posix-sh
https://github.com/void-linux/void-packages/pull/33088
base-files: remove non-portable behaviour
On some minimal systems like OpenWrt, the install command doesn't exist
which results in xbps not creating the required directories when creating
a void chroot.
This PR needs testing.
A patch file from https://github.com/void-linux/void-packages/pull/33088.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-base-files-posix-sh-33088.patch --]
[-- Type: text/x-diff, Size: 3927 bytes --]
From afea35b6452d7798df25f2d90b819f8e4ce71181 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Sat, 18 Sep 2021 21:27:09 +0200
Subject: [PATCH] base-files: remove non-portable behaviour
On some minimal systems like OpenWrt, the install command doesn't exist
which results in xbps not creating the required directories when creating
a void chroot.
---
srcpkgs/base-files/INSTALL | 49 ++++++++++++++++++-------------------
srcpkgs/base-files/template | 2 +-
2 files changed, 25 insertions(+), 26 deletions(-)
diff --git a/srcpkgs/base-files/INSTALL b/srcpkgs/base-files/INSTALL
index 85a7f92cd4ee..e3b01ab9bb36 100644
--- a/srcpkgs/base-files/INSTALL
+++ b/srcpkgs/base-files/INSTALL
@@ -4,58 +4,57 @@ make_system_dirs() {
#
for d in boot etc etc/modprobe.d etc/modules-load.d \
etc/skel home dev proc usr mnt opt sys media var run/lock; do
- [ ! -d ${d} ] && install -d ${d}
+ mkdir -p ${d}
done
- [ ! -d root ] && install -dm750 root
+ mkdir -p root && chmod 750 root
# Don't try to create var/mail in the correct place if the user
# is updating from an old system that has var/mail as a symlink
- [ ! -L var/mail ] && [ ! -d var/mail ] && install -dm1777 var/mail
+ [ ! -L var/mail ] && mkdir -p var/mail && chmod 1777 var/mail
- [ ! -d var/spool ] && install -d var/spool
+ mkdir -p var/spool
for d in local local/bin local/sbin local/include local/lib \
bin include lib src; do
- [ ! -d usr/${d} ] && install -d usr/${d}
+ mkdir -p usr/${d}
done
for d in locale misc terminfo zoneinfo doc info; do
- [ ! -d usr/share/${d} ] && install -d usr/share/${d}
- [ ! -d usr/local/share/${d} ] && install -d usr/local/share/${d}
+ mkdir -p usr/share/${d}
+ mkdir -p usr/local/share/${d}
done
for d in 1 2 3 4 5 6 7 8; do
- [ ! -d usr/share/man/man${d} ] && \
- install -d usr/share/man/man${d}
- [ ! -d usr/local/share/man/man${d} ] && \
- install -d usr/local/share/man/man${d}
+ mkdir -p usr/share/man/man${d}
+ mkdir -p usr/local/share/man/man${d}
done
for d in empty log opt cache lib; do
- [ ! -d var/${d} ] && install -d var/${d}
+ mkdir -p var/${d}
done
# Create /var/run and /var/lock symlinks.
for d in run lock; do
- if [ ! -h "var/$d" -a -d var/${d} ]; then
+ if [ ! -h "var/$d" ] && [ -d var/${d} ]; then
echo "/${d} must not be a directory, exiting!"
exit 1
fi
done
- cd var
- ln -sf ../run .
- ln -sf ../run/lock .
- [ ! -d spool/mail ] && ln -sfn ../mail spool/mail
- if [ -L spool/mail/mail -a "$(readlink spool/mail/mail)" = spool/mail ]; then
- # Get rid of broken symlink created by older versions of base-files.
- rm spool/mail/mail
- fi
- cd ..
+ (
+ cd var || return
+ ln -sf ../run .
+ ln -sf ../run/lock .
+ [ ! -d spool/mail ] && ln -sfn ../mail spool/mail
+ if [ -L spool/mail/mail ] && [ "$(readlink spool/mail/mail)" = spool/mail ]; then
+ # Get rid of broken symlink created by older versions of base-files.
+ rm spool/mail/mail
+ fi
+ )
- install -dm1777 tmp
- install -dm1777 var/tmp
+ mkdir -p tmp && chmod 1777 tmp
+ mkdir -p var/tmp && chmod 1777 var/tmp
# remove leftover polkit rules from live systems
[ -e etc/polkit-1/rules.d/void-live.rules ] && rm etc/polkit-1/rules.d/void-live.rules
@@ -73,7 +72,7 @@ post)
echo "Creating system directories/symlinks..."
make_system_dirs
# Enable shadow passwd/groups.
- if [ -x bin/pwconv -a -x bin/grpconv -a "$(id -u)" -eq 0 ]; then
+ if [ -x bin/pwconv ] && [ -x bin/grpconv ] && [ "$(id -u)" -eq 0 ]; then
pwconv && grpconv
fi
;;
diff --git a/srcpkgs/base-files/template b/srcpkgs/base-files/template
index 758cd54ad147..6dddef3ef43f 100644
--- a/srcpkgs/base-files/template
+++ b/srcpkgs/base-files/template
@@ -1,7 +1,7 @@
# Template file for 'base-files'
pkgname=base-files
version=0.142
-revision=11
+revision=12
bootstrap=yes
depends="xbps-triggers"
short_desc="Void Linux base system files"
next reply other threads:[~2021-09-24 14:21 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-24 14:21 paper42 [this message]
2021-09-24 14:23 ` [PR REVIEW] " ericonr
2021-09-24 14:24 ` q66
2021-09-24 14:25 ` q66
2021-09-24 14:26 ` ericonr
2021-09-24 14:27 ` ericonr
2021-09-24 14:27 ` q66
2021-09-24 14:28 ` q66
2021-09-24 14:29 ` paper42
2021-09-24 14:31 ` q66
2021-09-24 14:34 ` [PR PATCH] [Updated] " paper42
2021-09-24 14:35 ` paper42
2021-09-24 14:37 ` ericonr
2021-09-24 14:39 ` [PR REVIEW] " q66
2021-09-24 14:39 ` q66
2021-09-24 14:46 ` ahesford
2021-09-24 14:46 ` ahesford
2021-09-24 14:59 ` paper42
2021-09-24 15:04 ` [PR REVIEW] " paper42
2021-09-24 15:06 ` ahesford
2021-09-24 15:10 ` [PR PATCH] [Updated] " paper42
2021-10-03 22:56 ` [PR REVIEW] " CameronNemo
2021-10-03 22:56 ` CameronNemo
2021-10-03 23:02 ` CameronNemo
2021-10-03 23:05 ` CameronNemo
2022-06-05 2:14 ` github-actions
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-33088@inbox.vuxu.org \
--to=paper42@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).