From 137e0cd1f6acc85cdb257b6e3d0dcca76aa773a8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 25 Dec 2004 19:32:13 +0000 Subject: [PATCH] =?UTF-8?q?New:=20Le=20makepack=20accepte=20la=20package?= =?UTF-8?q?=20a=20construire=20en=20ligne=20de=20commande,=20ce=20qui=20pe?= =?UTF-8?q?rmet=20de=20construire=20les=20pack=20en=20batch=20(pour=20mett?= =?UTF-8?q?re=20=E0=20dispo,=20packag=E9,=20la=20derni=E8re=20version=20cv?= =?UTF-8?q?s=20par=20exemple).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/makepack-dolibarr.pl | 80 +++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 35 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 5f44785a5e2..7ea0c08f9a4 100644 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -91,47 +91,57 @@ $BUILDROOT="$TEMP/buildroot"; my $copyalreadydone=0; -# Choose package targets -#----------------------- print "Makepack version $VERSION\n"; print "Building package for $PROJECT $MAJOR.$MINOR\n"; -my $found=0; -my $NUM_SCRIPT; -while (! $found) { - my $cpt=0; - printf(" %d - %3s (%s)\n",$cpt,"All","Need ".join(",",values %REQUIREMENTTARGET)); - foreach my $target (@LISTETARGET) { - $cpt++; - printf(" %d - %3s (%s)\n",$cpt,$target,"Need ".$REQUIREMENTTARGET{$target}); - } - # On demande de choisir le fichier à passer - print "Choose one package number or several separated with space: "; - $NUM_SCRIPT=; - chomp($NUM_SCRIPT); - if ($NUM_SCRIPT =~ s/-//g) { - # Do not do copy - $copyalreadydone=1; - } - if ($NUM_SCRIPT !~ /^[0-$cpt\s]+$/) - { - print "This is not a valid package number list.\n"; - $found = 0; - } - else - { - $found = 1; - } +for (0..@ARGV-1) { + if ($ARGV[$_] =~ /^-*target=(\w+)/i) { $target=$1; } } -print "\n"; -if ($NUM_SCRIPT) { - foreach my $num (split(/\s+/,$NUM_SCRIPT)) { - $CHOOSEDTARGET{$LISTETARGET[$num-1]}=1; - } + +# Choose package targets +#----------------------- +if ($target) { + $CHOOSEDTARGET{uc($target)}=1; } else { - foreach my $key (@LISTETARGET) { - $CHOOSEDTARGET{$key}=1; + my $found=0; + my $NUM_SCRIPT; + while (! $found) { + my $cpt=0; + printf(" %d - %3s (%s)\n",$cpt,"All","Need ".join(",",values %REQUIREMENTTARGET)); + foreach my $target (@LISTETARGET) { + $cpt++; + printf(" %d - %3s (%s)\n",$cpt,$target,"Need ".$REQUIREMENTTARGET{$target}); + } + + # On demande de choisir le fichier à passer + print "Choose one package number or several separated with space: "; + $NUM_SCRIPT=; + chomp($NUM_SCRIPT); + if ($NUM_SCRIPT =~ s/-//g) { + # Do not do copy + $copyalreadydone=1; + } + if ($NUM_SCRIPT !~ /^[0-$cpt\s]+$/) + { + print "This is not a valid package number list.\n"; + $found = 0; + } + else + { + $found = 1; + } + } + print "\n"; + if ($NUM_SCRIPT) { + foreach my $num (split(/\s+/,$NUM_SCRIPT)) { + $CHOOSEDTARGET{$LISTETARGET[$num-1]}=1; + } + } + else { + foreach my $key (@LISTETARGET) { + $CHOOSEDTARGET{$key}=1; + } } }