]> code.ossystems Code Review - openembedded-core.git/commitdiff
nss-myhostname: fix postinst/prerm scripts
authorKoen Kooi <koen@dominion.thruhere.net>
Wed, 20 Aug 2014 13:28:50 +0000 (15:28 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 23 Aug 2014 08:25:04 +0000 (09:25 +0100)
${D} is expanded by bitbake which means the postinst looks like this:

sed -e '/^hosts:/s/\s*\<myhostname\>//' \
    -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
    -i /build/scratch/angstrom-v2014.12/build/tmp-angstrom_next-eglibc/work/armv5te-angstrom-linux-gnueabi/systemd/1_216+gitAUTOINC+5d0ae62c66-r0/image/etc/nsswitch.conf

Change ${D} to $D to stop it from being expanded by bitbake.

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-support/nss-myhostname/nss-myhostname_0.3.bb

index d8ec863954170abc403344e639b6267c2c742239..12376025534d3f2ca3add1e8407ed606fe6c18c8 100644 (file)
@@ -16,11 +16,11 @@ inherit autotools
 pkg_postinst_${PN} () {
        sed -e '/^hosts:/s/\s*\<myhostname\>//' \
                -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
-               -i ${D}${sysconfdir}/nsswitch.conf
+               -i $D${sysconfdir}/nsswitch.conf
 }
 
 pkg_prerm_${PN} () {
        sed -e '/^hosts:/s/\s*\<myhostname\>//' \
                -e '/^hosts:/s/\s*myhostname//' \
-               -i ${D}${sysconfdir}/nsswitch.conf
+               -i $D${sysconfdir}/nsswitch.conf
 }