]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
tools: Generalize python script patching during installation
authorJan Kiszka <jan.kiszka@siemens.com>
Sun, 24 May 2015 08:07:12 +0000 (10:07 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Sun, 24 May 2015 08:07:12 +0000 (10:07 +0200)
Rename patch_datadir_var to patch_dirvar and add a parameter to specify
which variable to patch. This will allow to use it also for libexecdir.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
tools/Makefile

index 1165870a8358b0df124484515c345b71448faaa6..6898e72ded6306f5feb9e429535930fadd54ea4d 100644 (file)
@@ -36,8 +36,8 @@ else
        TARGETS += no_python_mako
 endif
 
-define patch_datadir_var
-       sed -i 's|^datadir = None|datadir = "$(datadir)"|' $1
+define patch_dirvar
+       sed -i 's|^$1 = None|$1 = "$($1)"|' $2
 endef
 
 # no recipes above this one (also no includes)
@@ -58,7 +58,7 @@ install-bin: $(INST_TARGETS) $(DESTDIR)$(sbindir)
 
 install-libexec: $(HELPERS) $(DESTDIR)$(libexecdir)/jailhouse
        $(INSTALL_PROGRAM) $^
-       $(Q)$(call patch_datadir_var, $(lastword $^)/jailhouse-config-create)
+       $(Q)$(call patch_dirvar,datadir,$(lastword $^)/jailhouse-config-create)
 
 install-data: $(TEMPLATES) $(DESTDIR)$(datadir)/jailhouse
        $(INSTALL_DATA) $^