Skip to contentSkip to conversation

Bug 2134 - bitbake package-index fails for rpm

PATCH Applied Andrei Gherzan 2 participants 5 messages Apr 11, 2012 – Apr 13, 2012

lore
Share & tools
lore
#0 lore raw

cover Bug 2134 - bitbake package-index fails for rpm

The bug is that the native python used to run genpkgmetadata.py is picking up host's python modules.

More about this. RPM is built without python. And this modules is needed by the above py file.

So:
1. rpm-native should be built with python support.
2. native python should only look into STAGING_DIR_NATIVE directory for modules.
3. createrepo scripts should use native python

The following changes since commit 190f6d791d51aaa4cfb9f1cf932bc205ff674fb5:

runqemu-internal: Add console=tty for qemuppc and NFS (2012-04-06 01:12:47 +0100)

are available in the git repository at:
git://git.yoctoproject.org/poky-contrib ag/package-index
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ag/package-index

Andrei Gherzan (3):
createrepo: Python scripts should use the python interpreter from env
package-index: Force NATIVE python to use modules from
STAGING_DIR_NATIVE
rpm-native: Compile python rpm module (with-python)

 meta/recipes-core/meta/package-index.bb            |    3 +
 meta/recipes-devtools/rpm/rpm_5.4.0.bb             |    2 -
 ...n-scripts-should-use-interpreter-from-env.patch |   47 ++++++++++++++++++++
 .../createrepo/createrepo_0.4.11.bb                |    3 +-
 4 files changed, 52 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-support/createrepo/createrepo/python-scripts-should-use-interpreter-from-env.patch
Signature · 1 line
1.7.5.4
#1 lore raw

PATCH 1/3 createrepo: Python scripts should use the python interpreter from env

Added path to modify the hardcoded path of python interpreter from python scripts.
The python interpreter should be the one from native sysroot and not the one from host machine.

