On Thu, 21 Apr 2011, Jakub Jelinek wrote:

> On Thu, Apr 21, 2011 at 01:36:53PM +0200, Richard Guenther wrote:
> > 
> > This changes maybe_build_tarfile to require that the first directory
> > in the list actually exists.  This avoids building a GO tarball on
> > old branches where neither gcc/go nor libgo exist but libffi does.
> > 
> > I have built the 4.5.3 release candidate with this patch applied.
> 
> If we want to just test the first directory (and I agree with that,
> the first directory is the language directory and in case of go libffi
> is duplicated), having a loop and extra var is IMHO way overkill.
> 
> What about following instead?

Works for me if it works (my shell fu is quite limited).

Richard.

> 2011-04-21  Jakub Jelinek  <ja...@redhat.com>
> 
>       * gcc_release (maybe_build_tarfile): Don't build a tarfile if
>       the first directory doesn't exist.
> 
> --- maintainer-scripts/gcc_release.jj 2010-12-09 11:12:50.000000000 +0100
> +++ maintainer-scripts/gcc_release    2011-04-21 13:51:52.471180071 +0200
> @@ -253,13 +253,7 @@ build_tarfile() {
>  maybe_build_tarfile() {
>    dest=$1
>    shift
> -  dir_exists=0
> -  for maybe_dir in "$@"; do
> -    if [ -d "$maybe_dir" ]; then
> -      dir_exists=1
> -    fi
> -  done
> -  if [ $dir_exists = 1 ]; then
> +  if [ $# != 0 -a -d "$1" ]; then
>      build_tarfile "$dest" "$@"
>    else
>      echo "Not building $dest tarfile"
> 
>       Jakub
> 
> 

-- 
Richard Guenther <rguent...@suse.de>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex

Reply via email to