summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-04-01 15:09:18 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-04-02 12:02:49 +0100
commita274e39f0c8f57d9d3b8506a375021d50d8de53f (patch)
tree77e82b01a734a1bedbae29f6cfe7ca0de7124b6c /meta/recipes-support
parentdfaa74d34f741bb880ac856d7e5ca489160ee0c8 (diff)
downloadast2050-yocto-poky-a274e39f0c8f57d9d3b8506a375021d50d8de53f.zip
ast2050-yocto-poky-a274e39f0c8f57d9d3b8506a375021d50d8de53f.tar.gz
createrepo: Implement --dbpath command line option
--dbpath option can be used in cases where users don't want createrepo to use system rpm db to avoid possible collisiouns with other programs. For bitbake builds it would be possible to specify different databases even for every createrepo run. Considering that rootfs builds can run multiple createrepo in parallel, it can help to avoid race conditions caused by accessing or creating the same rpm database by multiple createrepo instances at the same time. (From OE-Core rev: 32324c0d7f669083cc7066e6dfc8c58248fb5429) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support')
-rw-r--r--meta/recipes-support/createrepo/createrepo/createrepo-dbpath.patch61
-rw-r--r--meta/recipes-support/createrepo/createrepo_0.4.11.bb1
2 files changed, 62 insertions, 0 deletions
diff --git a/meta/recipes-support/createrepo/createrepo/createrepo-dbpath.patch b/meta/recipes-support/createrepo/createrepo/createrepo-dbpath.patch
new file mode 100644
index 0000000..7275598
--- /dev/null
+++ b/meta/recipes-support/createrepo/createrepo/createrepo-dbpath.patch
@@ -0,0 +1,61 @@
+createrepo: Implement --dbpath command line option
+
+--dbpath option allows to specify path to the directory
+with rpm database. By default createrepo uses or creates
+rpm database in /var/lib/rpm/
+
+Upstream-Status: Pending
+
+Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
+
+--- createrepo-0.4.11.orig/genpkgmetadata.py 2015-03-30 22:18:19.904000000 +0300
++++ createrepo-0.4.11/genpkgmetadata.py 2015-03-30 22:28:49.208000000 +0300
+@@ -65,6 +65,7 @@
+ -p, --pretty = output xml files in pretty format.
+ --update = update existing metadata (if present)
+ -d, --database = generate the sqlite databases.
++ --dbpath <dir> = specify path to rpm db directory.
+ """)
+
+ sys.exit(retval)
+@@ -72,10 +73,13 @@
+ class MetaDataGenerator:
+ def __init__(self, cmds):
+ self.cmds = cmds
+- self.ts = rpm.TransactionSet()
+ self.pkgcount = 0
+ self.files = []
+
++ if self.cmds['dbpath']:
++ rpm.addMacro("_dbpath", self.cmds['dbpath'])
++ self.ts = rpm.TransactionSet()
++
+ def _os_path_walk(self, top, func, arg):
+ """Directory tree walk with callback function.
+ copy of os.path.walk, fixes the link/stating problem
+@@ -435,6 +439,7 @@
+ cmds['dir-pattern-match'] = ['.*bin\/.*', '^\/etc\/.*']
+ cmds['skip-symlinks'] = False
+ cmds['pkglist'] = []
++ cmds['dbpath'] = None
+
+ try:
+ gopts, argsleft = getopt.getopt(args, 'phqVvndg:s:x:u:c:o:CSi:', ['help', 'exclude=',
+@@ -442,7 +447,7 @@
+ 'baseurl=', 'groupfile=', 'checksum=',
+ 'version', 'pretty', 'split', 'outputdir=',
+ 'noepoch', 'checkts', 'database', 'update',
+- 'skip-symlinks', 'pkglist='])
++ 'skip-symlinks', 'pkglist=', 'dbpath='])
+ except getopt.error, e:
+ errorprint(_('Options Error: %s.') % e)
+ usage()
+@@ -516,6 +521,8 @@
+ cmds['skip-symlinks'] = True
+ elif arg in ['-i', '--pkglist']:
+ cmds['pkglist'] = a
++ elif arg == '--dbpath':
++ cmds['dbpath'] = os.path.realpath(a)
+
+ except ValueError, e:
+ errorprint(_('Options Error: %s') % e)
diff --git a/meta/recipes-support/createrepo/createrepo_0.4.11.bb b/meta/recipes-support/createrepo/createrepo_0.4.11.bb
index 49b45fc..adc193e 100644
--- a/meta/recipes-support/createrepo/createrepo_0.4.11.bb
+++ b/meta/recipes-support/createrepo/createrepo_0.4.11.bb
@@ -14,6 +14,7 @@ SRC_URI= "http://createrepo.baseurl.org/download/${BP}.tar.gz \
file://python-scripts-should-use-interpreter-from-env.patch \
file://createrepo-rpm549.patch \
file://recommends.patch \
+ file://createrepo-dbpath.patch \
file://rpm-createsolvedb.py \
"
OpenPOWER on IntegriCloud