1. VectorLinux Core
  2. vlbuildbot

Commits

M0E-lnx  committed 7bb1acf

Fix upload script syntax of case loop

  • Participants
  • Parent commits dcfa709
  • Branches master

Comments (0)

Files changed (1)

File slave/usr/local/bin/build-pusher

View file
 	version=$(pkgversion ${pkg})
 	pkgnam=$(pkgname ${pkg})
 	case "$pkgnam" in
-	    "kernel kernel-src kernel-modules kernel-src-stripped")
-	    ver=$(echo $version |cut -f 1-2 -d .)
-		rmtarget="${name}-${ver}*";;
+	    kernel|kernel-src|kernel-modules|ernel-src-stripped)
+		kver=$(echo $BUILDER |cut -f 2 -d "-")
+		#echo "Kernel major version $kver component upload detected"
+		rmtarget="$pkgnam-$kver.*"
+		#echo $rmtarget
+		;;
+	        #ver=$(echo $version |cut -f 1-2 -d .)
+		#rmtarget="${name}-${ver}.*";;
+	   ndiswrapper|broadcom-sta|bcm_wimax)
+		kver=$(echo $BUILDER|cut -f 2 -d "-")
+		rmtarget="$pkgnam-*$kver.*"
+		;;
 	    *)
 		rmtarget="${name}-[0-9]*";;
 	esac
 
 }
 
+function add_remote_lock() {
+	lock=$1
+	lftp <<EFO
+open sftp://$URL -u build-catcher,fakepass
+cd pool/
+echo " * Creating remote incoming lock"
+mkdir $lock
+EFO
+	}
+function clear_remote_lock() {
+	lock=$1
+lftp <<EFO
+open sftp://$URL -u build-catcher,fakepass
+cd pool/
+echo " * Removing remote incoming lock"
+rmdir $lock
+EFO
+}
 process_uploads(){
     echo " Uploading data "
-    echo "PWD: $PWD"
     if [ ${AUTO_UPLOAD} = "0" ]; then
 	echo " Automatic uploads are disabled"
 	exit 0
     fi
-#    echo ${WORKDIR}
+    ulock="incoming-$$.lock"
+    add_remote_lock $ulock
     cd ${WORKDIR} || exit 1
     for dir in $(ls); do
 	cd  ${dir} || exit 1
 	# create links.txt if possible and remove tarballs
 	echo " Checking for links.txt compatibility and preparing source directory"
 	cd src
-	#echo "pwd=$PWD"
-	#ls
 	make_links_txt
 	echo " Pushing data directory for ${dir}"
 	upload_source_dir
 	cd .. 
 	#cd ${WORKDIR}
      done
+# Clear the remote lock
+clear_remote_lock $ulock
 # Remove the direcctory
 cd /
 rm -rf $WORKPATH
+
 }
 	
 process_uploads