Skip to contentSkip to conversation

Misc fixes

PATCH Applied Martin Jansa 2 participants 5 messages May 13, 2011 – May 17, 2011

lore
Share & tools
lore
#0 lore raw

cover Misc fixes

Pull URL: git://git.openembedded.org/openembedded-core-contrib
Branch: jansa/pull
Browse: http://git.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=jansa/pull

Thanks,
Martin Jansa <[email protected]>
---

Martin Jansa (3):
lib/oe/process.py: import from OE
glib-2.0: use PN instead of glib-2.0 in PACKAGES and FILES bitbake.conf: move VENDOR variables from bitbake.conf to
defaultsetup.conf

 meta/conf/bitbake.conf              |    4 --
 meta/conf/distro/defaultsetup.conf  |    5 ++-
 meta/lib/oe/process.py              |   74 +++++++++++++++++++++++++++++++++++
 meta/recipes-core/glib-2.0/glib.inc |    4 +-
 4 files changed, 80 insertions(+), 7 deletions(-)
 create mode 100644 meta/lib/oe/process.py
Signature · 1 line
1.7.5.rc3
#1 lore raw

PATCH 1/3 lib/oe/process.py: import from OE

---
 meta/lib/oe/process.py |   74 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 74 insertions(+), 0 deletions(-)
 create mode 100644 meta/lib/oe/process.py
meta/lib/oe/process.py new file +74 -0
new file mode 100644
index 0000000..26c3e65
@@ -0,0 +1,74 @@
+import subprocess
+import signal
+
+def subprocess_setup():
+    # Python installs a SIGPIPE handler by default. This is usually not what
+    # non-Python subprocesses expect.
+    signal.signal(signal.SIGPIPE, signal.SIG_DFL)
+
+class CmdError(RuntimeError):
+    def __init__(self, command):
+        self.command = command
+
+    def __str__(self):
+        if not isinstance(self.command, basestring):
+            cmd = subprocess.list2cmdline(self.command)
+        else:
+            cmd = self.command
+
+        return "Execution of '%s' failed" % cmd
+
+class NotFoundError(CmdError):
+    def __str__(self):
+        return CmdError.__str__(self) + ": command not found"
+
+class ExecutionError(CmdError):
+    def __init__(self, command, exitcode, stdout = None, stderr = None):
+        CmdError.__init__(self, command)
+        self.exitcode = exitcode
+        self.stdout = stdout
+        self.stderr = stderr
+
+    def __str__(self):
+        message = ""
+        if self.stderr:
+            message += self.stderr
+        if self.stdout:
+            message += self.stdout
+        if message:
+            message = ":\n" + message
+        return (CmdError.__str__(self) +
+                " with exit code %s" % self.exitcode + message)
+
+class Popen(subprocess.Popen):
+    defaults = {
+        "close_fds": True,
+        "preexec_fn": subprocess_setup,
+        "stdout": subprocess.PIPE,
+        "stderr": subprocess.STDOUT,
+        "stdin": subprocess.PIPE,
+        "shell": False,
+    }
+
+    def __init__(self, *args, **kwargs):
+        options = dict(self.defaults)
+        options.update(kwargs)
+        subprocess.Popen.__init__(self, *args, **options)
+
+def run(cmd, input=None, **options):
+    """Convenience function to run a command and return its output, raising an
+    exception when the command fails"""
+
+    if isinstance(cmd, basestring) and not "shell" in options:
+        options["shell"] = True
+    try:
+        pipe = Popen(cmd, **options)
+    except OSError, exc:
+        if exc.errno == 2:
+            raise NotFoundError(cmd)
+        else:
+            raise
+    stdout, stderr = pipe.communicate(input)
+    if pipe.returncode != 0:
+        raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
+    return stdout
Signature · 1 line
1.7.5.rc3
#2 lore raw

PATCH 2/3 glib-2.0: use PN instead of glib-2.0 in PACKAGES and FILES

In reply to Martin Jansa

* otherwise notes like this are shown:
NOTE: multiple providers are available for runtime glib-2.0-utils (glib-2.0-nativesdk, glib-2.0)
NOTE: consider defining a PREFERRED_PROVIDER entry to match glib-2.0-utils

---
 meta/recipes-core/glib-2.0/glib.inc |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
meta/recipes-core/glib-2.0/glib.inc +2 -2
index 83f1990..f015fd3 100644
@@ -18,10 +18,10 @@ require glib-2.0.inc
 DEPENDS = "glib-2.0-native gtk-doc-native zip dbus"
 DEPENDS_virtclass-native = "gtk-doc-native pkgconfig-native gettext-native dbus-native"
 DEPENDS_virtclass-nativesdk = "libtool-nativesdk"
-PACKAGES =+ "glib-2.0-utils "
+PACKAGES =+ "${PN}-utils "
 
 LEAD_SONAME = "libglib-2.0.*"
