From: Robert Schuster <thebohemian@gmx.net>
To: openembedded-devel@lists.openembedded.org
Subject: RFC: allow subdir for SRC_URI entries
Date: Tue, 13 Jan 2009 14:18:13 +0100 [thread overview]
Message-ID: <496C9495.40003@gmx.net> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 503 bytes --]
Hi folks,
I desperately need this patch. ;)
It allows one to specify ";subdir=<DIR>" in SRC_URI entries. Having the
effect that the respective file is either unpacked or copied into that
very directory which is treated as:
${WORKDIR}/<DIR>
It is not really ${WORKDIR} but the cwd when do_unpack is run. In most
cases this is ${WORKDIR}. If it is something else the recipe writer will
have a reason for that.
With this patch we can finally deal easily with tarbombs.
Regards
Robert
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: oe-subdir.patch --]
[-- Type: text/x-patch; name="oe-subdir.patch", Size: 3428 bytes --]
diff --git a/classes/base.bbclass b/classes/base.bbclass
index b2b6085..fca0edd 100644
--- a/classes/base.bbclass
+++ b/classes/base.bbclass
@@ -725,9 +725,20 @@ def oe_unpack_file(file, data, url = None):
if os.path.samefile(file, dest):
return True
+ # Change to subdir before executing command
+ save_cwd = os.getcwd();
+ parm = bb.decodeurl(url)[5]
+ if 'subdir' in parm:
+ newdir = ("%s/%s" % (os.getcwd(), parm['subdir']))
+ bb.mkdirhier(newdir)
+ os.chdir(newdir)
+
cmd = "PATH=\"%s\" %s" % (bb.data.getVar('PATH', data, 1), cmd)
bb.note("Unpacking %s to %s/" % (file, os.getcwd()))
ret = os.system(cmd)
+
+ os.chdir(save_cwd)
+
return ret == 0
addtask unpack after do_fetch
diff --git a/conf/distro/chinook-compat.conf b/conf/distro/chinook-compat.conf
index ff6aa1f..3a086d8 100644
--- a/conf/distro/chinook-compat.conf
+++ b/conf/distro/chinook-compat.conf
@@ -172,12 +172,14 @@ PREFERRED_VERSION_hildon-thumbnail = "0.14"
PREFERRED_VERSION_osso-gwconnect = "1.0.12"
PREFERRED_VERSION_osso-gnome-vfs2 = "2.16.3"
+PREFERRED_VERSION_shared-mime-info = "0.22"
+
# Java stuff
PREFERRED_PROVIDER_midpath = "midpath-maemo"
PREFERRED_PROVIDER_midpath-backend-gtk = "midpath-backend-gtk-hildon"
# Need jamvm-initial since cacao 0.98 seems to get miscompiled with newer GCCs.
-PREFERRED_PROVIDER_virtual/java-initial = "jamvm-initial"
+#PREFERRED_PROVIDER_virtual/java-initial = "jamvm-initial"
PREFERRED_PROVIDER_virtual/javac-native = "ecj-bootstrap-native"
diff --git a/packages/dpkg/dpkg.inc b/packages/dpkg/dpkg.inc
index eb5778f..c677fe0 100644
--- a/packages/dpkg/dpkg.inc
+++ b/packages/dpkg/dpkg.inc
@@ -2,7 +2,8 @@ DESCRIPTION = "Package maintenance system for Debian."
LICENSE = "GPL"
SECTION = "base"
-SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.gz \
+#SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.gz \
+SRC_URI = "http://mirrors.ludost.net/gentoo/distfiles/dpkg_${PV}.tar.gz \
file://ignore_extra_fields.patch;patch=1 \
file://noupdalt.patch;patch=1"
diff --git a/packages/update-alternatives/update-alternatives-dpkg-native_1.13.22.bb b/packages/update-alternatives/update-alternatives-dpkg-native_1.13.22.bb
index 70b5cb7..6e09c0d 100644
--- a/packages/update-alternatives/update-alternatives-dpkg-native_1.13.22.bb
+++ b/packages/update-alternatives/update-alternatives-dpkg-native_1.13.22.bb
@@ -1,8 +1,13 @@
require update-alternatives-dpkg.inc
inherit native
+SRC_URI = "\
+ http://www.scratchbox.org/download/files/sbox-files/dpkg_${PV}.tar.gz \
+ file://paths.patch;patch=1 \
+ "
+
PROVIDES += "virtual/update-alternatives-native"
-DEPENDS = "perl-native dpkg-native"
+DEPENDS = "perl-native"
DEFAULT_PREFERENCE = "-1"
do_stage () {
diff --git a/packages/update-alternatives/update-alternatives-dpkg_1.13.22.bb b/packages/update-alternatives/update-alternatives-dpkg_1.13.22.bb
index a07d5e3..826b088 100644
--- a/packages/update-alternatives/update-alternatives-dpkg_1.13.22.bb
+++ b/packages/update-alternatives/update-alternatives-dpkg_1.13.22.bb
@@ -1,5 +1,10 @@
require update-alternatives-dpkg.inc
+SRC_URI = "\
+ http://www.scratchbox.org/download/files/sbox-files/dpkg_${PV}.tar.gz \
+ file://paths.patch;patch=1 \
+ "
+
RPROVIDES_${PN} = "update-alternatives"
RDEPENDS_${PN} = "perl dpkg"
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 268 bytes --]
next reply other threads:[~2009-01-13 13:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-13 13:18 Robert Schuster [this message]
2009-01-13 13:39 ` RFC: allow subdir for SRC_URI entries Koen Kooi
2009-01-13 14:35 ` Graeme Gregory
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=496C9495.40003@gmx.net \
--to=thebohemian@gmx.net \
--cc=openembedded-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox