Commit 53f44355 authored by Andrew Lee (李健秋)'s avatar Andrew Lee (李健秋)
Browse files

Handle links properly when doing backend build operations

These are fixed from upstream 2.7 branch. Originally from pull
request#3284 in upstream:

Signed-off-by: default avatarAndrew Lee (李健秋) <>
parent dff667d0
From be9fc5f2f7c564392948f127faff6486225ba8e6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Geuken?= <>
Date: Mon, 26 Jun 2017 15:06:51 +0200
Subject: [PATCH] [dist] Use 2.7 packages for testing 2.7 branch in travis
dist/ci/ | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Origin: upstream,
diff --git a/dist/ci/ b/dist/ci/
index 85238dbd1..f9ecadaeb 100755
--- a/dist/ci/
+++ b/dist/ci/
@@ -8,7 +8,7 @@ sudo apt-key adv --keyserver --recv-keys C5C219E7
# Install updates from our own repository
sudo chmod a+w /etc/apt/sources.list.d
-echo 'deb /' > /etc/apt/sources.list.d/opensuse.list
+echo 'deb /' > /etc/apt/sources.list.d/opensuse.list
# We could use this to only update the package list from the OBS,
# but apprently this is not possible anymore. So we update all package lists.
commit d4bddd6df495cc436185961fb497dacedc046008
Author: Adrian Schröter <>
Date: Thu Jun 22 12:12:01 2017 +0200
[webui] Handle links properly when doing backend build operations
OBS wasn't properly handling linked projects when triggering rebuilds,
wipe binaries and abort build. This resulted in packages of linked
projects being aborted, wiped, rebuilt.
This fixes the falsey code.
Pair-programmed with @eduardoj and @bgeuken
Origin: upstream,
--- a/src/api/app/models/package.rb
+++ b/src/api/app/models/package.rb
@@ -1344,22 +1344,23 @@ class Package < ActiveRecord::Base
+ #### WARNING: these operations run in build object, not this package object
def rebuild(params)
- backend_build_command(:rebuild, params.slice(:package, :arch, :repository))
+ backend_build_command(:rebuild, params[:project], params.slice(:package, :arch, :repository))
def wipe_binaries(params)
- backend_build_command(:wipe, params.slice(:package, :arch, :repository))
+ backend_build_command(:wipe, params[:project], params.slice(:package, :arch, :repository))
def abort_build(params)
- backend_build_command(:abortbuild, params.slice(:package, :arch, :repository))
+ backend_build_command(:abortbuild, params[:project], params.slice(:package, :arch, :repository))
- def backend_build_command(command, params)
+ def backend_build_command(command, build_project, params)
-"/build/#{URI.escape(}?cmd=#{command}&#{params.to_query}", '')
- rescue ActiveXML::Transport::Error, Timeout::Error => e
+"/build/#{URI.escape(build_project)}?cmd=#{command}&#{params.to_query}", '')
+ rescue ActiveXML::Transport::Error, Timeout::Error, Project::WritePermissionError => e
errors.add(:base, e.message)
return false
......@@ -16,3 +16,5 @@ Do-not-ship-database.yml.patch
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment