summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2017-03-23 11:34:23 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-24 23:43:32 +0000
commitfcbad38193cad3e4e8d55cb54aefeed5f1dbc478 (patch)
treeb61c925c1c755bc2fb9a46f8b6b47f6b2e080313 /meta/lib
parentda8369b670f15bc74bc278e58c0090a3a477cb8e (diff)
downloadpoky-fcbad38193cad3e4e8d55cb54aefeed5f1dbc478.tar.gz
package_manager.py: respect OPKGLIBDIR
* respect it for incremental rootfs generation * add lists_dir option to opkg.conf * also fix setting info_dir and status_file when they use default value, the problem is that self.opkg_dir is already prefixed with rootfs directory, comparing it with /var/lib/opkg always returned false and the options were appended to config file unnecessary * with opkg 0.3.4 we can use VARDIR prefix added in: commit d2a8e23dc669adc398f4bb8bcfcabfcf925708f7 Author: Florin Gherendi <floring2502@gmail.com> Date: Mon Dec 19 12:25:38 2016 +0200 libopkg: make the /var and /etc directories configurable at compile time. (From OE-Core rev: b14c11d062872c3dcf95e03b61017005dea5b754) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/package_manager.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 8b2b33106e..54a3c5e293 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -946,13 +946,15 @@ class OpkgPM(OpkgDpkgPM):
946 self.d.getVar('FEED_DEPLOYDIR_BASE_URI'), 946 self.d.getVar('FEED_DEPLOYDIR_BASE_URI'),
947 arch)) 947 arch))
948 948
949 if self.opkg_dir != '/var/lib/opkg': 949 if self.d.getVar('OPKGLIBDIR') != '/var/lib':
950 # There is no command line option for this anymore, we need to add 950 # There is no command line option for this anymore, we need to add
951 # info_dir and status_file to config file, if OPKGLIBDIR doesn't have 951 # info_dir and status_file to config file, if OPKGLIBDIR doesn't have
952 # the default value of "/var/lib" as defined in opkg: 952 # the default value of "/var/lib" as defined in opkg:
953 # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_INFO_DIR "/var/lib/opkg/info" 953 # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_LISTS_DIR VARDIR "/lib/opkg/lists"
954 # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_STATUS_FILE "/var/lib/opkg/status" 954 # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_INFO_DIR VARDIR "/lib/opkg/info"
955 # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_STATUS_FILE VARDIR "/lib/opkg/status"
955 cfg_file.write("option info_dir %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'info')) 956 cfg_file.write("option info_dir %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'info'))
957 cfg_file.write("option lists_dir %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'lists'))
956 cfg_file.write("option status_file %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'status')) 958 cfg_file.write("option status_file %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'status'))
957 959
958 960
@@ -971,13 +973,15 @@ class OpkgPM(OpkgDpkgPM):
971 config_file.write("src oe-%s file:%s\n" % 973 config_file.write("src oe-%s file:%s\n" %
972 (arch, pkgs_dir)) 974 (arch, pkgs_dir))
973 975
974 if self.opkg_dir != '/var/lib/opkg': 976 if self.d.getVar('OPKGLIBDIR') != '/var/lib':
975 # There is no command line option for this anymore, we need to add 977 # There is no command line option for this anymore, we need to add
976 # info_dir and status_file to config file, if OPKGLIBDIR doesn't have 978 # info_dir and status_file to config file, if OPKGLIBDIR doesn't have
977 # the default value of "/var/lib" as defined in opkg: 979 # the default value of "/var/lib" as defined in opkg:
978 # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_INFO_DIR "/var/lib/opkg/info" 980 # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_LISTS_DIR VARDIR "/lib/opkg/lists"
979 # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_STATUS_FILE "/var/lib/opkg/status" 981 # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_INFO_DIR VARDIR "/lib/opkg/info"
982 # libopkg/opkg_conf.h:#define OPKG_CONF_DEFAULT_STATUS_FILE VARDIR "/lib/opkg/status"
980 config_file.write("option info_dir %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'info')) 983 config_file.write("option info_dir %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'info'))
984 config_file.write("option lists_dir %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'lists'))
981 config_file.write("option status_file %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'status')) 985 config_file.write("option status_file %s\n" % os.path.join(self.d.getVar('OPKGLIBDIR'), 'opkg', 'status'))
982 986
983 def insert_feeds_uris(self, feed_uris, feed_base_paths, feed_archs): 987 def insert_feeds_uris(self, feed_uris, feed_base_paths, feed_archs):
@@ -1133,7 +1137,10 @@ class OpkgPM(OpkgDpkgPM):
1133 1137
1134 # Create an temp dir as opkg root for dummy installation 1138 # Create an temp dir as opkg root for dummy installation
1135 temp_rootfs = self.d.expand('${T}/opkg') 1139 temp_rootfs = self.d.expand('${T}/opkg')
1136 temp_opkg_dir = os.path.join(temp_rootfs, 'var/lib/opkg') 1140 opkg_lib_dir = self.d.getVar('OPKGLIBDIR', True)
1141 if opkg_lib_dir[0] == "/":
1142 opkg_lib_dir = opkg_lib_dir[1:]
1143 temp_opkg_dir = os.path.join(temp_rootfs, opkg_lib_dir, 'opkg')
1137 bb.utils.mkdirhier(temp_opkg_dir) 1144 bb.utils.mkdirhier(temp_opkg_dir)
1138 1145
1139 opkg_args = "-f %s -o %s " % (self.config_file, temp_rootfs) 1146 opkg_args = "-f %s -o %s " % (self.config_file, temp_rootfs)