1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 22:56:15 +01:00

Merge branch 'obs-build' of https://github.com/bluca/osc

On debian /usr/lib/build was renamed to /usr/lib/obs-build.
This commit is contained in:
Marcus Huewe 2017-07-08 14:27:14 +02:00
commit 24fa0ae9d5
2 changed files with 13 additions and 1 deletions

View File

@ -12,6 +12,7 @@ import sys
import time
import imp
import inspect
import os
try:
from urllib.parse import urlsplit
from urllib.error import HTTPError
@ -5867,7 +5868,12 @@ Please submit there instead, or use --nodevelproject to force direct submission.
with tempfile.NamedTemporaryFile() as f:
f.write(bc)
f.flush()
recipe = return_external('/usr/lib/build/queryconfig', '--dist', f.name, 'type')
# some distros like Debian rename and move build to obs-build
if not os.path.isfile('/usr/lib/build/queryconfig') and os.path.isfile('/usr/lib/obs-build/queryconfig'):
queryconfig = '/usr/lib/obs-build/queryconfig'
else:
queryconfig = '/usr/lib/build/queryconfig'
recipe = return_external(queryconfig, '--dist', f.name, 'type')
recipe = recipe.strip()
if recipe == 'arch':
recipe = 'PKGBUILD'

View File

@ -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()