[Fai-commit] r4510 - trunk/bin

lange at alioth.debian.org lange at alioth.debian.org
Sun Aug 19 16:09:56 UTC 2007


Author: lange
Date: 2007-08-19 16:09:56 +0000 (Sun, 19 Aug 2007)
New Revision: 4510

Modified:
   trunk/bin/install_packages
Log:
print path once, then only config file names, not always full path


Modified: trunk/bin/install_packages
===================================================================
--- trunk/bin/install_packages	2007-08-16 12:48:18 UTC (rev 4509)
+++ trunk/bin/install_packages	2007-08-19 16:09:56 UTC (rev 4510)
@@ -25,7 +25,7 @@
 # MA 02111-1307, USA.
 #*********************************************************************
 
-my $version = "Version 4.1.2, 11-aug-2007";
+my $version = "Version 4.1.3, 17-aug-2007";
 $0=~ s#.+/##; # remove path from program name
 
 # import variables: $verbose, $MAXPACKAGES, $classes, $FAI, $FAI_ROOT
@@ -128,10 +128,10 @@
   $cache = new AptPkg::Cache;
 }
 
+warn "$0: reading config files from directory $classpath\n";
 # read all package config files
 foreach (@classes) {
-  my $filename = "$classpath/$_";
-  &readconfig($filename) if -f $filename;
+  &readconfig($classpath,$_) if -f "$classpath/$_";
 }
 
 # check if any Debian related commands/types are used in package_config
@@ -249,11 +249,11 @@
 # - - - - - - - - - - - - - - - - - - - - - - - - - - -
 sub readconfig {
 
-  my $filename = shift;
+  my ($path,$file) = @_;
   my ($package,$type,$cllist, at oclasses,$doit);
 
-  open (FILE,"$filename") || warn "ERROR $0: Can't read config file: $filename\n";
-  warn "$0: read config file $filename\n" if $verbose;
+  open (FILE,"$path/$file") || warn "ERROR $0: Can't read config file: $path/$file\n";
+  warn "$0: read config file /$file\n" if $verbose;
 
   while (<FILE>) {
     next if /^#/;    # skip comments
@@ -282,7 +282,7 @@
 
     # warning if uppercase letters are found (package are always lowercase)
     warn "WARNING: Uppercase character found in package name in line $_\n" if $_ =~ /[A-Z]/;
-    warn "ERROR: PACKAGES .. line missing in $filename\n",next unless $type;
+    warn "ERROR: PACKAGES .. line missing in $file\n",next unless $type;
     push @{$list{$type}}, split if $doit;
     $types{$type}=1;   # remember which types are used in package_config
   }




More information about the Fai-commit mailing list