[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Language-independent Makefiles (was: Debian WWW CVS: joey)



El Mar 22 May 2001 15:45, peter karlsson escribió:
> Debian WWW CVS:
> > Modified Makefile so card.* are only valid for english websites since
> > two translaters blindly copied the english Makefile and broke the
> > build.  *sigh*

	Mmmm...I think I may be one of them...but you were warned. I asked if I 
could copy *blindly* english Makefiles...and I certainly did it (the top 
level Makefile and nineteen more).

> Makefiles should be language-independent, so they more easily can be copied
> from the English directory (if you use copypage.pl, the Makefile is copied
> automatically for you).

	Yes, but changes in english Makefiles aren't automatically propagated to the 
whole structure...maybe a hackish script "upd-makef.sh", like

#!/bin/bash
 
if [ -z "$1" ]
then
  echo "Need a Makefile to copy."
  exit 1
fi
 
if [ ! -f "$1" ]
then
  echo "$1 doesn't exist."
  exit 1
fi
 
# We obtain the directory.
DIR=`dirname "$1"`
# Strip english/ from the name.
 
DIR=`echo $DIR | sed 's#^\(./\)\?english\(/\)\?##'`
 
# Separate dirs from any other thing.
for STUFF in `ls`
do
  # We want all the dirs but english/ and CVS/.
  if [ -d "$STUFF" ] && [ ! "$STUFF" = "english" ] && [ ! "$STUFF" = "CVS" ]
  then
    LIST="$LIST$STUFF "
  fi
done
 
# Variable CHANGES will carry all the Makefiles involved (for now, only the 
english Makefile).
CHANGES="$1 "
 
# Check if the directory where Makefile is taken from exists in the rest of 
dirs.
for STUFF in $LIST
do
  if [ -d "$STUFF/$DIR" ]
  then
    # We copy the english Makefile over the old one in $STUFF$DIR.
    cp english/$DIR/Makefile $STUFF/$DIR
    CHANGES="$CHANGES$STUFF/$DIR/Makefile "
  fi
done

cvs commit $CHANGES


	It propagates a new Makefile in all the tree, but only when the right dir 
exists (e.g., it doesn't try to copy english/devel/wnpp/Makefile in arabic 
since arabic/devel/wnpp/ doesn't exist.)

	Do you like? We can put it in webwml/...it isn't rock-solid, but I've tested 
just now and I think it works properly.

> Besides, almost all files say "This file should need no changes [...]" at
> the top... :-)

	That line is the main reason of my changes.

	Best regards,


		Ender.
-- 
 Why is a cow? Mu. (Ommmmmmmmmm)
--
Responsable de News - Newsmanager
Servicios de red - Network services
Centro de Comunicaciones CSIC/RedIRIS
Spanish Academic Network for Research and Development
Madrid (Spain)
Tlf 91.585.49.05



Reply to: