[LON-CAPA-cvs] cvs: loncom /build check-rpms

harris41 lon-capa-cvs@mail.lon-capa.org
Mon, 04 Nov 2002 02:52:39 -0000


harris41		Sun Nov  3 21:52:39 2002 EDT

  Modified files:              
    /loncom/build	check-rpms 
  Log:
  allow ftp server authentication flags with the ncftpget command
  
  
Index: loncom/build/check-rpms
diff -u loncom/build/check-rpms:1.5 loncom/build/check-rpms:1.6
--- loncom/build/check-rpms:1.5	Thu Sep  5 13:20:46 2002
+++ loncom/build/check-rpms	Sun Nov  3 21:52:39 2002
@@ -395,6 +395,9 @@
    die "Either $RPMDIR does not exist or it does not contain any packages.\n";
 }
 
+my $FTPSERVER_auth = $FTPSERVER;
+$FTPSERVER_auth =~ s/^(\w+)\:(\w+)\@/-u $1 -p $2 /;
+
 if ($recheck) {
    $questionable=1;
 }
@@ -564,6 +567,7 @@
     }
 }
 
+
 if ($recheck && @q_updates) {
    if ($ftp) {    
       for (@q_updates) {
@@ -573,10 +577,11 @@
       if ($verbose) {
          print "Getting questionable packages form $FTPSERVER ...\n";
       }
-      my $status = system("$FTPGET $FTPSERVER $RPMDIR @ftp_files");
+      my $status = system("$FTPGET $FTPSERVER_auth $RPMDIR @ftp_files");
       if ($status) {
          if ($< == 0) {
             # if we are running as root exit to avoid symlink attacks, etc.
+print("DEBUG DEBUG $FTPGET $FTPSERVER_auth $RPMDIR @ftp_files");
             die "$FTPGET failed with status ", $status/256, ".\n";
 	 } else {
             print STDERR "warning: $FTPGET failed with status ", $status/256, ".\n";
@@ -618,7 +623,7 @@
        if ($verbose) {
           print "starting downloads ... \n";
        }
-       my $status = system("$FTPGET $FTPSERVER $RPMDIR @ftp_files");
+       my $status = system("$FTPGET $FTPSERVER_auth $RPMDIR @ftp_files");
        if ($status) {
           if ($< == 0) {
              # if we are running as root exit to avoid symlink attacks, etc.
@@ -655,10 +660,10 @@
        }
        if ($verbose) {
           print "starting downloads ... \n";
-          system("$FTPGET $FTPSERVER $$RPMDIR @ftp_files");
+          system("$FTPGET $FTPSERVER_auth $$RPMDIR @ftp_files");
           print "... done.\n";
        } else {
-          system("$FTPGET $FTPSERVER $$RPMDIR @ftp_files");
+          system("$FTPGET $FTPSERVER_auth $$RPMDIR @ftp_files");
        }
     }           
 }
@@ -689,7 +694,7 @@
        my ($arch) = m/[^ ]*-[^-]+-[^-]*\.(\w+)\.rpm$/;
        push(@ftp_packages,"$FTPDIR/$arch/$_");
     }
-    my $status = system("$FTPGET $FTPSERVER $downloaddir @ftp_packages");
+    my $status = system("$FTPGET $FTPSERVER_auth $downloaddir @ftp_packages");
     return $status;
 }