summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/rootfs_rpm.bbclass2
-rwxr-xr-xmeta/recipes-support/createrepo/createrepo/rpm-createsolvedb.py64
-rw-r--r--meta/recipes-support/createrepo/createrepo_0.4.11.bb4
3 files changed, 68 insertions, 2 deletions
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index c9258dfe39..a03e9f379d 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -17,7 +17,7 @@ do_rootfs[depends] += "rpmresolve-native:do_populate_sysroot"
17do_rootfs[depends] += "opkg-native:do_populate_sysroot" 17do_rootfs[depends] += "opkg-native:do_populate_sysroot"
18 18
19# Creating the repo info in do_rootfs 19# Creating the repo info in do_rootfs
20#do_rootfs[depends] += "createrepo-native:do_populate_sysroot" 20do_rootfs[depends] += "createrepo-native:do_populate_sysroot"
21 21
22do_rootfs[recrdeptask] += "do_package_write_rpm" 22do_rootfs[recrdeptask] += "do_package_write_rpm"
23 23
diff --git a/meta/recipes-support/createrepo/createrepo/rpm-createsolvedb.py b/meta/recipes-support/createrepo/createrepo/rpm-createsolvedb.py
new file mode 100755
index 0000000000..a5b61bade7
--- /dev/null
+++ b/meta/recipes-support/createrepo/createrepo/rpm-createsolvedb.py
@@ -0,0 +1,64 @@
1#!/usr/bin/env python
2#
3# This script generates a solution database for a directory containing rpm packages
4# but tries to be efficient about this, only doing so when the packages have changed
5# in some way.
6#
7# It is assumed something already went through and removed all the solvedb.done stamp files
8# in advance.
9#
10# First argument - the rpm binary to use
11# Subsequent arguments - paths to process solution databases for
12#
13
14import sys, os
15import hashlib
16import stat
17import subprocess
18
19if len(sys.argv) < 1:
20 print("Error, rpm command not specified")
21 sys.exit(1)
22
23if len(sys.argv) < 2:
24 print("Error, no paths specified")
25 sys.exit(1)
26
27paths = sys.argv[2:]
28
29for path in paths:
30 if os.path.exists(path + "/solvedb.done"):
31 continue
32 data = ""
33 manifest = []
34 for root, dirs, files in os.walk(path):
35 for file in files:
36 f = os.path.join(root, file)
37 if f.startswith(path + "/" + "solvedb"):
38 continue
39 data = data + str(os.stat(f)[stat.ST_MTIME])
40 manifest.append(f)
41 checksum = hashlib.md5(data).hexdigest()
42
43 if os.path.exists(path + "/solvedb.checksum") and open(path + "/solvedb.checksum", "r").read() == checksum:
44 open(path + "/solvedb.done", "w")
45 continue
46
47 if os.path.exists(path + "/solvedb"):
48 subprocess.call("rm -rf %s" % (path + "/solvedb"), shell=True)
49 os.mkdir(path + "/solvedb")
50 m = open(path + "/solvedb/manifest", "w")
51 m.write("# Dynamically generated solve manifest\n")
52 for f in manifest:
53 m.write(f + "\n")
54 m.close()
55
56 cmd = sys.argv[1] + ' -i --replacepkgs --replacefiles --oldpackage -D "_dbpath ' + path + '/solvedb" --justdb \
57 --noaid --nodeps --noorder --noscripts --notriggers --noparentdirs --nolinktos --stats \
58 --ignoresize --nosignature --nodigest -D "__dbi_txn create nofsync" \
59 ' + path + '/solvedb/manifest'
60 subprocess.call(cmd, shell=True)
61
62 open(path + "/solvedb.checksum", "w").write(checksum)
63 open(path + "/solvedb.done", "w")
64
diff --git a/meta/recipes-support/createrepo/createrepo_0.4.11.bb b/meta/recipes-support/createrepo/createrepo_0.4.11.bb
index 7a4d05968e..dcddcf8331 100644
--- a/meta/recipes-support/createrepo/createrepo_0.4.11.bb
+++ b/meta/recipes-support/createrepo/createrepo_0.4.11.bb
@@ -6,12 +6,13 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760"
6 6
7RDEPENDS_${PN}_virtclass-native += "libxml2-native rpm-native" 7RDEPENDS_${PN}_virtclass-native += "libxml2-native rpm-native"
8 8
9PR = "r4" 9PR = "r5"
10 10
11SRC_URI= "http://createrepo.baseurl.org/download/${BP}.tar.gz \ 11SRC_URI= "http://createrepo.baseurl.org/download/${BP}.tar.gz \
12 file://fix-native-install.patch \ 12 file://fix-native-install.patch \
13 file://python-scripts-should-use-interpreter-from-env.patch \ 13 file://python-scripts-should-use-interpreter-from-env.patch \
14 file://createrepo-rpm549.patch \ 14 file://createrepo-rpm549.patch \
15 file://rpm-createsolvedb.py \
15 " 16 "
16 17
17SRC_URI[md5sum] = "3e9ccf4abcffe3f49af078c83611eda2" 18SRC_URI[md5sum] = "3e9ccf4abcffe3f49af078c83611eda2"
@@ -21,4 +22,5 @@ BBCLASSEXTEND = "native"
21 22
22do_install () { 23do_install () {
23 oe_runmake -e 'DESTDIR=${D}' install 24 oe_runmake -e 'DESTDIR=${D}' install
25 install -m 0755 ${WORKDIR}/rpm-createsolvedb.py ${D}${bindir}/
24} 26}