diff options
author | Koen Kooi <koen@dominion.thruhere.net> | 2011-02-07 15:27:27 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-02-07 21:13:19 +0000 |
commit | 36efa8933d979c1037754e37829c8be6529711e9 (patch) | |
tree | 49baad4c8838b7f926780df3f743ce9a40dd0251 /meta/recipes-devtools/rpm | |
parent | 500c66337c7cb5e3044a02ef761097713e47f523 (diff) | |
download | openembedded-core-36efa8933d979c1037754e37829c8be6529711e9.tar.gz openembedded-core-36efa8933d979c1037754e37829c8be6529711e9.tar.bz2 openembedded-core-36efa8933d979c1037754e37829c8be6529711e9.zip |
rpm: catch up with fetcher2
Update the rpm recipe after the recent changes to the fetcher API. Koen wrote
the original patch, Richard cleaned it up and fixed it.
This code needs to be merged into the fetcher instead at some point soon.
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/rpm')
-rw-r--r-- | meta/recipes-devtools/rpm/rpm_5.4.0.bb | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.0.bb b/meta/recipes-devtools/rpm/rpm_5.4.0.bb index e158b80cd1..ba1a2a2341 100644 --- a/meta/recipes-devtools/rpm/rpm_5.4.0.bb +++ b/meta/recipes-devtools/rpm/rpm_5.4.0.bb @@ -328,12 +328,19 @@ FILE_${PN}-dev = "${includedir}/rpm \ ###%{_rpmhome}/lib/librpmjsm.la ###%{_rpmhome}/lib/librpmjsm.so +def subprocess_setup(): + import signal + # Python installs a SIGPIPE handler by default. This is usually not what + # non-Python subprocesses expect. + # SIGPIPE errors are known issues with gzip/bash + signal.signal(signal.SIGPIPE, signal.SIG_DFL) + # If base_do_unpack is refactored this may have to be adjusted python base_do_unpack_append() { import subprocess - for url in src_uri: - local = bb.fetch2.localpath(url) + for url in bb.data.getVar("SRC_URI", d, True).split(): + local = bb.fetch2.localpath(url, d) if local is None: continue local = os.path.realpath(local) @@ -344,7 +351,7 @@ python base_do_unpack_append() { cmd = "%s %s | cpio -i" % (cmdname, efile) cmd = "PATH=\"%s\" %s" % (bb.data.getVar('PATH', localdata, 1), cmd) old_cwd = os.getcwd() - newdir = ("%s/%s" % (old_cwd, 'srpm-unpack')) + newdir = os.path.join(d.getVar("WORKDIR", True), 'srpm-unpack') bb.mkdirhier(newdir) os.chdir(newdir) ret = subprocess.call(cmd, preexec_fn=subprocess_setup, shell=True) @@ -352,16 +359,18 @@ python base_do_unpack_append() { if ret != 0: raise bb.build.FuncFailed('Unpack command failed: %s (%s)' % (cmd, ret)) - srpm_uri = bb.data.getVar('SRPM_UNPACK', localdata, True) - if not srpm_uri: + srpm_uri = bb.data.getVar('SRPM_UNPACK', localdata, True).split() + if len(srpm_uri) == 0: return - # Note, not really URI's! Just a list of files - for url in srpm_uri.split(): - local = os.path.join(bb.data.getVar('WORKDIR', localdata, 1), "srpm-unpack/" + url) - ret = oe_unpack_file(local, localdata, 'file://' + url) - if not ret: - raise bb.build.FuncFailed("oe_unpack_file failed with return value %s" % ret) + rootdir = bb.data.getVar('WORKDIR', localdata, True) + srpm_file_uri = [ "file://" + rootdir + "/srpm-unpack/" + uri for uri in srpm_uri]; + + try: + fetcher = bb.fetch2.Fetch(srpm_file_uri, localdata, cache=False) + fetcher.unpack(rootdir, srpm_file_uri) + except bb.fetch2.BBFetchException, e: + raise bb.build.FuncFailed(e) } do_configure() { |