summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/package_manager.py
diff options
context:
space:
mode:
authorLeonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>2015-08-11 16:09:28 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-04 16:23:49 +0100
commit338c3257f60e99c1fd101d5010daea4099eb1d0e (patch)
tree0302af8c3bbd8af96672aa41e6cfabfbada8715c /meta/lib/oe/package_manager.py
parent7f93052dc5cefe7ecc8c1288e3bc77e3c5b400d6 (diff)
downloadpoky-338c3257f60e99c1fd101d5010daea4099eb1d0e.tar.gz
lib/oe/package_manager: Include PACKAGE_FEED_PREFIX instead of hardcode paths
Instead of hardcode paths (/rpm/, /ipk/, /deb/), use a user-defined prefix when creating the URI feeds. URIs now will have the following syntax: PACKAGE_FEED_URIS_1/PACKAGE_FEED_PREFIX PACKAGE_FEED_URIS_2/PACKAGE_FEED_PREFIX . where PACKAGE_FEED_URIS = "PACKAGE_FEED_URIS_1 PACKAGE_FEED_URIS_2 ...." [YOCTO #5407] (From OE-Core rev: 467b823b163653a6fa8d46734174004abdb48cf9) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/package_manager.py')
-rw-r--r--meta/lib/oe/package_manager.py25
1 files changed, 18 insertions, 7 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 622669af6a..810b728870 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -522,6 +522,7 @@ class PackageManager(object):
522 self.deploy_dir = None 522 self.deploy_dir = None
523 self.deploy_lock = None 523 self.deploy_lock = None
524 self.feed_uris = self.d.getVar('PACKAGE_FEED_URIS', True) or "" 524 self.feed_uris = self.d.getVar('PACKAGE_FEED_URIS', True) or ""
525 self.feed_prefix = self.d.getVar('PACKAGE_FEED_PREFIX', True) or ""
525 526
526 """ 527 """
527 Update the package manager package database. 528 Update the package manager package database.
@@ -696,11 +697,14 @@ class RpmPM(PackageManager):
696 channel_priority = 10 + 5 * len(self.feed_uris.split()) * len(arch_list) 697 channel_priority = 10 + 5 * len(self.feed_uris.split()) * len(arch_list)
697 698
698 for uri in self.feed_uris.split(): 699 for uri in self.feed_uris.split():
700 full_uri = uri
701 if self.feed_prefix:
702 full_uri = os.path.join(uri, self.feed_prefix)
699 for arch in arch_list: 703 for arch in arch_list:
700 bb.note('Note: adding Smart channel url%d%s (%s)' % 704 bb.note('Note: adding Smart channel url%d%s (%s)' %
701 (uri_iterator, arch, channel_priority)) 705 (uri_iterator, arch, channel_priority))
702 self._invoke_smart('channel --add url%d-%s type=rpm-md baseurl=%s/rpm/%s -y' 706 self._invoke_smart('channel --add url%d-%s type=rpm-md baseurl=%s/%s -y'
703 % (uri_iterator, arch, uri, arch)) 707 % (uri_iterator, arch, full_uri, arch))
704 self._invoke_smart('channel --set url%d-%s priority=%d' % 708 self._invoke_smart('channel --set url%d-%s priority=%d' %
705 (uri_iterator, arch, channel_priority)) 709 (uri_iterator, arch, channel_priority))
706 channel_priority -= 5 710 channel_priority -= 5
@@ -1384,14 +1388,18 @@ class OpkgPM(PackageManager):
1384 with open(rootfs_config, "w+") as config_file: 1388 with open(rootfs_config, "w+") as config_file:
1385 uri_iterator = 0 1389 uri_iterator = 0
1386 for uri in self.feed_uris.split(): 1390 for uri in self.feed_uris.split():
1391 full_uri = uri
1392 if self.feed_prefix:
1393 full_uri = os.path.join(uri, self.feed_prefix)
1394
1387 for arch in self.pkg_archs.split(): 1395 for arch in self.pkg_archs.split():
1388 if not os.path.exists(os.path.join(self.deploy_dir, arch)): 1396 if not os.path.exists(os.path.join(self.deploy_dir, arch)):
1389 continue 1397 continue
1390 bb.note('Note: adding opkg feed url-%s-%d (%s)' % 1398 bb.note('Note: adding opkg feed url-%s-%d (%s)' %
1391 (arch, uri_iterator, uri)) 1399 (arch, uri_iterator, full_uri))
1392 1400
1393 config_file.write("src/gz uri-%s-%d %s/ipk/%s\n" % 1401 config_file.write("src/gz uri-%s-%d %s/%s\n" %
1394 (arch, uri_iterator, uri, arch)) 1402 (arch, uri_iterator, full_uri, arch))
1395 uri_iterator += 1 1403 uri_iterator += 1
1396 1404
1397 def update(self): 1405 def update(self):
@@ -1744,10 +1752,13 @@ class DpkgPM(PackageManager):
1744 1752
1745 with open(sources_conf, "w+") as sources_file: 1753 with open(sources_conf, "w+") as sources_file:
1746 for uri in self.feed_uris.split(): 1754 for uri in self.feed_uris.split():
1755 full_uri = uri
1756 if self.feed_prefix:
1757 full_uri = os.path.join(uri, self.feed_prefix)
1747 for arch in arch_list: 1758 for arch in arch_list:
1748 bb.note('Note: adding dpkg channel at (%s)' % uri) 1759 bb.note('Note: adding dpkg channel at (%s)' % uri)
1749 sources_file.write("deb %s/deb/%s ./\n" % 1760 sources_file.write("deb %s/%s ./\n" %
1750 (uri, arch)) 1761 (full_uri, arch))
1751 1762
1752 def _create_configs(self, archs, base_archs): 1763 def _create_configs(self, archs, base_archs):
1753 base_archs = re.sub("_", "-", base_archs) 1764 base_archs = re.sub("_", "-", base_archs)