kbuild: Fix tar-pkg with relative $(objtree)
authorMichal Marek <mmarek@suse.cz>
Wed, 18 Jun 2014 14:21:41 +0000 (16:21 +0200)
committerMichal Marek <mmarek@suse.cz>
Wed, 18 Jun 2014 15:34:59 +0000 (17:34 +0200)
Commit 7e1c0477 (kbuild: Use relative path for $(objtree)) assumes that
the build process does not change its working directory. make tar-pkg
was a couterexample, fix this by changing directory only for the tar
command and not for the whole script, which at one point references the
now relative $(objtree).

Reported-and-tested-by: "J. Bruce Fields" <bfields@fieldses.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
scripts/package/buildtar

index 995c1eafaff6156862ad340aa11ff79b3dc96f46..e046bff33589ec3ae492397fd0cd723b9efd3ae7 100644 (file)
@@ -125,12 +125,11 @@ esac
 # Create the tarball
 #
 (
-       cd "${tmpdir}"
        opts=
        if tar --owner=root --group=root --help >/dev/null 2>&1; then
                opts="--owner=root --group=root"
        fi
-       tar cf - boot/* lib/* $opts | ${compress} > "${tarball}${file_ext}"
+       tar cf - -C "$tmpdir" boot/ lib/ $opts | ${compress} > "${tarball}${file_ext}"
 )
 
 echo "Tarball successfully created in ${tarball}${file_ext}"