summaryrefslogtreecommitdiffstats
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:36 +0100
commit673d0224cd391fe6d99535c4eb060d56a239c3d8 (patch)
tree028c815b1b32336756cc5e5f8c90d7da92c948ae
parent1674b5380c0a13e88cb0e615438bdbcaa5761e3c (diff)
downloadpoky-673d0224cd391fe6d99535c4eb060d56a239c3d8.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: 7dc6d50ac1fc20a262b62330d950a8e30acdf0b6) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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 0000000000..72755981a9
--- /dev/null
+++ b/meta/recipes-support/createrepo/createrepo/createrepo-dbpath.patch
@@ -0,0 +1,61 @@
1createrepo: Implement --dbpath command line option
2
3--dbpath option allows to specify path to the directory
4with rpm database. By default createrepo uses or creates
5rpm database in /var/lib/rpm/
6
7Upstream-Status: Pending
8
9Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
10
11--- createrepo-0.4.11.orig/genpkgmetadata.py 2015-03-30 22:18:19.904000000 +0300
12+++ createrepo-0.4.11/genpkgmetadata.py 2015-03-30 22:28:49.208000000 +0300
13@@ -65,6 +65,7 @@
14 -p, --pretty = output xml files in pretty format.
15 --update = update existing metadata (if present)
16 -d, --database = generate the sqlite databases.
17+ --dbpath <dir> = specify path to rpm db directory.
18 """)
19
20 sys.exit(retval)
21@@ -72,10 +73,13 @@
22 class MetaDataGenerator:
23 def __init__(self, cmds):
24 self.cmds = cmds
25- self.ts = rpm.TransactionSet()
26 self.pkgcount = 0
27 self.files = []
28
29+ if self.cmds['dbpath']:
30+ rpm.addMacro("_dbpath", self.cmds['dbpath'])
31+ self.ts = rpm.TransactionSet()
32+
33 def _os_path_walk(self, top, func, arg):
34 """Directory tree walk with callback function.
35 copy of os.path.walk, fixes the link/stating problem
36@@ -435,6 +439,7 @@
37 cmds['dir-pattern-match'] = ['.*bin\/.*', '^\/etc\/.*']
38 cmds['skip-symlinks'] = False
39 cmds['pkglist'] = []
40+ cmds['dbpath'] = None
41
42 try:
43 gopts, argsleft = getopt.getopt(args, 'phqVvndg:s:x:u:c:o:CSi:', ['help', 'exclude=',
44@@ -442,7 +447,7 @@
45 'baseurl=', 'groupfile=', 'checksum=',
46 'version', 'pretty', 'split', 'outputdir=',
47 'noepoch', 'checkts', 'database', 'update',
48- 'skip-symlinks', 'pkglist='])
49+ 'skip-symlinks', 'pkglist=', 'dbpath='])
50 except getopt.error, e:
51 errorprint(_('Options Error: %s.') % e)
52 usage()
53@@ -516,6 +521,8 @@
54 cmds['skip-symlinks'] = True
55 elif arg in ['-i', '--pkglist']:
56 cmds['pkglist'] = a
57+ elif arg == '--dbpath':
58+ cmds['dbpath'] = os.path.realpath(a)
59
60 except ValueError, e:
61 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 49b45fc3b8..adc193e428 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 \
14 file://python-scripts-should-use-interpreter-from-env.patch \ 14 file://python-scripts-should-use-interpreter-from-env.patch \
15 file://createrepo-rpm549.patch \ 15 file://createrepo-rpm549.patch \
16 file://recommends.patch \ 16 file://recommends.patch \
17 file://createrepo-dbpath.patch \
17 file://rpm-createsolvedb.py \ 18 file://rpm-createsolvedb.py \
18 " 19 "
19 20