From 2897da1e4822df74bb99f5bf49f9cd2341077e3c6a29b30c86cb9369c4a0a5ab Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Fri, 30 Jul 2021 07:45:30 +0000 Subject: [PATCH] Accepting request 909203 from home:lnussel:usrmove - implement mkdir_p for ghost files as components may not exist - move usrmerge conversion to %pre instead of %pretrans (boo#1188847) - get rid of usrmerged macro usage, usrmerge is on in Factory always OBS-URL: https://build.opensuse.org/request/show/909203 OBS-URL: https://build.opensuse.org/package/show/Base:System/filesystem?expand=0&rev=210 --- filesystem.changes | 7 ++++++ filesystem.spec | 55 +++++++++++++++++++++++----------------------- 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/filesystem.changes b/filesystem.changes index e87e44d..5159888 100644 --- a/filesystem.changes +++ b/filesystem.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Jul 29 11:52:33 UTC 2021 - Ludwig Nussel + +- implement mkdir_p for ghost files as components may not exist +- move usrmerge conversion to %pre instead of %pretrans (boo#1188847) +- get rid of usrmerged macro usage, usrmerge is on in Factory always + ------------------------------------------------------------------- Wed Jun 9 15:46:59 UTC 2021 - Ludwig Nussel diff --git a/filesystem.spec b/filesystem.spec index c71bbe7..05d83c9 100644 --- a/filesystem.spec +++ b/filesystem.spec @@ -30,10 +30,8 @@ Version: 84.87 Release: 0 %endif BuildRoot: %{_tmppath}/%{name}-%{version}-build -%if 0%{?usrmerged} # XXX libsolv never sees the rpmlib provides fulfilled Requires(pre): (compat-usrmerge-tools or rpmlib(X-CheckUnifiedSystemdir)) -%endif Requires: group(root) Requires: user(root) URL: https://build.opensuse.org/package/show/openSUSE:Factory/filesystem @@ -83,7 +81,31 @@ if posix.stat("/var/lock.rpmsave.tmpx") then os.execute("mv /var/lock.rpmsave.tmpx/* /var/lock") os.remove("/var/lock.rpmsave.tmpx") end -%if 0%{?usrmerged} + +local ghosts = { +EOF +# +while read MOD OWN GRP NAME ; do + [ "$OWN" = root -a "$GRP" = root ] + echo "[\"$NAME\"] = $MOD," +done < ghost.list >> pretrans.lua +cat >> pretrans.lua <<'EOF' +} +function mkdir_p(path) + d = '' + for p in string.gmatch(path, "([^/]+)") do + d = d.."/"..p + posix.mkdir(d) + end +end +for i in pairs(ghosts) do + mkdir_p(i) + posix.chmod(i, ghosts[i]) +end +EOF +# +# +cat > pre.lua <<'EOF' needmigrate = false local dirs = {"/bin", "/sbin", @@ -102,19 +124,6 @@ end if needmigrate then assert(os.execute("/usr/libexec/convertfs")) end -%endif -local ghosts = { -EOF -while read MOD OWN GRP NAME ; do - [ "$OWN" = root -a "$GRP" = root ] - echo "[\"$NAME\"] = $MOD," -done < ghost.list >> pretrans.lua -cat >> pretrans.lua <<'EOF' -} -for i in pairs(ghosts) do - posix.mkdir(i) - posix.chmod(i, ghosts[i]) -end EOF %install @@ -151,7 +160,6 @@ echo "%%defattr(-,root,root)" > filesystem.list %ifarch s390x %sparc x86_64 ppc64 ppc aarch64 ppc64le riscv64 cat %{SOURCE64} >> directory.list %endif -%if 0%{?usrmerged} cat >> filesystem.links << EOF usr/bin /bin usr/sbin /sbin @@ -160,18 +168,8 @@ usr/lib /lib usr/lib64 /lib64 %endif EOF -%else -cat >> directory.list << EOF -0555 root root /bin -0555 root root /lib -0555 root root /sbin -%ifarch s390x %sparc x86_64 ppc64 ppc aarch64 ppc64le riscv64 -0555 root root /lib64 -%endif -EOF -%endif cat >> directory.list < -f pretrans.lua +%pre -p -f pre.lua %files -f filesystem.list /usr/lib/tmpfiles.d/fs-tmp.conf