[Pkg-mono-svn-commits] rev 603 - xsp-snapshot/trunk/debian/official

Pablo Fischer pabl0-guest@haydn.debian.org
Sat, 17 Apr 2004 14:21:58 -0600


Author: pabl0-guest
Date: 2004-04-17 14:21:56 -0600 (Sat, 17 Apr 2004)
New Revision: 603

Modified:
   xsp-snapshot/trunk/debian/official/mono-server-reader.conf
   xsp-snapshot/trunk/debian/official/mono-server-update.conf
   xsp-snapshot/trunk/debian/official/mono-xsp-reader.conf
   xsp-snapshot/trunk/debian/official/mono-xsp-update.conf
Log:
Both scripts should check if the 'big' conf really exists 
and exit with a exit 0 (with exit 1, postinst crashes)  


Modified: xsp-snapshot/trunk/debian/official/mono-server-reader.conf
===================================================================
--- xsp-snapshot/trunk/debian/official/mono-server-reader.conf	2004-04-17 08:20:26 UTC (rev 602)
+++ xsp-snapshot/trunk/debian/official/mono-server-reader.conf	2004-04-17 20:21:56 UTC (rev 603)
@@ -28,11 +28,19 @@
     exit 1 ;
 }
 
+if( ! -f "$monoserver_hostfile" ) {
+    print "Sorry\, but you don't have $monoserver_hostfile\n";
+    exit 0;
+}
 
 my $opened_section = 0;
+my $applications = "";
+
+my ($path, $alias);
 #1 -> true
 #0 -> false
 #Ok, open the file for read mode
+
 open(HOSTFILE, $monoserver_hostfile);
 #.. read it!
 #Line counter
@@ -55,6 +63,7 @@
 	}
 	else {
 	    $opened_section = "0";
+	    $applications = "$applications$alias:$path,";
 	}
     }	
     
@@ -72,6 +81,9 @@
  		print "Sorry\, but you have a path that doesn't exists in your system! (line $counter)\n";
 		last;
  	    }
+	    else {
+		$path = $dir;
+	    }
 	}
     }
 
@@ -80,8 +92,13 @@
 	    print "Sorry\, but you have an alias in a unopened section (line $counter)\n";
 	    last;
 	}
-	#else.. ok :-)
+	else {
+	    $alias = (split /\= /, $line)[1];
+	    $alias =~ s/\n//;
+	}
     }	
 }
 	
 close(HOSTFILE);
+$applications =~ s/,$//;
+print $applications;

Modified: xsp-snapshot/trunk/debian/official/mono-server-update.conf
===================================================================
--- xsp-snapshot/trunk/debian/official/mono-server-update.conf	2004-04-17 08:20:26 UTC (rev 602)
+++ xsp-snapshot/trunk/debian/official/mono-server-update.conf	2004-04-17 20:21:56 UTC (rev 603)
@@ -49,16 +49,18 @@
 $orig_md5 = &get_md5;
 #Read directory..
 &read_dir;
-#cp the temp file to the original one..
-system("cp -f $monoserver_hostfile.tmp $monoserver_hostfile");
-#rm the temp
-system("rm -Rf $monoserver_hostfile.tmp");
-#Final md5
-$new_md5 = &get_md5;
-#Equal?
-if(("$new_md5" ne "$orig_md5") && ($restart eq "yes")) {
-    if( -f $daemon ) {
-	system("$daemon restart");
+if(-f "$monoserver_hostfile.tmp") {
+    #cp the temp file to the original one..
+    system("cp -f $monoserver_hostfile.tmp $monoserver_hostfile");
+    #rm the temp
+    system("rm -Rf $monoserver_hostfile.tmp");
+    #Final md5
+    $new_md5 = &get_md5;
+    #Equal?
+    if(("$new_md5" ne "$orig_md5") && ($restart eq "yes")) {
+	if( -f $daemon ) {
+	    system("$daemon restart");
+	}
     }
 }
 

Modified: xsp-snapshot/trunk/debian/official/mono-xsp-reader.conf
===================================================================
--- xsp-snapshot/trunk/debian/official/mono-xsp-reader.conf	2004-04-17 08:20:26 UTC (rev 602)
+++ xsp-snapshot/trunk/debian/official/mono-xsp-reader.conf	2004-04-17 20:21:56 UTC (rev 603)
@@ -27,8 +27,16 @@
     exit 1 ;
 }
 
+if( ! -f "$xsp_hostfile" ) {
+    print "Sorry\, but you don't have $xsp_hostfile\n";
+    exit 0;
+}
 
+
 my $opened_section = 0;
+my $applications = "";
+
+my ($path, $alias);
 #1 -> true
 #0 -> false
 #Ok, open the file for read mode
@@ -54,6 +62,7 @@
 	}
 	else {
 	    $opened_section = "0";
+	    $applications = "$applications$alias:$path,";
 	}
     }	
     
@@ -71,6 +80,9 @@
  		print "Sorry\, but you have a path that doesn't exists in your system! (line $counter)\n";
 		last;
  	    }
+	    else {
+		$path = $dir;
+	    }
 	}
     }
 
@@ -79,8 +91,13 @@
 	    print "Sorry\, but you have an alias in a unopened section (line $counter)\n";
 	    last;
 	}
-	#else.. ok :-)
+	else {
+	    $alias = (split /\= /, $line)[1];
+	    $alias =~ s/\n//;
+	}
     }	
 }
 	
 close(HOSTFILE);
+$applications =~ s/,$//;
+print $applications;

Modified: xsp-snapshot/trunk/debian/official/mono-xsp-update.conf
===================================================================
--- xsp-snapshot/trunk/debian/official/mono-xsp-update.conf	2004-04-17 08:20:26 UTC (rev 602)
+++ xsp-snapshot/trunk/debian/official/mono-xsp-update.conf	2004-04-17 20:21:56 UTC (rev 603)
@@ -44,21 +44,22 @@
 }
 
 
-
 #Orig md5
 $orig_md5 = &get_md5;
 #Read directory..
 &read_dir;
 #cp the temp file to the original one..
-system("cp -f $xsp_hostfile.tmp $xsp_hostfile");
-#rm the temp
-system("rm -Rf $xsp_hostfile.tmp");
-#Final md5
-$new_md5 = &get_md5;
-#Equal?
-if(("$new_md5" ne "$orig_md5") && ($restart eq "yes")) {
-    if( -f $daemon ) {
-	system("$daemon restart");
+if( -f "$xsp_hostfile.tmp" ) {
+    system("cp -f $xsp_hostfile.tmp $xsp_hostfile");
+    #rm the temp
+    system("rm -Rf $xsp_hostfile.tmp");
+    #Final md5
+    $new_md5 = &get_md5;
+    #Equal?
+    if(("$new_md5" ne "$orig_md5") && ($restart eq "yes")) {
+	if( -f $daemon ) {
+	    system("$daemon restart");
+	}
     }
 }