Openembedded Devel Discussions
 help / color / mirror / Atom feed
* RFC: allow subdir for SRC_URI entries
@ 2009-01-13 13:18 Robert Schuster
  2009-01-13 13:39 ` Koen Kooi
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Schuster @ 2009-01-13 13:18 UTC (permalink / raw)
  To: openembedded-devel


[-- 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 --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-01-13 14:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-13 13:18 RFC: allow subdir for SRC_URI entries Robert Schuster
2009-01-13 13:39 ` Koen Kooi
2009-01-13 14:35   ` Graeme Gregory

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox