diff mbox

Fix stamp name for git repos with specific named branches.

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

Commit Message

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

git repositories might have a branch name designated with a slash.
Change the / to a - in the stamp name, otherwise stamp creation
will fail because the shell thinks the part before the / is a directory
name.
---
 lib/make.sh | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

Comments

Ryan S. Arnold Oct. 4, 2013, 7:14 p.m. UTC | #1
On Fri, Oct 4, 2013 at 1:57 PM, Ryan S. Arnold <ryan.arnold@linaro.org> wrote:
> From: "Ryan S. Arnold" <ryan.arnold@linaro.org>
>
> git repositories might have a branch name designated with a slash.
> Change the / to a - in the stamp name, otherwise stamp creation
> will fail because the shell thinks the part before the / is a directory
> name.
> ---
>  lib/make.sh | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/lib/make.sh b/lib/make.sh
> index 19b8f7d..15f5082 100755
> --- a/lib/make.sh
> +++ b/lib/make.sh
> @@ -113,12 +113,19 @@ build()
>      # fi
>      local tag="${url}${branch}${revision}"
>
> +    # git repositories might have a branch name designated with a slash.
> +    # Change the / to a - in the stamp name, otherwise stamp creation
> +    # will fail because the shell thinks the part before the / is a directory
> +    # name.
> +    local stamp="`echo ${file} | sed -e 's:/:-:'`"
> +    local stamp="stamp-build-${stamp}${2:+-$2}"
> +
>      # If the tarball hasn't changed, then don't fetch anything
> -    if test ${local_builds}/${host}/${target}/stamp-build-${file}$2 -nt ${local_snapshots}/${url} -a x"${force}" = xno -a x"$2" != x"stage2"; then
> -       fixme "stamp-build-${file} is newer than ${url}, so not building ${file}"
> +    if test ${local_builds}/${host}/${target}/${stamp} -nt ${local_snapshots}/${url} -a x"${force}" = xno -a x"$2" != x"stage2"; then
> +       fixme "${stamp} is newer than ${url}, so not building ${file}"
>         return 0
>      else
> -       fixme "stamp-build-${file} is not newer than ${url}, so building ${file}"
> +       fixme "${stamp} is not newer than ${url}, so building ${file}"
>      fi
>
>      notice "Building ${tag}"
> @@ -212,7 +219,7 @@ build()
>         fi
>      fi
>
> -    touch ${local_builds}/${host}/${target}/stamp-build-${file}$2
> +    touch ${local_builds}/${host}/${target}/${stamp}
>      notice "Done building ${tag}..."
>
>      # For cross testing, we need to build a C library with our freshly built
> --
> 1.8.3.1
>

I'll fix configure stamps in the same way next.

Ryan
Rob Savoye Oct. 4, 2013, 7:21 p.m. UTC | #2
On 10/04/2013 12:57 PM, Ryan S. Arnold wrote:
> From: "Ryan S. Arnold" <ryan.arnold@linaro.org>
>
> git repositories might have a branch name designated with a slash.
> Change the / to a - in the stamp name, otherwise stamp creation
> will fail because the shell thinks the part before the / is a directory
> name.
  Patch committed.

    - rob -
diff mbox

Patch

diff --git a/lib/make.sh b/lib/make.sh
index 19b8f7d..15f5082 100755
--- a/lib/make.sh
+++ b/lib/make.sh
@@ -113,12 +113,19 @@  build()
     # fi
     local tag="${url}${branch}${revision}"
 
+    # git repositories might have a branch name designated with a slash.
+    # Change the / to a - in the stamp name, otherwise stamp creation
+    # will fail because the shell thinks the part before the / is a directory
+    # name.
+    local stamp="`echo ${file} | sed -e 's:/:-:'`"
+    local stamp="stamp-build-${stamp}${2:+-$2}"
+
     # If the tarball hasn't changed, then don't fetch anything
-    if test ${local_builds}/${host}/${target}/stamp-build-${file}$2 -nt ${local_snapshots}/${url} -a x"${force}" = xno -a x"$2" != x"stage2"; then
-     	fixme "stamp-build-${file} is newer than ${url}, so not building ${file}"
+    if test ${local_builds}/${host}/${target}/${stamp} -nt ${local_snapshots}/${url} -a x"${force}" = xno -a x"$2" != x"stage2"; then
+     	fixme "${stamp} is newer than ${url}, so not building ${file}"
 	return 0
     else
-     	fixme "stamp-build-${file} is not newer than ${url}, so building ${file}"
+     	fixme "${stamp} is not newer than ${url}, so building ${file}"
     fi    
     
     notice "Building ${tag}"
@@ -212,7 +219,7 @@  build()
 	fi
     fi
 
-    touch ${local_builds}/${host}/${target}/stamp-build-${file}$2
+    touch ${local_builds}/${host}/${target}/${stamp}
     notice "Done building ${tag}..."
 
     # For cross testing, we need to build a C library with our freshly built