To continue with scripting, please, don't use old school code : if [ 
"x$TESTDIR" == "x" ]; 

Instead, use : if [ -z "$TESTDIR" ]; 

My two cents please :)

I'm working to enhance your little script. I'll send you a tested one later.

Drayan

-----Message d'origine-----
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] la
part de Victor Stinner
Envoyé : vendredi 24 novembre 2006 12:00
À : Discution sur le développement de Wormux.
Objet : Re: [Wormux-dev] bash script to install wormux svn on debian
andubuntu systems


Le Vendredi 24 Novembre 2006 10:32, Feth AREZKI a écrit :
> Its purpose is to install wormux svn in /usr/local/ on debian and ubuntu
> systems out of nothing -it will install build dependencies using apt-get.

Test to check if user is ussing Ubuntu:
   test $(grep -c Ubuntu /etc/issue) -eq 0
(use it in "if ...; then ...")

> So, give me your opinion, and if you feel it might be useful, do whatever
> you want with it.

They are to many questions :-p

You can use $1 to get destination directory for example.

DESTDIR="$1"
if [ "x$TESTDIR" == "x" ]; then DESTDIR="$HOME"; done

... are you sure you want to download Wormux in $DESTDIR ? ...
... (you change use different directory by using $0 [destdir]) ...

> The script has been tested somehow succesfully on debian unstable and
> ubuntu dapper. It chooses between cmake and autotools according to a dirty
> way (it installs cmake first...).

It doesn't work here since sudo "command arg" is not the right syntax (sudo 
command arg).

This must be better:

function run_as_root
{
  if [ "$SUWAY" == "sudo" ]; then
    $SUWAY $*
  else
    $SUWAY "$@"
  fi
}

(not sure that "$@" is the the expression, or you can use "$*")

Haypo

_______________________________________________
Wormux-dev mailing list
Wormux-dev@gna.org
https://mail.gna.org/listinfo/wormux-dev


=======================================================

Ce message et toutes les pieces jointes (ci-apres le "message") 
sont confidentiels et etablis a l'intention exclusive de ses destinataires.
Toute utilisation ou diffusion non autorisee est interdite. 
Tout message electronique est susceptible d'alteration. 
La SOCIETE GENERALE et ses filiales declinent toute responsabilite
au titre de ce message s'il a ete altere, deforme ou falsifie.
                                 
=======================================================

This message and any attachments (the "message") are confidential
and intended solely for the addressees.
Any unauthorized use or dissemination is prohibited. 
E-mails are susceptible to alteration.   
Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates
shall be liable for the message if altered, changed or falsified. 

=======================================================

_______________________________________________
Wormux-dev mailing list
Wormux-dev@gna.org
https://mail.gna.org/listinfo/wormux-dev

Répondre à