diff options
Diffstat (limited to 'meta/recipes-support/createrepo')
-rw-r--r-- | meta/recipes-support/createrepo/createrepo/createrepo-dbpath.patch | 61 | ||||
-rw-r--r-- | meta/recipes-support/createrepo/createrepo_0.4.11.bb | 1 |
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 @@ | |||
1 | createrepo: Implement --dbpath command line option | ||
2 | |||
3 | --dbpath option allows to specify path to the directory | ||
4 | with rpm database. By default createrepo uses or creates | ||
5 | rpm database in /var/lib/rpm/ | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | |||
9 | Signed-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 | ||