]> git.pld-linux.org Git - projects/pld-builder.new.git/commitdiff
- different approach: skip command into shell commands
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 8 Feb 2010 20:37:30 +0000 (20:37 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    PLD_Builder/build.py -> 1.14
    PLD_Builder/request_handler.py -> 1.51
    client/make-request.sh -> 1.69

PLD_Builder/build.py
PLD_Builder/request_handler.py
client/make-request.sh

index d91edd80bd7122f9788d26c2e3d14797dc3410ea..d384167f7f44fef39630ef761194a7f6345d5304 100644 (file)
@@ -16,9 +16,24 @@ import status
 from config import config, init_conf
 
 
+
 def run_command(batch):
+    # we want to keep "skip" in queue.html
+    command = batch.command
+
+    # rewrite special "skip:BUILD_ID into touch
+    if command[:5] == "skip:":
+        c = "set -x; echo SKIPME; echo SKIPME >&2;"
+        for id in command[5:].split(','):
+            if os.path.isdir(path.srpms_dir + '/' + id):
+                c = c + "echo skip:%s;\n" % (id)
+                c = c + "touch %s/%s;\n" % (path.srpms_dir, id)
+            else:
+                c = c + "echo %s is not valid build-id;\n" % (id)
+        command = c
+
     if "no-chroot" in batch.command_flags:
-        c = "%s >> %s 2>&1" % (batch.command, batch.logfile)
+        c = "%s >> %s 2>&1" % (command, batch.logfile)
         f = os.popen(c)
         for l in f.xreadlines():
             pass
@@ -31,7 +46,7 @@ def run_command(batch):
         user = "root"
         if "as-builder" in batch.command_flags:
             user = "builder"
-        return chroot.run(batch.command, logfile = batch.logfile, user = user)
+        return chroot.run(command, logfile = batch.logfile, user = user)
 
 def build_all(r, build_fnc):
     status.email = r.requester_email
index efe13dcb2a1a0add21314f2dbc38be87f59d1f74..87c3008ea3c0686221c81de4b11b741d8c406ca3 100644 (file)
@@ -56,6 +56,7 @@ def handle_group(r, user):
         return
 
     for batch in r.batches:
+
         if not user.can_do("src", config.builder, batch.branch):
             fail_mail("user %s is not allowed to src:%s:%s" \
                         % (user.get_login(), config.builder, batch.branch))
@@ -74,31 +75,11 @@ def handle_group(r, user):
             return
 
         # src builder handles only special commands
-        if batch.is_command() and (batch.command in ["cvs up"] or config.builder in batch.builders):
+        if batch.is_command() and (batch.command in ["cvs up"] or batch.command[:5] == "skip:"  or config.builder in batch.builders):
             batch.expand_builders(config.binary_builders + [config.src_builder])
         else:
             batch.expand_builders(config.binary_builders)
 
-        if batch.skip:
-            msg = ""
-            for id in batch.skip:
-                if os.path.isdir(path.srpms_dir + '/' + id):
-                    fd = open(path.srpms_dir + '/' + id + '/skipme', 'w')
-                    fd.write("skip request %s" % (user.get_login()))
-                    fd.close()
-                    log.notice("skip request %s by %s" % (id, user.get_login()))
-                    msg = msg + "skip %s\n" % id
-                else:
-                    msg = msg + "no srpm dir for %s\n" % id
-
-            m = user.message_to()
-            m.set_headers(subject = "skip request")
-            m.write_line(msg)
-            m.send()
-
-            lockf.close()
-            return
-
         if not batch.is_command() and config.builder in batch.builders:
             batch.builders.remove(config.builder)
 
index a03ae024687ba7a1bb7d30d178c8fa6ed5a62d4c..d309c7959e77892398f52047ba4a7a8af5894045 100644 (file)
@@ -182,10 +182,7 @@ while [ $# -gt 0 ] ; do
                        ;;
 
                -s|--skip)
-                       f_upgrade=no
-                       build_mode=test
-                       priority=-1
-                       skip=$2
+                       skip="$2"
                        shift
                        ;;
 
@@ -329,6 +326,16 @@ aidath)
        ;;
 esac
 
+# need to do this after distro selection
+if [ "$skip" ]; then
+       f_upgrade=no
+       build_mode=test
+       priority=-1
+       command="skip:$skip"
+       command_flags="no-chroot"
+       builders="$distro-src"
+fi
+
 branch=${branch:-$default_branch}
 
 specs=`for s in $specs; do
@@ -379,7 +386,7 @@ for s in $specs; do
 done
 
 if [ "$ok" = "" ] ; then
-       if [ -z "$command" -a -z "$skip" ]; then
+       if [ -z "$command" ]; then
                die "no specs passed"
        fi
 else
@@ -412,16 +419,6 @@ gen_req() {
                        echo "           <builder>$b</builder>"
                done
                echo "  </batch>"
-
-       elif [ "$skip" ]; then
-               bid=$(uuidgen)
-               echo "  <batch id='$bid' depends-on=''>"
-               for s in {$skip,}; do
-                       [ "$s" ] || continue
-                       echo >&2 "* Skip: $s"
-                       echo "<skip>$s</skip>"
-               done
-               echo "  </batch>"
        else
 
        echo >&2 "* Using priority $priority"
This page took 0.187744 seconds and 4 git commands to generate.