diff mbox

[Cbuildv2/symlinks] lib/fetch.sh: Move tar unpacking to before symlink creation.

Message ID 1382467843-26810-1-git-send-email-ryan.arnold@linaro.org
State New
Headers show

Commit Message

Ryan S. Arnold Oct. 22, 2013, 6:50 p.m. UTC
From: "Ryan S. Arnold" <ryan.arnold@linaro.org>

The build system is erroneously adding symlinks for packages that don't
need it.  Moving the symlink creation to after the untar fixes the
problem.

I tested this using binutils-linaro-2.23.2-2013.06.tar.bz2 which erroneously
unpacks to binutils-2.23, i.e., the unpacked named doesn't match the tar name.
I also tested with binutils-linaro-2.23.2-2013.10-4.tar.bz2, which is known to
unpack correctly.  In both cases the symlinks to binutils (if necessary) were
created correctly, and the spurious symlinks in infrastructure/ were NOT
created.

Note, this patch is in the symlinks branch.
---
 lib/fetch.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Rob Savoye Oct. 22, 2013, 7:06 p.m. UTC | #1
On 10/22/2013 12:50 PM, Ryan S. Arnold wrote:
> From: "Ryan S. Arnold" <ryan.arnold@linaro.org>
>
> The build system is erroneously adding symlinks for packages that don't
> need it.  Moving the symlink creation to after the untar fixes the
> problem.
  Looks ok.

    - rob -
Ryan S. Arnold Oct. 22, 2013, 7:37 p.m. UTC | #2
On Tue, Oct 22, 2013 at 2:06 PM, Rob Savoye <rob.savoye@linaro.org> wrote:
> On 10/22/2013 12:50 PM, Ryan S. Arnold wrote:
>> From: "Ryan S. Arnold" <ryan.arnold@linaro.org>
>>
>> The build system is erroneously adding symlinks for packages that don't
>> need it.  Moving the symlink creation to after the untar fixes the
>> problem.
>   Looks ok.
>
>     - rob -
Pushed to master:

commit 7a3c301c3c2d6582695fcc425e6b1a392dcacad3
Author: Ryan S. Arnold <ryan.arnold@linaro.org>
Date:   Tue Oct 22 13:34:29 2013 -0500

    lib/fetch.sh: Move tar unpacking to before symlink creation.

    The build system is erroneously adding symlinks for packages that don't
    need it.  Moving the symlink creation to after the untar fixes the
    problem.
diff mbox

Patch

diff --git a/lib/fetch.sh b/lib/fetch.sh
index 4a9da8b..bad5a3d 100755
--- a/lib/fetch.sh
+++ b/lib/fetch.sh
@@ -249,6 +249,14 @@  extract()
 	*) ;;
     esac
 
+    if test -d `echo ${local_snapshots}/${dir}${file} | sed -e 's:.tar.*::'` -a x"${force}" = xno; then
+	notice "${local_snapshots}/${file} is already extracted!"
+	return 0
+    else
+	local taropts="${taropt}xf"
+	tar ${taropts} ${local_snapshots}/${dir}${file} -C ${local_snapshots}/${dir}
+    fi
+
     # FIXME: this is hopefully is temporary hack for tarballs where the directory
     # name versions doesn't match the tarball version. This means it's missing the
     # -linaro-VERSION.YYYY.MM part.
@@ -264,14 +272,6 @@  extract()
 	fi
     fi
 
-    if test -d `echo ${local_snapshots}/${dir}${file} | sed -e 's:.tar.*::'` -a x"${force}" = xno; then
-	notice "${local_snapshots}/${file} is already extracted!"
-	return 0
-    else
-	local taropts="${taropt}xf"
-	tar ${taropts} ${local_snapshots}/${dir}${file} -C ${local_snapshots}/${dir}
-    fi
-
     touch ${local_builds}/stamp-extract-${file} 
 
     return 0