summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoretienne2005-03-22 12:00:30 +0000
committeretienne2005-03-22 12:00:30 +0000
commite0b86459e97aa90419e129e67229397783ac3f80 (patch)
tree959d69ec4d8ae334204aac2e0ec04e4f4314acf6
parent60c5e8b66525c106d3362e52472bfcc24313e53c (diff)
downloadivylaunch-e0b86459e97aa90419e129e67229397783ac3f80.zip
ivylaunch-e0b86459e97aa90419e129e67229397783ac3f80.tar.gz
ivylaunch-e0b86459e97aa90419e129e67229397783ac3f80.tar.bz2
ivylaunch-e0b86459e97aa90419e129e67229397783ac3f80.tar.xz
*** empty log message ***
-rw-r--r--FugueConfig.pm8
-rw-r--r--debian/changelog6
-rwxr-xr-xivylaunch20
3 files changed, 23 insertions, 11 deletions
diff --git a/FugueConfig.pm b/FugueConfig.pm
index b1391ff..b0e9b72 100644
--- a/FugueConfig.pm
+++ b/FugueConfig.pm
@@ -3,7 +3,6 @@ package FugueConfig;
use Sys::Hostname;
use strict;
-
my $rsh = $ENV{"RSH"};
$rsh = "rsh" unless defined $rsh;
@@ -11,6 +10,7 @@ $rsh = "rsh" unless defined $rsh;
sub open {
my $file = shift;
+ my @cppopts = @_;
if (system("which cpp > /dev/null")) {
print "cpp command can't be located\n";
return undef;
@@ -21,7 +21,8 @@ sub open {
print "'$file' is unreadable\n";
return undef;
}
- open (FD, "cpp -traditional $file |") or return undef;
+ my $cppcmd = "cpp -traditional ".join(' ', @cppopts)." $file";
+ open (FD, "$cppcmd |") or return undef;
return \*FD;
} # end open
@@ -37,8 +38,7 @@ sub open {
#
sub parse {
- my $file = shift;
- my $fd = &FugueConfig::open($file);
+ my $fd = &FugueConfig::open(@_);
return undef unless $fd;
my @data;
my %appname;
diff --git a/debian/changelog b/debian/changelog
index 6c44e9a..e98dce3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ivylaunch (1.3) unstable; urgency=low
+
+ * Possibilité de passer des options ŕ cpp
+
+ -- Daniel Etienne <etienne@cena.fr> Tue, 22 Mar 2005 12:09:01 +0100
+
ivylaunch (1.2) unstable; urgency=low
* Correction : sur réception par ivylaunch d'un message DIE, les
diff --git a/ivylaunch b/ivylaunch
index 9b03434..c51abdc 100755
--- a/ivylaunch
+++ b/ivylaunch
@@ -39,16 +39,21 @@
# signal handlers
+BEGIN {
+ if (-d "/usr/lib/ivylaunch") {
+ # comment this line if FugueConfig is located elsewhere
+ unshift(@INC, "/usr/lib/ivylaunch");
+ print "/usr/lib/ivylaunch is prepend to \@INC\n";
+ }
+}
$SIG{INT} = $SIG{KILL} = 'Quit';
-# where you may find the FugueConfig module
-use lib "/usr/lib/ivylaunch";
use Ivy;
use strict;
use Sys::Hostname;
use File::Basename;
-use Getopt::Long;
+use Getopt::Long qw(:config pass_through);
use POSIX 'sys_wait_h';
use FugueConfig;
@@ -60,15 +65,16 @@ my %OPTIONS = ("b=s" => "ivy bus");
my %opt;
my @apps;
-&usage unless Getopt::Long::GetOptions(\%opt, "b=s", 'help', "override") ;
+Getopt::Long::GetOptions(\%opt, "b=s", 'help', "override") ;
&usage if $opt{help};
my $bus = defined $ENV{"IVYBUS"} ? $ENV{"IVYBUS"} : '127.255.255.255:2010';
$bus = $opt{'b'} if defined $opt{'b'};
+my $file = pop @ARGV;
+my @cppopts = @ARGV;
-my $file = shift @ARGV;
&usage unless defined($file);
my (%child);
@@ -82,7 +88,7 @@ print "$HEADER Reading configuration file $file...\n";
my ($type, @param, %ready);
-for (FugueConfig::parse($file)) {
+for (FugueConfig::parse($file, @cppopts)) {
my ($type, $host, $name, $command, $paramslist) = @$_;
next if $type eq 'comment';
if ($type eq 'begin' or $type eq 'end') {
@@ -219,7 +225,7 @@ sub Status {
}
sub usage {
- print "Usage: $appliname [-b bus] [-override] <config_file>\n";
+ print "Usage: $appliname [-b bus] [-override] [cpp options] <config_file>\n";
exit;
}