Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] base-files: remove non-portable behaviour
@ 2021-09-24 14:21 paper42
  2021-09-24 14:23 ` [PR REVIEW] " ericonr
                   ` (24 more replies)
  0 siblings, 25 replies; 26+ messages in thread
From: paper42 @ 2021-09-24 14:21 UTC (permalink / raw)
  To: ml

[-- 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"

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2022-06-05  2:14 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-24 14:21 [PR PATCH] base-files: remove non-portable behaviour paper42
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

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).