Make get_package less noisy when there are no jobs
authorSteve McIntyre <steve@einval.com>
Mon, 29 Oct 2018 11:41:22 +0000 (11:41 +0000)
committerSteve McIntyre <steve@einval.com>
Mon, 29 Oct 2018 11:41:22 +0000 (11:41 +0000)
bin/get_package

index 8a636a4..86d08b3 100755 (executable)
@@ -8,7 +8,12 @@ STATEDIR=/home/build/state
 cd in
 
 while true; do
-    FILE=$(ls -1 *.q | head -1)
+    FILE=$(ls -1 *.q 2>/dev/null| head -1)
+    if [ "$FILE"x = ""x ]; then
+       # If we didn't find a job
+       echo NOPACKAGE
+       exit 1
+    fi
     NUM=$(echo $FILE | cut -d. -f1)
     mv $NUM.q $NUM.proc
     if [ $? -ne 0 ]; then # we clashed