[YOCTO #2134]

---
 ...n-scripts-should-use-interpreter-from-env.patch |   47 ++++++++++++++++++++
 .../createrepo/createrepo_0.4.11.bb                |    3 +-
 2 files changed, 49 insertions(+), 1 deletions(-)
 create mode 100644 meta/recipes-support/createrepo/createrepo/python-scripts-should-use-interpreter-from-env.patch
meta/recipes-support/createrepo/createrepo/python-scripts-should-use-interpreter-from-env.patch new file +47 -0
new file mode 100644
index 0000000..80205a1
@@ -0,0 +1,47 @@
+Author: Andrei Gherzan <[email protected]>
+
+Python interpreter should be use from PATH - native python - and not the one from
+host.
+
+Upstream-Status: Inappropriate [configuration]
+
+Index: createrepo-0.4.11/genpkgmetadata.py
+===================================================================
+--- createrepo-0.4.11.orig/genpkgmetadata.py	2012-04-10 17:14:05.278649384 +0300
++++ createrepo-0.4.11/genpkgmetadata.py	2012-04-10 17:14:22.290648886 +0300
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python -t
++#! /usr/bin/env python
+ # primary functions and glue for generating the repository metadata
+ #
+ 
+Index: createrepo-0.4.11/modifyrepo.py
+===================================================================
+--- createrepo-0.4.11.orig/modifyrepo.py	2012-04-10 17:14:09.106649272 +0300
++++ createrepo-0.4.11/modifyrepo.py	2012-04-10 17:14:27.818648725 +0300
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#! /usr/bin/env python
+ # $Id$
+ #
+ # This tools is used to insert arbitrary metadata into an RPM repository.
+Index: createrepo-0.4.11/dumpMetadata.py
+===================================================================
+--- createrepo-0.4.11.orig/dumpMetadata.py	2012-04-10 17:19:23.874640068 +0300
++++ createrepo-0.4.11/dumpMetadata.py	2012-04-10 17:19:34.502639756 +0300
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python -t
++#! /usr/bin/env python
+ # base classes and functions for dumping out package Metadata
+ #
+ # This program is free software; you can redistribute it and/or modify
+Index: createrepo-0.4.11/readMetadata.py
+===================================================================
+--- createrepo-0.4.11.orig/readMetadata.py	2012-04-10 17:19:19.626640193 +0300
++++ createrepo-0.4.11/readMetadata.py	2012-04-10 17:19:40.198639590 +0300
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python -t
++#! /usr/bin/env python
+ 
+ # This program is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
meta/recipes-support/createrepo/createrepo_0.4.11.bb +2 -1
index ba1d04b..989a745 100644
@@ -4,10 +4,11 @@ HOMEPAGE = "http://createrepo.baseurl.org/"
 LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760"
 
-PR = "r1"
+PR = "r2"
 
 SRC_URI= "http://createrepo.baseurl.org/download/${BP}.tar.gz \
           file://fix-native-install.patch \
+          file://python-scripts-should-use-interpreter-from-env.patch \
          "
 
 SRC_URI[md5sum] = "3e9ccf4abcffe3f49af078c83611eda2"
Signature · 1 line
1.7.5.4
#2 lore raw

PATCH 2/3 package-index: Force NATIVE python to use modules from STAGING_DIR_NATIVE

Export PYTHONHOME to ${STAGING_DIR_NATIVE}/usr. In this way python will search for modules in native sysroot.

[YOCTO #2134]

---
 meta/recipes-core/meta/package-index.bb |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
meta/recipes-core/meta/package-index.bb +3 -0
index bf3922f..96d54e3 100644
@@ -21,6 +21,9 @@ do_populate_sysroot[noexec] = "1"
 do_package_index[nostamp] = "1"
 do_package_index[depends] += "${PACKAGEINDEXDEPS}"
 
+# Force NATIVE python to use modules from STAGING_DIR_NATIVE
+export PYTHONHOME = "${STAGING_DIR_NATIVE}/usr"
+
 do_package_index() {
 	set -ex
 	${PACKAGEINDEXES}
Signature · 1 line
1.7.5.4
#3 lore raw

PATCH 3/3 rpm-native: Compile python rpm module (with-python)

In reply to Andrei Gherzan

This module is needed by python scripts from createrepo native package.

[YOCTO #2134]

---
 meta/recipes-devtools/rpm/rpm_5.4.0.bb |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
meta/recipes-devtools/rpm/rpm_5.4.0.bb +0 -2
index 4576f67..d44ff99 100644
@@ -99,8 +99,6 @@ WITH_PYTHON = "	--with-python=${PYTHON_BASEVERSION} \
 		--without-pythonembed \
 	      "
 
-WITH_PYTHON_virtclass-native = " --without-python"
-
 # Perl modules are not built, but they could be enabled fairly easily
 # the perl module creation and installation would need to be patched.
 # (currently has host perl contamination issues)
Signature · 1 line
1.7.5.4
Applied
#4 lore raw
In reply to Andrei Gherzan
Quoted 27 lines · Andrei Gherzan

The bug is that the native python used to run genpkgmetadata.py is picking up host's python modules.

More about this. RPM is built without python. And this modules is needed by the above py file.

So:
1. rpm-native should be built with python support.
2. native python should only look into STAGING_DIR_NATIVE directory for modules.
3. createrepo scripts should use native python

The following changes since commit 190f6d791d51aaa4cfb9f1cf932bc205ff674fb5:

   runqemu-internal: Add console=tty for qemuppc and NFS (2012-04-06 01:12:47 +0100)

are available in the git repository at:
git://git.yoctoproject.org/poky-contrib ag/package-index
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ag/package-index

Andrei Gherzan (3):
createrepo: Python scripts should use the python interpreter from env
package-index: Force NATIVE python to use modules from
STAGING_DIR_NATIVE
rpm-native: Compile python rpm module (with-python)

Quoted 7 lines
  meta/recipes-core/meta/package-index.bb            |    3 +
  meta/recipes-devtools/rpm/rpm_5.4.0.bb             |    2 -
  ...n-scripts-should-use-interpreter-from-env.patch |   47 ++++++++++++++++++++
  .../createrepo/createrepo_0.4.11.bb                |    3 +-
  4 files changed, 52 insertions(+), 3 deletions(-)

create mode 100644 meta/recipes-support/createrepo/createrepo/python-scripts-should-use-interpreter-from-env.patch

Merged into OE-Core

Thanks
Sau!