Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
7f21679
- do not forward requests if accept fails (issue 91)
adrianschroeter May 21, 2014
a833120
do_updatepacmetafromspec: added "updatepkgmetafromspec" alias
marcus-h May 22, 2014
6bb8ca4
core: style, de-duplicate read() calls
rudimeier May 22, 2014
1d7b954
core: streamfile() can read line by line
rudimeier May 22, 2014
7fc5936
core: fix, buildlog --strip-time failed to remove time
rudimeier May 22, 2014
e2abfe9
- OscConfigParser: added "proper" parameter to the has_option method
marcus-h Jun 4, 2014
7efd6db
- added support for a per apiurl "build-root" option
marcus-h Jun 4, 2014
fff6f3d
Merge branch 'fix-bl-strip-time' of https://github.com/rudimeier/osc
marcus-h Jun 4, 2014
444a503
- fixed #89 ("osc commit fails with do_package_tracking = 0")
marcus-h Jun 4, 2014
a754164
- use HTTPError.hdrs instead of HTTPError.headers
marcus-h Jun 8, 2014
fdfbcdc
- babysitter: catch URLGrabError exception
marcus-h Jun 8, 2014
2f8db7f
- speedup update of a project working copy
marcus-h Jun 22, 2014
d45b3e4
- get_sourceinfo: workaround for too long request uri (status code 414)
marcus-h Jun 23, 2014
0389a03
- renamed {show,get}_sourceinfo to {show,get}_project_sourceinfo
marcus-h Jun 23, 2014
cb9a5d5
- show_project_sourceinfo: quote package names
marcus-h Jun 24, 2014
ee15c4c
Add ppc64le to Debian arch map
Jun 25, 2014
a8d0b94
- parse_repoarchdescr: improved error messages a bit
marcus-h Jul 2, 2014
e662fd8
- parse_repoarchdescr: improved yet another error message
marcus-h Jul 2, 2014
d86e287
- parse_repoarchdescr: allow an unsupported arch during the guessing …
marcus-h Jul 2, 2014
b2ad3eb
Make get_built_files() take the buildtype instead of the pactype
jblunck Jul 4, 2014
475d2a2
Add support for livebuild buildtype
jblunck Jul 8, 2014
f8a1fa2
- give a better hint to the user, when a search role is not defined
adrianschroeter Jul 10, 2014
ea349d9
- do_buildinfo: fixed "osc buildinfo -p <path>"
marcus-h Jul 15, 2014
e90a60a
Merge branch 'livebuild' of https://github.com/jblunck/osc
marcus-h Jul 16, 2014
e9233a5
- parse_repoarchdescr: remove duplicates from repo_names
marcus-h Jul 21, 2014
6a6e614
- switch to xz default for "osc add git://" ...
adrianschroeter Jul 22, 2014
7649481
- use "set_version" service by default on "osc add git://..."
adrianschroeter Jul 22, 2014
902adde
- do_localbuildlog: support %(apihost)s in build-root config setting
marcus-h Aug 4, 2014
1b6e2ac
support the ls expand option also for projects
lnussel Aug 11, 2014
d35983d
Resolve PEP8 issue W291
berendt Aug 12, 2014
b4d23f8
Resolve PEP8 issue E231
berendt Aug 13, 2014
1751bdc
Resolve PEP8 issue E231
berendt Aug 13, 2014
b07a4d0
Merge branch 'w291' of https://github.com/berendt/osc
marcus-h Aug 14, 2014
0282e14
Merge branch 'e231' of https://github.com/berendt/osc
marcus-h Aug 14, 2014
3adb160
support groups in maintainership requests
adrianschroeter Aug 19, 2014
3b6f7f1
- make it possible to list by given review states
adrianschroeter Aug 25, 2014
3606506
- prepare 0.147 release
adrianschroeter Aug 26, 2014
6a7535d
open 0.148 development
adrianschroeter Aug 26, 2014
e150dc0
- added NEWS entry for "speedup update of a project working copy"
marcus-h Aug 26, 2014
c63a6ea
add basic completion support for fish shell
rominf Sep 5, 2014
35372df
fish shell completion: help arguments
rominf Sep 5, 2014
e0d96a4
Initialize variable 's_built' during image build.
d4s Sep 9, 2014
b0479fa
- support new history including review history of OBS 2.6
adrianschroeter Sep 11, 2014
bd82e23
- display request priorities, if important or critical
adrianschroeter Sep 11, 2014
ea092a7
- roll 0.148 release for new request history support
adrianschroeter Sep 11, 2014
3d07bd8
- fix description rendering in history elements
adrianschroeter Sep 11, 2014
00ecb4d
- fix crash with not existing priorities
adrianschroeter Sep 12, 2014
45bf194
- do_createrequest: remove --diff option
marcus-h Sep 23, 2014
603cf3b
- fixed #113 ("osc creq -s ...")
marcus-h Sep 23, 2014
2f14ced
Fix condition for using urllib2 workaround
Sep 26, 2014
e44a452
- fixed #99 ("do_package_tracking = 0")
marcus-h Sep 26, 2014
e1cdf86
fix osc service exit code
aspiers Sep 30, 2014
a7c92eb
- do not hardcode path to the build scripts and removed legacy check
marcus-h Oct 1, 2014
e3bb5fb
- support multiple parallel maintenance workflows
adrianschroeter Oct 7, 2014
67caa8b
- oops, fixed typo
marcus-h Oct 11, 2014
ca7ad96
- raise more specific exceptions
marcus-h Oct 20, 2014
4c4650f
- prepare 0.149 bugfix release
marcus-h Oct 21, 2014
c69237b
- open 0.150 development
marcus-h Oct 21, 2014
e8f0e78
- do_addremove: use local variable instead of an attribute (cosmetic)
marcus-h Oct 21, 2014
26ffaa9
- do_addremove: fixed "corner case"
marcus-h Oct 21, 2014
27bdf6c
- do_addremove: if a "deleted" file exists in the wc, track it again
marcus-h Oct 21, 2014
3e57d58
- do_meta: fixed description (partly fixes #120)
marcus-h Oct 27, 2014
bb75ce3
- add "osc api --edit" option
adrianschroeter Oct 31, 2014
6a4423f
- better example for osc api -e
adrianschroeter Oct 31, 2014
165d238
- edit_message: restore old filename suffix
marcus-h Nov 2, 2014
d5b795a
osc build: add support for _buildenv upload
mlschroe Nov 7, 2014
6ccf64f
fix buildenv data name, it needs to be "buildenv"
mlschroe Nov 7, 2014
de702bb
- follow the request order of the api (sorting according to priorizat…
adrianschroeter Nov 11, 2014
87021e4
- fix crash regression 'issue#124'
adrianschroeter Nov 12, 2014
ad92e8a
- fixed #122 ("osc chroot fails to use the osc build buildroot direct…
marcus-h Nov 14, 2014
930dfc1
- parse_repoarchdescr: added openSUSE_Tumbleweed to the repository list
marcus-h Nov 17, 2014
f47c395
Verify hdrmd5 of packages if specified in the buildinfo
mlschroe Nov 17, 2014
d17b497
Added configuration options for kernel and initrd selection during KV…
d4s Nov 20, 2014
fddf2e3
- Package.mark_frozen: also print the name of the affected package
marcus-h Nov 21, 2014
42d3e81
- do_status: mark a frozen package with an "F"
marcus-h Nov 21, 2014
e1e2dd8
- fixed #129
marcus-h Dec 8, 2014
7acaba2
add obsoletes, conflicts, evr query methods
mlschroe Dec 5, 2014
7ca0b2d
send conflicts/obsoletes for local packages as well
mlschroe Dec 9, 2014
0495439
Add __repr__ for Repo class
jelly Dec 10, 2014
9cddc53
- add mr --release-project option for kgraft updates
adrianschroeter Dec 12, 2014
b2ec0c2
Merge branch 'repr' of https://github.com/jelly/osc
marcus-h Dec 17, 2014
68d10df
Revert "- reset retry counter on 404 answer for all python 2.7.x vers…
marcus-h Dec 23, 2014
3547ef9
Revert "Fix condition for using urllib2 workaround"
marcus-h Dec 23, 2014
8c8618a
- fixed corner case in __del__ method
marcus-h Jan 3, 2015
fbbf945
- trying a fallback in maintenance project detection
adrianschroeter Jan 9, 2015
8a70a0f
Added readline support to cmdln-module.
Jan 9, 2015
0d66a5b
- add makeoriginolder option in request actions
adrianschroeter Jan 9, 2015
df9c28b
- prepare 0.150.0 release
adrianschroeter Jan 9, 2015
a3c23a5
- open 0.151 development
adrianschroeter Jan 9, 2015
d53278d
- syntax fix
adrianschroeter Jan 13, 2015
8f5bf38
- do_status: mention 'S' state in the help text
marcus-h Jan 21, 2015
453be84
- fix crash on buildhistory with source linked packages
adrianschroeter Feb 12, 2015
4bd0436
- fix mismatch in given time, backend delivers always UTC unix time s…
adrianschroeter Feb 17, 2015
00c7b9d
fix typo in help message (bnc#918906)
bmwiedemann Feb 21, 2015
ecd7614
- add support for updating the link in target package in submit action
adrianschroeter Mar 9, 2015
2d3a511
- display updatelink option when showing submit actions
adrianschroeter Mar 9, 2015
7b79298
- fix test case for showing update link
adrianschroeter Mar 9, 2015
cff76bd
- added "name" attribute to the RequestHistory class
marcus-h Mar 9, 2015
7116509
- do_build: --noinit and --offline are _not_ mutually exclusive
marcus-h Mar 10, 2015
72e3856
fix osc shell injection
lnussel Oct 16, 2014
19944be
- 0.151.0 release
adrianschroeter Mar 12, 2015
2258bc6
- fix regression of 72e38569aec9519a1c80fb0e129187be45abd754
adrianschroeter Mar 16, 2015
8d39549
fix crash, when source service failed
adrianschroeter Mar 18, 2015
eda2e75
- ServiceInfo.execute: cmd is a list...
marcus-h Mar 26, 2015
72888fa
Add Mer packaging
martyone May 11, 2017
f4b32cc
Merge pull request #2 from mer-tools/jb36175-1
martyone May 18, 2017
ec56152
Reset mer-master to tag '0.151.2'
martyone May 18, 2017
6cb757c
Add Mer packaging
martyone May 11, 2017
e90f3e2
Add sb2install support to osc
stskeeps Feb 10, 2012
a9c7e05
Support 'osc copyprj' in api by Islam Amer
lbt May 1, 2012
0de8b47
Add support for --rebuild and --chroot-only in build.
lbt Jul 27, 2012
04a4478
Add architecture and scheduler maps
kaltsi Mar 15, 2013
9578f5b
Trap any kind of exception during plugin parsing (eg IOError for a da…
lbt Oct 14, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
0.151
- fixed shell command injection via crafted _service files (CVE-2015-0778)
- fix times when data comes from OBS backend
- support updateing the link in target package for submit requests
- various minor bugfixes

0.150
- support local builds using builenv (for same build environment as a former build)
- add "osc api --edit" option to be able to edit some meta files directly
- follow the request order of the api (sorting according to priorization)
- add mr --release-project option for kgraft updates
- add support for makeoriginolder in request

0.149
- removed "--diff" option from the "createrequest" command
- introduced new "vc-cmd" config option, which is used to specify the path
to the vc script
- various bugfixes

0.148
- support new history including review history of OBS 2.6
- display request priorities, if important or critical
- add "osc rq priorize" command to re-priorize existing requests
- allow also "osc rq ls" shortcut
- fish shell completion support

0.147
- support groups in maintainership requests
- fixing listing of review requests
- support expanded package listing (when using project links)
- fixing "osc add git://" behaviour
- using xz as default compression
- support local debian live (image) build format
- handle ppc64le for debian as well
- fix buildlog --strip-time
- some more minor bugfixes
- speedup update of a project working copy (in some cases)

0.146
- support maintenance release request with acceptinfo data (OBS 2.6)
- setlinkrev can be used to update frozen links to current revisions again
Expand Down
116 changes: 116 additions & 0 deletions osc.fish

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions osc/OscConfigParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,16 @@ def write(self, fp, comments = False):
else:
configparser.SafeConfigParser.write(self, fp)

def has_option(self, section, option, proper=False, **kwargs):
"""
Returns True, if the passed section contains the specified option.
If proper is True, True is only returned if the option is owned by
this section and not "inherited" from the default.
"""
if proper:
return self.optionxform(option) in self._sections[section].keys()
return configparser.SafeConfigParser.has_option(self, section, option, **kwargs)

# XXX: simplify!
def __str__(self):
ret = []
Expand Down
4 changes: 4 additions & 0 deletions osc/babysitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import sys
import signal
import traceback
from urlgrabber.grabber import URLGrabError

from osc import oscerr
from .oscsslexcp import NoSecureSSLError
Expand Down Expand Up @@ -140,6 +141,9 @@ def run(prg, argv=None):
except URLError as e:
print('Failed to reach a server:\n', e.reason, file=sys.stderr)
return 1
except URLGrabError as e:
print('Failed to grab %s: %s' % (e.url, e.exception), file=sys.stderr)
return 1
except IOError as e:
# ignore broken pipe
if e.errno != errno.EPIPE:
Expand Down
136 changes: 97 additions & 39 deletions osc/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@
]

can_also_build = {
'aarch64':['aarch64'], # only needed due to used heuristics in build parameter evaluation
'armv6l' :[ 'armv4l', 'armv5l', 'armv6l', 'armv5el', 'armv6el' ],
'armv7l' :[ 'armv4l', 'armv5l', 'armv6l', 'armv7l', 'armv5el', 'armv6el', 'armv7el' ],
'armv5el':[ 'armv4l', 'armv5l', 'armv5el' ], # not existing arch, just for compatibility
'armv6el':[ 'armv4l', 'armv5l', 'armv6l', 'armv5el', 'armv6el' ], # not existing arch, just for compatibility
'armv6hl':[ 'armv4l', 'armv5l', 'armv6l', 'armv5el', 'armv6el' ],
'armv7el':[ 'armv4l', 'armv5l', 'armv6l', 'armv7l', 'armv5el', 'armv6el', 'armv7el' ], # not existing arch, just for compatibility
'armv7hl':[ 'armv7hl' ], # not existing arch, just for compatibility
'armv8el':[ 'armv4l', 'armv5el', 'armv6el', 'armv7el', 'armv8el' ], # not existing arch, just for compatibility
'armv8l' :[ 'armv4l', 'armv5el', 'armv6el', 'armv7el', 'armv8el' ], # not existing arch, just for compatibility
'armv5tel':[ 'armv4l', 'armv5el', 'armv5tel' ],
'aarch64': ['aarch64'], # only needed due to used heuristics in build parameter evaluation
'armv6l': [ 'armv4l', 'armv5l', 'armv6l', 'armv5el', 'armv6el' ],
'armv7l': [ 'armv4l', 'armv5l', 'armv6l', 'armv7l', 'armv5el', 'armv6el', 'armv7el' ],
'armv5el': [ 'armv4l', 'armv5l', 'armv5el' ], # not existing arch, just for compatibility
'armv6el': [ 'armv4l', 'armv5l', 'armv6l', 'armv5el', 'armv6el' ], # not existing arch, just for compatibility
'armv6hl': [ 'armv4l', 'armv5l', 'armv6l', 'armv5el', 'armv6el' ],
'armv7el': [ 'armv4l', 'armv5l', 'armv6l', 'armv7l', 'armv5el', 'armv6el', 'armv7el' ], # not existing arch, just for compatibility
'armv7hl': [ 'armv7hl' ], # not existing arch, just for compatibility
'armv8el': [ 'armv4l', 'armv5el', 'armv6el', 'armv7el', 'armv8el' ], # not existing arch, just for compatibility
'armv8l': [ 'armv4l', 'armv5el', 'armv6el', 'armv7el', 'armv8el' ], # not existing arch, just for compatibility
'armv5tel': [ 'armv4l', 'armv5el', 'armv5tel' ],
's390x': ['s390' ],
'ppc64': [ 'ppc', 'ppc64', 'ppc64p7', 'ppc64le' ],
'ppc64le':[ 'ppc64le' ],
'ppc64le': [ 'ppc64le' ],
'i586': [ 'i386' ],
'i686': [ 'i586', 'i386' ],
'x86_64': ['i686', 'i586', 'i386' ],
Expand Down Expand Up @@ -116,6 +116,8 @@ def __init__(self, filename, apiurl, buildtype = 'spec', localpkgs = []):
self.pacsuffix = 'deb'
if self.buildtype == 'arch':
self.pacsuffix = 'arch'
if self.buildtype == 'livebuild':
self.pacsuffix = 'deb'

self.buildarch = root.find('arch').text
if root.find('hostarch') != None:
Expand Down Expand Up @@ -178,7 +180,7 @@ def __init__(self, node, buildarch, pacsuffix, apiurl, localpkgs = []):

self.mp = {}
for i in ['binary', 'package',
'epoch', 'version', 'release',
'epoch', 'version', 'release', 'hdrmd5',
'project', 'repository',
'preinstall', 'vminstall', 'noinstall', 'installonly', 'runscripts',
'sb2install',
Expand Down Expand Up @@ -256,32 +258,38 @@ def __repr__(self):



def get_built_files(pacdir, pactype):
if pactype == 'rpm':
def get_built_files(pacdir, buildtype):
if buildtype == 'spec':
b_built = subprocess.Popen(['find', os.path.join(pacdir, 'RPMS'),
'-name', '*.rpm'],
stdout=subprocess.PIPE).stdout.read().strip()
s_built = subprocess.Popen(['find', os.path.join(pacdir, 'SRPMS'),
'-name', '*.rpm'],
stdout=subprocess.PIPE).stdout.read().strip()
elif pactype == 'kiwi':
elif buildtype == 'kiwi':
b_built = subprocess.Popen(['find', os.path.join(pacdir, 'KIWI'),
'-type', 'f'],
stdout=subprocess.PIPE).stdout.read().strip()
elif pactype == 'deb':
s_built = ''
elif buildtype == 'dsc':
b_built = subprocess.Popen(['find', os.path.join(pacdir, 'DEBS'),
'-name', '*.deb'],
stdout=subprocess.PIPE).stdout.read().strip()
s_built = subprocess.Popen(['find', os.path.join(pacdir, 'SOURCES.DEB'),
'-type', 'f'],
stdout=subprocess.PIPE).stdout.read().strip()
elif pactype == 'arch':
elif buildtype == 'arch':
b_built = subprocess.Popen(['find', os.path.join(pacdir, 'ARCHPKGS'),
'-name', '*.pkg.tar*'],
stdout=subprocess.PIPE).stdout.read().strip()
s_built = ''
elif buildtype == 'livebuild':
b_built = subprocess.Popen(['find', os.path.join(pacdir, 'OTHER'),
'-name', '*.iso*'],
stdout=subprocess.PIPE).stdout.read().strip()
s_built = ''
else:
print('WARNING: Unknown package type \'%s\'.' % pactype, file=sys.stderr)
print('WARNING: Unknown package type \'%s\'.' % buildtype, file=sys.stderr)
b_built = ''
s_built = ''
return s_built, b_built
Expand Down Expand Up @@ -311,9 +319,9 @@ def get_repo(path):

return repositoryDirectory

def get_prefer_pkgs(dirs, wanted_arch, type):
def get_prefer_pkgs(dirs, wanted_arch, type, cpio):
import glob
from .util import repodata, packagequery, cpio
from .util import repodata, packagequery
paths = []
repositories = []

Expand All @@ -340,7 +348,9 @@ def get_prefer_pkgs(dirs, wanted_arch, type):
packageQueries.add(packageQuery)

for path in paths:
if path.endswith('src.rpm'):
if path.endswith('.src.rpm') or path.endswith('.nosrc.rpm'):
continue
if path.endswith('.patch.rpm') or path.endswith('.delta.rpm'):
continue
if path.find('-debuginfo-') > 0:
continue
Expand All @@ -351,21 +361,27 @@ def get_prefer_pkgs(dirs, wanted_arch, type):
for name, packageQuery in packageQueries.items())

depfile = create_deps(packageQueries.values())
cpio = cpio.CpioWrite()
cpio.add('deps', '\n'.join(depfile))
return prefer_pkgs, cpio
return prefer_pkgs


def create_deps(pkgqs):
"""
creates a list of requires/provides which corresponds to build's internal
creates a list of dependencies which corresponds to build's internal
dependency file format
"""
depfile = []
for p in pkgqs:
id = '%s.%s-0/0/0: ' % (p.name(), p.arch())
depfile.append('R:%s%s' % (id, ' '.join(p.requires())))
depfile.append('P:%s%s' % (id, ' '.join(p.provides())))
depfile.append('R:%s%s' % (id, ' '.join(p.requires())))
d = p.conflicts()
if d:
depfile.append('C:%s%s' % (id, ' '.join(d)))
d = p.obsoletes()
if d:
depfile.append('O:%s%s' % (id, ' '.join(d)))
depfile.append('I:%s%s-%s 0-%s' % (id, p.name(), p.evr(), p.arch()))
return depfile


Expand All @@ -381,7 +397,7 @@ def check_trusted_projects(apiurl, projects):
if not prj in trusted:
print("\nThe build root needs packages from project '%s'." % prj)
print("Note that malicious packages can compromise the build result or even your system.")
r = raw_input(trustprompt % { 'project':prj })
r = raw_input(trustprompt % { 'project': prj })
if r == '1':
print("adding '%s' to ~/.oscrc: ['%s']['trusted_prj']" % (prj, apiurl))
trusted.append(prj)
Expand All @@ -408,9 +424,9 @@ def main(apiurl, opts, argv):
build_type = os.path.splitext(build_descr)[1][1:]
if os.path.basename(build_descr) == 'PKGBUILD':
build_type = 'arch'
if build_type not in ['spec', 'dsc', 'kiwi', 'arch']:
if build_type not in ['spec', 'dsc', 'kiwi', 'arch', 'livebuild']:
raise oscerr.WrongArgs(
'Unknown build type: \'%s\'. Build description should end in .spec, .dsc or .kiwi.' \
'Unknown build type: \'%s\'. Build description should end in .spec, .dsc, .kiwi or .livebuild.' \
% build_type)
if not os.path.isfile(build_descr):
raise oscerr.WrongArgs('Error: build description file named \'%s\' does not exist.' % build_descr)
Expand Down Expand Up @@ -495,6 +511,7 @@ def main(apiurl, opts, argv):
if opts.shell:
buildargs.append("--shell")

orig_build_root = config['build-root']
# make it possible to override configuration of the rc file
for var in ['OSC_PACKAGECACHEDIR', 'OSC_SU_WRAPPER', 'OSC_BUILD_ROOT']:
val = os.getenv(var)
Expand All @@ -516,11 +533,15 @@ def main(apiurl, opts, argv):
pacname = os.path.splitext(build_descr)[0]
apihost = urlsplit(apiurl)[1]
if not build_root:
build_root = config['build-root']
if build_root == orig_build_root:
# ENV var was not set
build_root = config['api_host_options'][apiurl].get('build-root', build_root)
try:
build_root = config['build-root'] % {'repo': repo, 'arch': arch,
build_root = build_root % {'repo': repo, 'arch': arch,
'project': prj, 'package': pacname, 'apihost': apihost}
except:
build_root = config['build-root']
pass

cache_dir = config['packagecachedir'] % {'apihost': apihost}

Expand Down Expand Up @@ -553,11 +574,31 @@ def main(apiurl, opts, argv):
s += "%%define %s\n" % i
build_descr_data = s + build_descr_data

cpiodata = None
buildenvfile = os.path.join(os.path.dirname(build_descr), "_buildenv." + repo + "." + arch)
if not os.path.isfile(buildenvfile):
buildenvfile = os.path.join(os.path.dirname(build_descr), "_buildenv")
if not os.path.isfile(buildenvfile):
buildenvfile = None
if buildenvfile:
print('Using buildenv file: %s' % os.path.basename(buildenvfile))
from .util import cpio
if not cpiodata:
cpiodata = cpio.CpioWrite()

if opts.prefer_pkgs:
print('Scanning the following dirs for local packages: %s' % ', '.join(opts.prefer_pkgs))
prefer_pkgs, cpio = get_prefer_pkgs(opts.prefer_pkgs, arch, build_type)
cpio.add(os.path.basename(build_descr), build_descr_data)
build_descr_data = cpio.get()
from .util import cpio
if not cpiodata:
cpiodata = cpio.CpioWrite()
prefer_pkgs = get_prefer_pkgs(opts.prefer_pkgs, arch, build_type, cpiodata)

if cpiodata:
cpiodata.add(os.path.basename(build_descr), build_descr_data)
# buildenv must come last for compatibility reasons...
if buildenvfile:
cpiodata.add("buildenv", open(buildenvfile).read())
build_descr_data = cpiodata.get()

# special handling for overlay and rsync-src/dest
specialcmdopts = []
Expand Down Expand Up @@ -636,8 +677,8 @@ def main(apiurl, opts, argv):
pkg_meta_e = None
try:
# take care, not to run into double trouble.
pkg_meta_e = meta_exists(metatype='pkg', path_args=(quote_plus(prj),
quote_plus(pac)), template_args=None, create_new=False,
pkg_meta_e = meta_exists(metatype='pkg', path_args=(quote_plus(prj),
quote_plus(pac)), template_args=None, create_new=False,
apiurl=apiurl)
except:
pass
Expand Down Expand Up @@ -760,8 +801,9 @@ class mytmpdir:
""" temporary directory that removes itself"""
def __init__(self, *args, **kwargs):
self.name = mkdtemp(*args, **kwargs)
_rmtree = staticmethod(shutil.rmtree)
def cleanup(self):
shutil.rmtree(self.name)
self._rmtree(self.name)
def __del__(self):
self.cleanup()
def __exit__(self):
Expand Down Expand Up @@ -875,7 +917,7 @@ def __str__(self):
if not m:
# short path without obs instance name
m = re.match(r"obs://([^/]+)/(.+)", xml.find('source').get('path'))
project=m.group(1).replace(":",":/")
project=m.group(1).replace(":", ":/")
repo=m.group(2)
buildargs.append('--kiwi-parameter')
buildargs.append('--add-repo')
Expand Down Expand Up @@ -905,6 +947,17 @@ def __str__(self):
else:
print('WARNING: unknown packages get not verified, they can compromise your system !')

for i in bi.deps:
if i.hdrmd5:
from .util import packagequery
hdrmd5 = packagequery.PackageQuery.queryhdrmd5(i.fullfilename)
if not hdrmd5:
print("Error: cannot get hdrmd5 for %s" % i.fullfilename)
sys.exit(1)
if hdrmd5 != i.hdrmd5:
print("Error: hdrmd5 mismatch for %s: %s != %s" % (i.fullfilename, hdrmd5, i.hdrmd5))
sys.exit(1)

print('Writing build configuration')

if build_type == 'kiwi':
Expand Down Expand Up @@ -955,6 +1008,11 @@ def __str__(self):
if os.access(build_root, os.W_OK) and os.access('/dev/kvm', os.W_OK):
# so let's hope there's also an fstab entry
need_root = False
if config['build-kernel']:
vm_options += [ '--vm-kernel=' + config['build-kernel'] ]
if config['build-initrd']:
vm_options += [ '--vm-initrd=' + config['build-initrd'] ]

build_root += '/.mount'

if config['build-memory']:
Expand Down Expand Up @@ -1010,7 +1068,7 @@ def __str__(self):
pacdir = os.path.join(build_root, pacdir)

if os.path.exists(pacdir):
(s_built, b_built) = get_built_files(pacdir, bi.pacsuffix)
(s_built, b_built) = get_built_files(pacdir, bi.buildtype)

print()
if s_built: print(s_built)
Expand Down
2 changes: 1 addition & 1 deletion osc/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def readkey(self, file):

def check(self, pkg):
# avoid errors on non rpm
if pkg[-4:] != '.rpm':
if pkg[-4:] != '.rpm':
return
fd = None
try:
Expand Down
Loading