]> code.ossystems Code Review - openembedded-core.git/commit
combo-layer: clean up dest_dir checking
authorPatrick Ohly <patrick.ohly@intel.com>
Fri, 27 Mar 2015 13:53:10 +0000 (14:53 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 31 Mar 2015 21:21:43 +0000 (22:21 +0100)
commita8547b3c2c0b8bf3150043b1b6570f0d44b20335
tree04401f4285672e2bac6eb8e3d40966908e02b5f0
parent15c5e5e83af409509140eaf29d4e10d9db99eb8a
combo-layer: clean up dest_dir checking

Empty dest_dir is basically undocumented behavior. The sample conf
only mentions using just a dot for the current directory. In practice,
the empty string does not work because of code like this:

def action_splitpatch(conf, args):
    ...
        if dest_dir != ".":
            filerange_root = '%s -x "%s/*"' % (filerange_root, dest_dir)

However, the empty string was not explicitly checked for, leading to
strange errors when trying to apply patches:

[12:50:23] Applying: foobar: xyz
fatal: unable to stat newly created file '/foobar': No such file or directory

This patch turns the empty string into an alias for the dot. This seems
more user-friendly than throwing an error. This alias is intentionally
not document in the sample conf, because the dot is clearer and works also
with older copies of combo-layer.

Instead of checking for both all the time and normalizing the path when
needed (as done in some places), rewrite the value in sanity_check()
and then only check for '.'.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/combo-layer