-FILES_glib-2.0-utils = "${bindir}/*"
+FILES_${PN}-utils = "${bindir}/*"
 
 inherit autotools pkgconfig gettext
 
Signature · 1 line
1.7.5.rc3
#3 lore raw

PATCH 3/3 bitbake.conf: move VENDOR variables from bitbake.conf to defaultsetup.conf

In reply to Martin Jansa

* empty TARGET_VENDOR was set before weak assignment in defaultsetup.conf
* -oecore was changed to -oe to be more consistent with SDK_VENDOR as we had -oesdk as SDK_VENDOR and not -oecoresdk

---
 meta/conf/bitbake.conf             |    4 ----
 meta/conf/distro/defaultsetup.conf |    5 ++++-
 2 files changed, 4 insertions(+), 5 deletions(-)
meta/conf/bitbake.conf +0 -4
index 7c72de1..418a15d 100644
@@ -62,7 +62,6 @@ target_datadir := "${datadir}"
 
 BUILD_ARCH = "${@os.uname()[4]}"
 BUILD_OS = "${@os.uname()[0].lower()}"
-BUILD_VENDOR = ""
 BUILD_SYS = "${BUILD_ARCH}${BUILD_VENDOR}-${BUILD_OS}"
 BUILD_PREFIX = ""
 BUILD_CC_ARCH = ""
@@ -70,7 +69,6 @@ BUILD_EXEEXT = ""
 
 HOST_ARCH = "${TARGET_ARCH}"
 HOST_OS = "${TARGET_OS}"
-HOST_VENDOR = "${TARGET_VENDOR}"
 HOST_SYS = "${HOST_ARCH}${HOST_VENDOR}-${HOST_OS}"
 HOST_PREFIX = "${TARGET_PREFIX}"
 HOST_CC_ARCH = "${TARGET_CC_ARCH}"
@@ -78,14 +76,12 @@ HOST_EXEEXT = ""
 
 TARGET_ARCH = "INVALID"
 TARGET_OS = "INVALID"
-TARGET_VENDOR = "${BUILD_VENDOR}"
 TARGET_SYS = "${TARGET_ARCH}${TARGET_VENDOR}${@['-' + bb.data.getVar('TARGET_OS', d, 1), ''][bb.data.getVar('TARGET_OS', d, 1) == ('' or 'custom')]}"
 TARGET_PREFIX = "${TARGET_SYS}-"
 TARGET_CC_ARCH = ""
 
 SDK_ARCH = "${BUILD_ARCH}"
 SDK_OS = "${BUILD_OS}"
-SDK_VENDOR = "-oesdk"
 SDK_SYS = "${SDK_ARCH}${SDK_VENDOR}${@['-' + bb.data.getVar('SDK_OS', d, 1), ''][bb.data.getVar('SDK_OS', d, 1) == ('' or 'custom')]}"
 SDK_PREFIX = "${SDK_SYS}-"
 SDK_CC_ARCH = "${BUILD_CC_ARCH}"
meta/conf/distro/defaultsetup.conf +4 -1
index 8da6c0a..dd9ffc3 100644
@@ -3,7 +3,10 @@ include conf/distro/include/default-versions.inc
 include conf/distro/include/default-distrovars.inc
 include conf/distro/include/world-broken.inc
 
-TARGET_VENDOR ?= "-oecore"
+BUILD_VENDOR ?= ""
+TARGET_VENDOR ?= "-oe"
+HOST_VENDOR ?= "${TARGET_VENDOR}"
+SDK_VENDOR ?= "-oesdk"
 
 TARGET_FPU_arm ?= "soft"
 TARGET_FPU_armeb ?= "soft"
Signature · 1 line
1.7.5.rc3
Applied
#4 lore raw
In reply to Martin Jansa
Quoted 15 lines · Martin Jansa

Pull URL: git://git.openembedded.org/openembedded-core-contrib
Branch: jansa/pull
Browse: http://git.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=jansa/pull

Thanks,
Martin Jansa<[email protected]>
---

Martin Jansa (3):
lib/oe/process.py: import from OE
glib-2.0: use PN instead of glib-2.0 in PACKAGES and FILES bitbake.conf: move VENDOR variables from bitbake.conf to
defaultsetup.conf

Quoted 7 lines
  meta/conf/bitbake.conf              |    4 --
  meta/conf/distro/defaultsetup.conf  |    5 ++-
  meta/lib/oe/process.py              |   74 +++++++++++++++++++++++++++++++++++
  meta/recipes-core/glib-2.0/glib.inc |    4 +-
  4 files changed, 80 insertions(+), 7 deletions(-)

create mode 100644 meta/lib/oe/process.py

Merged into oe-core with a tweak or two by RP

Thanks
Sau!