]> andersk Git - moira.git/blobdiff - gen/hesiod.sh
Initial revision
[moira.git] / gen / hesiod.sh
index a232acda15fc4288656d3cbfb5bb6f396c4179d0..95c9ba8cf5a32a18c80ccbcfc1cdfda3294a5a61 100644 (file)
@@ -26,7 +26,9 @@ endif
 # parition, so find out where $DEST_DIR is and put $SRC_DIR there too.
 set old = $cwd
 chdir $DEST_DIR
-set SRC_DIR_TMP = $cwd:h/_nameserver
+# Don't use $cwd; it won't follow the link
+set CUR_DIR = `pwd`
+set SRC_DIR_TMP = $CUR_DIR:h/_nameserver
 if (! -d $SRC_DIR_TMP) then
    /bin/rm -f $SRC_DIR_TMP
    /bin/mkdir $SRC_DIR_TMP
@@ -37,26 +39,26 @@ cd $old
 unset old SRC_DIR_TMP
 
 # Alert if tarfile doesn't exist
-if (! -r $TARFILE) exit SMS_MISSINGFILE
+if (! -r $TARFILE) exit $SMS_MISSINGFILE
 
 # Empty the tar file one file at a time and move each file to the
 # appropriate place only if it is not zero length. 
 cd $SRC_DIR
-foreach  file (`/bin/tar tf $TARFILE | awk '{print $1}'`)
-   if (./ == $file) continue
+foreach  file (`/bin/tar tf $TARFILE | awk '{print $1}' | sed 's;/$;;'`)
+   if (. == $file) continue
 
    rm -rf $file
    echo extracting $file
    /bin/tar xf $TARFILE $file
    # Don't put up with errors extracting the information
-   if ($status) exit SMS_TARERR
+   if ($status) exit $SMS_TARERR
    # Make sure the file is not zero-length
    if (! -z $file) then
       /bin/mv -f $file $DEST_DIR
-      if ($status != 0) exit SMS_HESFILE
+      if ($status != 0) exit $SMS_HESFILE
    else
       /bin/rm -f $file
-      exit SMS_MISSINGFILE
+      exit $SMS_MISSINGFILE
    endif
 end
 
@@ -90,7 +92,7 @@ while ($i < $TIMEOUT)
 end
 
 # Did it time out?
-if ($i == $TIMEOUT) exit SMS_NAMED
+if ($i == $TIMEOUT) exit $SMS_NAMED
 
 # Clean up!
 /bin/rm -f $TARFILE
This page took 0.056068 seconds and 4 git commands to generate.