[Pkg-rpm-devel] Bug#867680: osc: support both obs-build and vanilla build

Luca Boccassi luca.boccassi at gmail.com
Sat Jul 8 12:56:36 UTC 2017

Package: osc
Version: 0.156.0-1
Severity: wishlist
Tags: patch

Dear Maintainer,

In Debian SUSE's "build" package is renamed to "obs-build", and so osc
carries a patch to make it compatible.

Unfortunately the patch makes it incompatible with SUSE's version. Very
often when doing development, upstream sources are used.
This is a constant cause of problems and confusion among many users in
my workplace, myself included.

I have sent a patch upstream, which was just merged, to make osc
compatible with both obs-build and build. This will make things much
easier for users:


The patch is attached inline, and it would be great if it could be used
in place of the existing one. It's adapted to apply on top of 0.156.

As a stretch goal, it would be nice if the Recommends could be changed
from "obs-build" to "obs-build | build", so that things won't break
when using SUSE's upstream repository.

Thank you!

Kind regards,
Luca Boccassi

From 5f47b5ca7b689997646c9504dfc64cb419141d48 Mon Sep 17 00:00:00 2001
From: Luca Boccassi <luca.boccassi at gmail.com>
Date: Fri, 7 Jul 2017 17:47:43 +0100
Subject: [PATCH] Add compatibility with Debian's obs-build

In Debian and Ubuntu build is renamed to obs-build for disambiguation
Add a simple check to use the correct paths if running on Debian and
use /usr/bin/obs-build and /usr/lib/obs-build if so.
 osc/conf.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/osc/conf.py b/osc/conf.py
index e49014d..2fd8e80 100644
--- a/osc/conf.py
+++ b/osc/conf.py
@@ -183,6 +183,12 @@ DEFAULTS = {'apiurl': 'https://api.opensuse.org',
             'vc-cmd': '/usr/lib/build/vc'
+# some distros like Debian rename and move build to obs-build
+if not os.path.isfile('/usr/bin/build') and os.path.isfile('/usr/bin/obs-build'):
+    DEFAULTS['build-cmd'] = '/usr/bin/obs-build'
+if not os.path.isfile('/usr/lib/build/vc') and os.path.isfile('/usr/lib/obs-build/vc'):
+    DEFAULTS['vc-cmd'] = '/usr/lib/obs-build/vc'
 # being global to this module, this dict can be accessed from outside
 # it will hold the parsed configuration
 config = DEFAULTS.copy()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.alioth.debian.org/pipermail/pkg-rpm-devel/attachments/20170708/b28a0abc/attachment.sig>

More information about the Pkg-rpm-devel mailing list