]> gitweb.fluxo.info Git - httruta.git/commitdiff
Fixing variable name
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 26 Aug 2013 02:26:23 +0000 (23:26 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 26 Aug 2013 02:26:23 +0000 (23:26 -0300)
lib/httracker/functions

index dcc8f4b8298240221f699ab5771cb846308e7f85..6d83b08c6c2513de48fe6822f5138e112116798f 100644 (file)
@@ -13,7 +13,7 @@ function httracker_opts {
          --purge-old=0            \
          --index                  \
          --cookies=1              \
-         --path ${target}"
+         --path ${TARGET}"
 }
 
 # Download URLs, mirror mode
@@ -22,14 +22,12 @@ function httracker_get {
   local url="$1"
   local hash="`echo $1 | sha1sum | cut -d ' ' -f 1`"
 
-  # Set target
-  target="$MIRRORS/$hash"
-
-  # Make sure that target exists
-  mkdir -p $target
+  # Set target and make sure it exists
+  TARGET="$MIRRORS/$hash"
+  mkdir -p $TARGET
 
   # We already got this one
-  if [ -f "$target/ok" ]; then
+  if [ -f "$TARGET/ok" ]; then
     return
   fi
 
@@ -43,7 +41,7 @@ function httracker_get {
 
   # Fix permissions
   if [ "`whoami`" != "$USER" ] && [ "`whoami`" == "root" ]; then
-    chown -R $USER.$GROUP $target/
+    chown -R $USER.$GROUP $TARGET/
   fi
 
   # Get each URL
@@ -51,21 +49,21 @@ function httracker_get {
 
   if [ "$?" == "0" ]; then
     # Mark as downloaded
-    touch $target/ok
+    touch $TARGET/ok
   else
     echo "Error fetching $url."
-    rm -rf $target
+    rm -rf $TARGET
   fi
 }
 
 # Download URLs, incremental mode
 function httracker_get_incremental {
-  # Create target dir
+  # Create TARGET dir
   year=`date +%Y`
   month=`date +%m`
   day=`date +%d`
-  target=${MIRRORDIR}/${year}/${month}
-  sudo -u ${USER} mkdir -p ${target}
+  TARGET=${MIRRORDIR}/${year}/${month}
+  sudo -u ${USER} mkdir -p ${TARGET}
 
   # Basic options
   httracker_opts