diff mbox

kbuild: Fix tar-pkg with relative $(objtree)

Message ID 1403101583-15275-1-git-send-email-mmarek@suse.cz (mailing list archive)
State New, archived
Headers show

Commit Message

Michal Marek June 18, 2014, 2:26 p.m. UTC
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-by: "J. Bruce Fields" <bfields@fieldses.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
---
 scripts/package/buildtar | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

J. Bruce Fields June 18, 2014, 3:29 p.m. UTC | #1
On Wed, Jun 18, 2014 at 04:26:23PM +0200, Michal Marek wrote:
> 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).

Works for me, thanks.--b.

> 
> Reported-by: "J. Bruce Fields" <bfields@fieldses.org>
> Signed-off-by: Michal Marek <mmarek@suse.cz>
> ---
>  scripts/package/buildtar | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/scripts/package/buildtar b/scripts/package/buildtar
> index 995c1ea..e046bff 100644
> --- a/scripts/package/buildtar
> +++ b/scripts/package/buildtar
> @@ -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}"
> -- 
> 1.9.2
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Michal Marek June 18, 2014, 3:34 p.m. UTC | #2
Dne 18.6.2014 17:29, J. Bruce Fields napsal(a):
> On Wed, Jun 18, 2014 at 04:26:23PM +0200, Michal Marek wrote:
>> 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).
> 
> Works for me, thanks.--b.

Thanks for testing!

Michal

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/scripts/package/buildtar b/scripts/package/buildtar
index 995c1ea..e046bff 100644
--- a/scripts/package/buildtar
+++ b/scripts/package/buildtar
@@ -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}"