On 05/29/2015 05:18 AM, Michael Biebl wrote:
> 2015-05-28 19:47 GMT+02:00 Filipe Brandenburger <filbran...@google.com>:
>> We're actually still missing a small part of it (A sentence like
>> "Files in /etc have the highest priority, files in /run take
>> precedence over files with the same name in */usr/lib*." in files like
>> hwdb.xml, the last /usr/lib won't get fixed) but it requires new
>> variables. I'm leaning towards introducing a rootsysconfdir=/etc and
>> rootlibdir=$(rootprefix)/lib (we already have a rootbindir) so I'll
>> follow up with a patch doing that.
>>
>> Though having the first patchset in certainly helps.
> 
> Indeed. I just ran my small shell script which I used to generate the
> original diff over current git head.
> The only occurences which it still replaces can be found at [1].
> It's like you said, the override bits which are still missing.
> Otherwise it looks fine.

Could you try the attached patch?

I had to introduce a new entity in custom-entites.ent, because with
"--with-rootprefix=/", "&rootprefix;/lib" resolves to "//lib", and with
the default behaviour of configure, "&rootprefix;lib" becomes "/usrlib".

That is solved with a subsitiution in Makefile.am now, which cleans up
all double slashes in custom-entites.ent.


Thanks,
Daniel

From f60d5707246d3a1ce8bcb11f3874ef696425a446 Mon Sep 17 00:00:00 2001
From: Daniel Mack <dan...@zonque.org>
Date: Fri, 29 May 2015 10:53:35 +0200
Subject: [PATCH] Makefile, man: replace hard-coded /usr/lib

Replace some /usr/lib occurences in man/ with a new &rootprefixlibdir;
entity, and define it in Makefile.am.

Also make sure to avoid leading double slashes in path names in
custom-entities.ent, which otherwise occur with

  ./configure --enable-split-usr --with-rootprefix=/
---
 Makefile.am             | 4 +++-
 man/hwdb.xml            | 4 ++--
 man/systemd.link.xml    | 4 ++--
 man/systemd.netdev.xml  | 4 ++--
 man/systemd.network.xml | 4 ++--
 man/udev.xml            | 4 ++--
 6 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index e4a8616..cf3742c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -105,6 +105,7 @@ systemsleepdir=$(rootlibexecdir)/system-sleep
 systemunitdir=$(rootprefix)/lib/systemd/system
 systempresetdir=$(rootprefix)/lib/systemd/system-preset
 udevlibexecdir=$(rootprefix)/lib/udev
+rootprefixlibdir=$(rootprefix)/lib
 udevhomedir=$(udevlibexecdir)
 udevrulesdir=$(udevlibexecdir)/rules.d
 udevhwdbdir=$(udevlibexecdir)/hwdb.d
@@ -6500,6 +6501,7 @@ substitutions = \
        '|includedir=$(includedir)|' \
        '|VERSION=$(VERSION)|' \
        '|rootprefix=$(rootprefix)|' \
+       '|rootprefixlibdir=$(rootprefixlibdir)|' \
        '|udevlibexecdir=$(udevlibexecdir)|' \
        '|SUSHELL=$(SUSHELL)|' \
        '|SULOGIN=$(SULOGIN)|' \
