summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
diff options
context:
space:
mode:
authorJoshua Lock <joshua.g.lock@intel.com>2016-03-11 14:07:31 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-20 22:57:58 +0000
commit7db6f0a402948ce489bafadf2e389802f764f122 (patch)
treefc580f88a6dcaf6578b1650ad25ebea93d8698af /meta/lib/oe
parente1108fa41742e726aa578d0298fa6397b2663ff3 (diff)
downloadopenembedded-core-7db6f0a402948ce489bafadf2e389802f764f122.tar.gz
openembedded-core-7db6f0a402948ce489bafadf2e389802f764f122.tar.bz2
openembedded-core-7db6f0a402948ce489bafadf2e389802f764f122.zip
lib/package_manager: remove RPM4 support code
Simplify the RPM code by removing support for RPM 4 now that we've dropped the RPM 4 recipe. Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/package_manager.py94
1 files changed, 38 insertions, 56 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 919104f107..0d23d8bc89 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -361,7 +361,6 @@ class RpmPkgsList(PkgsList):
except subprocess.CalledProcessError as e:
bb.fatal("Getting rpm version failed. Command '%s' "
"returned %d:\n%s" % (cmd, e.returncode, e.output))
- self.rpm_version = int(output.split()[-1].split('.')[0])
'''
Translate the RPM/Smart format names to the OE multilib format names
@@ -412,10 +411,7 @@ class RpmPkgsList(PkgsList):
def list_pkgs(self):
cmd = self.rpm_cmd + ' --root ' + self.rootfs_dir
cmd += ' -D "_dbpath /var/lib/rpm" -qa'
- if self.rpm_version == 4:
- cmd += " --qf '[%{NAME} %{ARCH} %{VERSION}\n]'"
- else:
- cmd += " --qf '[%{NAME} %{ARCH} %{VERSION} %{PACKAGEORIGIN}\n]'"
+ cmd += " --qf '[%{NAME} %{ARCH} %{VERSION} %{PACKAGEORIGIN}\n]'"
try:
# bb.note(cmd)
@@ -426,11 +422,7 @@ class RpmPkgsList(PkgsList):
output = dict()
deps = dict()
- if self.rpm_version == 4:
- bb.warn("Dependency listings are not supported with rpm 4 since rpmresolve does not work")
- dependencies = ""
- else:
- dependencies = self._list_pkg_deps()
+ dependencies = self._list_pkg_deps()
# Populate deps dictionary for better manipulation
for line in dependencies.splitlines():
@@ -455,10 +447,8 @@ class RpmPkgsList(PkgsList):
# Skip GPG keys
if pkg == 'gpg-pubkey':
continue
- if self.rpm_version == 4:
- pkgorigin = "unknown"
- else:
- pkgorigin = line.split()[3]
+
+ pkgorigin = line.split()[3]
new_pkg, new_arch = self._pkg_translate_smart_to_oe(pkg, arch)
output[new_pkg] = {"arch":new_arch, "ver":ver,
@@ -691,7 +681,6 @@ class RpmPM(PackageManager):
self.indexer = RpmIndexer(self.d, self.deploy_dir)
self.pkgs_list = RpmPkgsList(self.d, self.target_rootfs, arch_var, os_var)
- self.rpm_version = self.pkgs_list.rpm_version
self.ml_prefix_list, self.ml_os_list = self.indexer.get_ml_prefix_and_os_list(arch_var, os_var)
@@ -913,44 +902,41 @@ class RpmPM(PackageManager):
# After change the __db.* cache size, log file will not be
# generated automatically, that will raise some warnings,
# so touch a bare log for rpm write into it.
- if self.rpm_version == 5:
- rpmlib_log = os.path.join(self.image_rpmlib, 'log', 'log.0000000001')
- if not os.path.exists(rpmlib_log):
- bb.utils.mkdirhier(os.path.join(self.image_rpmlib, 'log'))
- open(rpmlib_log, 'w+').close()
-
- DB_CONFIG_CONTENT = "# ================ Environment\n" \
- "set_data_dir .\n" \
- "set_create_dir .\n" \
- "set_lg_dir ./log\n" \
- "set_tmp_dir ./tmp\n" \
- "set_flags db_log_autoremove on\n" \
- "\n" \
- "# -- thread_count must be >= 8\n" \
- "set_thread_count 64\n" \
- "\n" \
- "# ================ Logging\n" \
- "\n" \
- "# ================ Memory Pool\n" \
- "set_cachesize 0 1048576 0\n" \
- "set_mp_mmapsize 268435456\n" \
- "\n" \
- "# ================ Locking\n" \
- "set_lk_max_locks 16384\n" \
- "set_lk_max_lockers 16384\n" \
- "set_lk_max_objects 16384\n" \
- "mutex_set_max 163840\n" \
- "\n" \
- "# ================ Replication\n"
-
- db_config_dir = os.path.join(self.image_rpmlib, 'DB_CONFIG')
- if not os.path.exists(db_config_dir):
- open(db_config_dir, 'w+').write(DB_CONFIG_CONTENT)
+ rpmlib_log = os.path.join(self.image_rpmlib, 'log', 'log.0000000001')
+ if not os.path.exists(rpmlib_log):
+ bb.utils.mkdirhier(os.path.join(self.image_rpmlib, 'log'))
+ open(rpmlib_log, 'w+').close()
+
+ DB_CONFIG_CONTENT = "# ================ Environment\n" \
+ "set_data_dir .\n" \
+ "set_create_dir .\n" \
+ "set_lg_dir ./log\n" \
+ "set_tmp_dir ./tmp\n" \
+ "set_flags db_log_autoremove on\n" \
+ "\n" \
+ "# -- thread_count must be >= 8\n" \
+ "set_thread_count 64\n" \
+ "\n" \
+ "# ================ Logging\n" \
+ "\n" \
+ "# ================ Memory Pool\n" \
+ "set_cachesize 0 1048576 0\n" \
+ "set_mp_mmapsize 268435456\n" \
+ "\n" \
+ "# ================ Locking\n" \
+ "set_lk_max_locks 16384\n" \
+ "set_lk_max_lockers 16384\n" \
+ "set_lk_max_objects 16384\n" \
+ "mutex_set_max 163840\n" \
+ "\n" \
+ "# ================ Replication\n"
+
+ db_config_dir = os.path.join(self.image_rpmlib, 'DB_CONFIG')
+ if not os.path.exists(db_config_dir):
+ open(db_config_dir, 'w+').write(DB_CONFIG_CONTENT)
# Create database so that smart doesn't complain (lazy init)
opt = "-qa"
- if self.rpm_version == 4:
- opt = "--initdb"
cmd = "%s --root %s --dbpath /var/lib/rpm %s > /dev/null" % (
self.rpm_cmd, self.target_rootfs, opt)
try:
@@ -1037,12 +1023,8 @@ class RpmPM(PackageManager):
# If we ever run into needing more the 899 scripts, we'll have to.
# change num to start with 1000.
#
- if self.rpm_version == 4:
- scriptletcmd = "$2 $3 $4\n"
- scriptpath = "$3"
- else:
- scriptletcmd = "$2 $1/$3 $4\n"
- scriptpath = "$1/$3"
+ scriptletcmd = "$2 $1/$3 $4\n"
+ scriptpath = "$1/$3"
# When self.debug_level >= 3, also dump the content of the
# executed scriptlets and how they get invoked. We have to