]> git.pld-linux.org Git - projects/pld-ftp-admin.git/commitdiff
- more changes
authorMariusz Mazur <mmazur@pld-linux.org>
Sat, 18 Sep 2004 13:21:40 +0000 (13:21 +0000)
committerMariusz Mazur <mmazur@pld-linux.org>
Sat, 18 Sep 2004 13:21:40 +0000 (13:21 +0000)
Changed files:
    bin/config -> 1.2
    bin/from-incoming.sh -> 1.6
    bin/functions -> 1.1
    bin/move.sh -> 1.5

bin/config [deleted file]
bin/from-incoming.sh
bin/functions [new file with mode: 0644]
bin/move.sh

diff --git a/bin/config b/bin/config
deleted file mode 100644 (file)
index 1f99bea..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-
-if [ ! -f ~/.ftpadmrc ]; then
-       echo "Config not found"
-       exit
-fi
-
-. ~/.ftpadmrc
-
index 789345b834fb63c291404777888cc45ae15a352b..caa4f81a84abdf659ae26274020f52bd73b90a41 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/sh
 
-. ~/pld-ftp-admin/scripts/config
+. ~/pld-ftp-admin/scripts/functions
+
 
 cd $INCOMING_DIR/SRPMS
 for i in *uploadinfo; do
@@ -15,8 +16,9 @@ for i in *uploadinfo; do
 
        srcname=`cat $i|grep '^file:SRPMS'|cut -d: -f 3`
        if [ -f $FTP_DIR/$DEFAULT_TO/SRPMS/.metadata/$srcname.info ]; then
-               # TODO: Do something more interesting here
-               echo "$srcname.info in $DEFAULT_TO already exists"
+               log "$srcname.info already present in $DEFAULT_TO; newer version removed"
+               rm $srcname
+               rm $i
                continue
        fi
 
@@ -40,7 +42,7 @@ for arch in $ARCHS; do
 
                srcname=`cat $i|grep '^file:SRPMS'|cut -d: -f 3`
                if [ ! -f $FTP_DIR/$DEFAULT_TO/SRPMS/.metadata/$srcname.info ]; then
-                       # TODO: Do something more interesting here
+                       # TODO: Do something more interesting here... or not
                        continue
                fi
 
diff --git a/bin/functions b/bin/functions
new file mode 100644 (file)
index 0000000..191a8c0
--- /dev/null
@@ -0,0 +1,18 @@
+
+# Read config
+if [ ! -f ~/.ftpadmrc ]; then
+       echo "Config not found"
+       exit
+fi
+
+. ~/.ftpadmrc
+
+# For logging
+scriptname=`basename $0`
+
+# Log a message... useful for debugging
+log() {
+       echo `date "+%F %T"` "[$scriptname]" "--" "$@" >>~/pld-ftp-admin/log
+}
+
+# vi: syntax=sh
index 177093fab1551511c47300afcd4e3f17b4282ace..06760fff00beef04dbbbf6aec1317387ce8d93ac 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-. ~/pld-ftp-admin/scripts/config
+. ~/pld-ftp-admin/scripts/functions
 
 if [ "$#" -lt "3" ]; then
        echo "Not enough parameters given"
This page took 0.094871 seconds and 4 git commands to generate.