[oe] [meta-networking][PATCH] recipes-connectivity/samba: Only rmdir directories that exist

Khem Raj raj.khem at gmail.com
Mon Jan 11 18:11:39 UTC 2016


> On Jan 11, 2016, at 10:06 AM, Mike Looijmans <mike.looijmans at topic.nl> wrote:
> 
> On 11-01-16 19:00, Khem Raj wrote:
>> 
>>> On Jan 11, 2016, at 9:53 AM, Mike Looijmans <mike.looijmans at topic.nl> wrote:
>>> 
>>> Depending on PACKAGECONFIG selection, the /run/samba directory may not
>>> have been created. Make the do_install_append handle both situations
>>> by checking whether these directories exist before attempting to remove
>>> them.
>>> 
>>> This fixes do_install failing with an error like this:
>>> rmdir: failed to remove '/.../samba/4.1.12-r0/image/run/samba': No such file or directory
>>> 
>>> Signed-off-by: Mike Looijmans <mike.looijmans at topic.nl>
>>> ---
>>> meta-networking/recipes-connectivity/samba/samba_4.1.12.bb | 8 ++++++--
>>> 1 file changed, 6 insertions(+), 2 deletions(-)
>>> 
>>> diff --git a/meta-networking/recipes-connectivity/samba/samba_4.1.12.bb b/meta-networking/recipes-connectivity/samba/samba_4.1.12.bb
>>> index a51d31f..8e89e49 100644
>>> --- a/meta-networking/recipes-connectivity/samba/samba_4.1.12.bb
>>> +++ b/meta-networking/recipes-connectivity/samba/samba_4.1.12.bb
>>> @@ -104,8 +104,12 @@ EXTRA_OECONF += "--enable-fhs \
>>> LDFLAGS += "-Wl,-z,relro,-z,now"
>>> 
>>> do_install_append() {
>>> -    rmdir --ignore-fail-on-non-empty "${D}/run/samba"
>>> -    rmdir --ignore-fail-on-non-empty "${D}/run"
>>> +    if [ -d "${D}/run" ]; then
>>> +        if [ -d "${D}/run/samba" ]; then
>>> +            rmdir --ignore-fail-on-non-empty "${D}/run/samba"
>>> +        fi
>>> +        rmdir --ignore-fail-on-non-empty "${D}/run"
>>> +    fi
>> 
>> why don’t we delete /run completely ? it won’t work if package contents are in there anyway
>> 
> 
> That's what I do in a bbappend, just "rm -rf ${D}/run" (and also replace the non-functional startup script, but that's distro specific), but I thought that it might serve some purpose for the one who wrote the recipe.
> 
> /run is usually volatile, so putting files in there is pointless, right?

yes although, you should add code to generate those files during post_inst

> --
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.openembedded.org/pipermail/openembedded-devel/attachments/20160111/06f9c3fd/attachment-0002.sig>


More information about the Openembedded-devel mailing list