@@ -6605,7 +6607,7 @@ if ENABLE_MANPAGES
 man/custom-entities.ent: configure.ac
 	$(AM_V_GEN)$(MKDIR_P) $(dir $@)
 	$(AM_V_GEN)(echo '<?xml version="1.0" encoding="utf-8" ?>' && \
-	 printf '$(subst '|,<!ENTITY ,$(subst =, ",$(subst |',">\n,$(substitutions))))') \
+	 printf '$(subst '|,<!ENTITY ,$(subst =, ",$(subst |',">\n,$(subst =//,=/,$(substitutions)))))') \
 	 > $@ # '
 
 DISTCLEANFILES += \
diff --git a/man/hwdb.xml b/man/hwdb.xml
index b3602ac..60763e2 100644
--- a/man/hwdb.xml
+++ b/man/hwdb.xml
@@ -50,10 +50,10 @@
       regardless of the directories in which they live. However, files with
       identical filenames replace each other. Files in <filename>/etc</filename>
       have the highest priority, files in <filename>/run</filename> take precedence
-      over files with the same name in <filename>/usr/lib</filename>. This can be
+      over files with the same name in <filename>&rootprefixlibdir;</filename>. This can be
       used to override a system-supplied hwdb file with a local file if needed;
       a symlink in <filename>/etc</filename> with the same name as a hwdb file in
-      <filename>/usr/lib</filename>, pointing to <filename>/dev/null</filename>,
+      <filename>&rootprefixlibdir;</filename>, pointing to <filename>/dev/null</filename>,
       disables the hwdb file entirely. hwdb files must have the extension
       <filename>.hwdb</filename>; other extensions are ignored.</para>
 
diff --git a/man/systemd.link.xml b/man/systemd.link.xml
index 75cf6e1..001df38 100644
--- a/man/systemd.link.xml
+++ b/man/systemd.link.xml
@@ -70,10 +70,10 @@
     However, files with identical filenames replace each other. Files
     in <filename>/etc</filename> have the highest priority, files in
     <filename>/run</filename> take precedence over files with the same
-    name in <filename>/usr/lib</filename>. This can be used to
+    name in <filename>&rootprefixlibdir;</filename>. This can be used to
     override a system-supplied link file with a local file if needed;
     a symlink in <filename>/etc</filename> with the same name as a
-    link file in <filename>/usr/lib</filename>, pointing to
+    link file in <filename>&rootprefixlibdir;</filename>, pointing to
     <filename>/dev/null</filename>, disables the link file
     entirely.</para>
 
diff --git a/man/systemd.netdev.xml b/man/systemd.netdev.xml
index 6cd77ab..618693f 100644
--- a/man/systemd.netdev.xml
+++ b/man/systemd.netdev.xml
@@ -81,10 +81,10 @@
     identical filenames replace each other. Files in
     <filename>/etc</filename> have the highest priority, files in
     <filename>/run</filename> take precedence over files with the same
-    name in <filename>/usr/lib</filename>. This can be used to
+    name in <filename>&rootprefixlibdir;</filename>. This can be used to
     override a system-supplied configuration file with a local file if
     needed; a symlink in <filename>/etc</filename> with the same name
-    as a configuration file in <filename>/usr/lib</filename>, pointing
+    as a configuration file in <filename>&rootprefixlibdir;</filename>, pointing
     to <filename>/dev/null</filename>, disables the configuration file
     entirely.</para>
 
diff --git a/man/systemd.network.xml b/man/systemd.network.xml
index 0b9781f..6026ab6 100644
--- a/man/systemd.network.xml
+++ b/man/systemd.network.xml
@@ -77,10 +77,10 @@
     identical filenames replace each other. Files in
     <filename>/etc</filename> have the highest priority, files in
     <filename>/run</filename> take precedence over files with the same
-    name in <filename>/usr/lib</filename>. This can be used to
+    name in <filename>&rootprefixlibdir;</filename>. This can be used to
     override a system-supplied configuration file with a local file if
     needed; a symlink in <filename>/etc</filename> with the same name
-    as a configuration file in <filename>/usr/lib</filename>, pointing
+    as a configuration file in <filename>&rootprefixlibdir;</filename>, pointing
     to <filename>/dev/null</filename>, disables the configuration file
     entirely.</para>
 
diff --git a/man/udev.xml b/man/udev.xml
index f7ebaad..63524c2 100644
--- a/man/udev.xml
+++ b/man/udev.xml
@@ -65,10 +65,10 @@
       regardless of the directories in which they live. However, files with
       identical filenames replace each other. Files in <filename>/etc</filename>
       have the highest priority, files in <filename>/run</filename> take precedence
-      over files with the same name in <filename>/usr/lib</filename>. This can be
+      over files with the same name in <filename>&rootprefixlibdir;</filename>. This can be
       used to override a system-supplied rules file with a local file if needed;
       a symlink in <filename>/etc</filename> with the same name as a rules file in
-      <filename>/usr/lib</filename>, pointing to <filename>/dev/null</filename>,
+      <filename>&rootprefixlibdir;</filename>, pointing to <filename>/dev/null</filename>,
       disables the rules file entirely. Rule files must have the extension
       <filename>.rules</filename>; other extensions are ignored.</para>
 
-- 
2.4.0

_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to