* [PATCH] lib/oe/package_manager: Include PACKAGE_FEED_PREFIX instead of hardcode paths
@ 2015-08-11 21:09 leonardo.sandoval.gonzalez
2015-09-02 19:31 ` Leonardo Sandoval
0 siblings, 1 reply; 2+ messages in thread
From: leonardo.sandoval.gonzalez @ 2015-08-11 21:09 UTC (permalink / raw)
To: openembedded-core; +Cc: paul.eggleton
From: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
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]
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
---
meta/lib/oe/package_manager.py | 28 +++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 55b8ab0..7a85816 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -488,6 +488,7 @@ class PackageManager(object):
self.deploy_dir = None
self.deploy_lock = None
self.feed_uris = self.d.getVar('PACKAGE_FEED_URIS', True) or ""
+ self.feed_prefix = self.d.getVar('PACKAGE_FEED_PREFIX', True) or ""
"""
Update the package manager package database.
@@ -662,11 +663,14 @@ class RpmPM(PackageManager):
channel_priority = 10 + 5 * len(self.feed_uris.split()) * len(arch_list)
for uri in self.feed_uris.split():
+ full_uri = uri
+ if self.feed_prefix:
+ full_uri = os.path.join(uri, self.feed_prefix)
for arch in arch_list:
bb.note('Note: adding Smart channel url%d%s (%s)' %
(uri_iterator, arch, channel_priority))
- self._invoke_smart('channel --add url%d-%s type=rpm-md baseurl=%s/rpm/%s -y'
- % (uri_iterator, arch, uri, arch))
+ self._invoke_smart('channel --add url%d-%s type=rpm-md baseurl=%s/%s -y'
+ % (uri_iterator, arch, full_uri, arch))
self._invoke_smart('channel --set url%d-%s priority=%d' %
(uri_iterator, arch, channel_priority))
channel_priority -= 5
@@ -1343,17 +1347,20 @@ class OpkgPM(PackageManager):
with open(rootfs_config, "w+") as config_file:
uri_iterator = 0
for uri in self.feed_uris.split():
- config_file.write("src/gz url-%d %s/ipk\n" %
- (uri_iterator, uri))
+ full_uri = uri
+ if self.feed_prefix:
+ full_uri = os.path.join(uri, self.feed_prefix)
+ config_file.write("src/gz url-%d %s\n" %
+ (uri_iterator, full_uri))
for arch in self.pkg_archs.split():
if not os.path.exists(os.path.join(self.deploy_dir, arch)):
continue
bb.note('Note: adding opkg channel url-%s-%d (%s)' %
- (arch, uri_iterator, uri))
+ (arch, uri_iterator, full_uri))
- config_file.write("src/gz uri-%s-%d %s/ipk/%s\n" %
- (arch, uri_iterator, uri, arch))
+ config_file.write("src/gz uri-%s-%d %s/%s\n" %
+ (arch, uri_iterator, full_uri, arch))
uri_iterator += 1
def update(self):
@@ -1706,10 +1713,13 @@ class DpkgPM(PackageManager):
with open(sources_conf, "w+") as sources_file:
for uri in self.feed_uris.split():
+ full_uri = uri
+ if self.feed_prefix:
+ full_uri = os.path.join(uri, self.feed_prefix)
for arch in arch_list:
bb.note('Note: adding dpkg channel at (%s)' % uri)
- sources_file.write("deb %s/deb/%s ./\n" %
- (uri, arch))
+ sources_file.write("deb %s/%s ./\n" %
+ (full_uri, arch))
def _create_configs(self, archs, base_archs):
base_archs = re.sub("_", "-", base_archs)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] lib/oe/package_manager: Include PACKAGE_FEED_PREFIX instead of hardcode paths
2015-08-11 21:09 [PATCH] lib/oe/package_manager: Include PACKAGE_FEED_PREFIX instead of hardcode paths leonardo.sandoval.gonzalez
@ 2015-09-02 19:31 ` Leonardo Sandoval
0 siblings, 0 replies; 2+ messages in thread
From: Leonardo Sandoval @ 2015-09-02 19:31 UTC (permalink / raw)
To: openembedded-core; +Cc: paul.eggleton
ping..
Sent sometime ago, without any comments yet.
On 08/11/2015 04:09 PM, leonardo.sandoval.gonzalez@linux.intel.com wrote:
> From: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
>
> 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]
>
> Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
> ---
> meta/lib/oe/package_manager.py | 28 +++++++++++++++++++---------
> 1 file changed, 19 insertions(+), 9 deletions(-)
>
> diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
> index 55b8ab0..7a85816 100644
> --- a/meta/lib/oe/package_manager.py
> +++ b/meta/lib/oe/package_manager.py
> @@ -488,6 +488,7 @@ class PackageManager(object):
> self.deploy_dir = None
> self.deploy_lock = None
> self.feed_uris = self.d.getVar('PACKAGE_FEED_URIS', True) or ""
> + self.feed_prefix = self.d.getVar('PACKAGE_FEED_PREFIX', True) or ""
>
> """
> Update the package manager package database.
> @@ -662,11 +663,14 @@ class RpmPM(PackageManager):
> channel_priority = 10 + 5 * len(self.feed_uris.split()) * len(arch_list)
>
> for uri in self.feed_uris.split():
> + full_uri = uri
> + if self.feed_prefix:
> + full_uri = os.path.join(uri, self.feed_prefix)
> for arch in arch_list:
> bb.note('Note: adding Smart channel url%d%s (%s)' %
> (uri_iterator, arch, channel_priority))
> - self._invoke_smart('channel --add url%d-%s type=rpm-md baseurl=%s/rpm/%s -y'
> - % (uri_iterator, arch, uri, arch))
> + self._invoke_smart('channel --add url%d-%s type=rpm-md baseurl=%s/%s -y'
> + % (uri_iterator, arch, full_uri, arch))
> self._invoke_smart('channel --set url%d-%s priority=%d' %
> (uri_iterator, arch, channel_priority))
> channel_priority -= 5
> @@ -1343,17 +1347,20 @@ class OpkgPM(PackageManager):
> with open(rootfs_config, "w+") as config_file:
> uri_iterator = 0
> for uri in self.feed_uris.split():
> - config_file.write("src/gz url-%d %s/ipk\n" %
> - (uri_iterator, uri))
> + full_uri = uri
> + if self.feed_prefix:
> + full_uri = os.path.join(uri, self.feed_prefix)
> + config_file.write("src/gz url-%d %s\n" %
> + (uri_iterator, full_uri))
>
> for arch in self.pkg_archs.split():
> if not os.path.exists(os.path.join(self.deploy_dir, arch)):
> continue
> bb.note('Note: adding opkg channel url-%s-%d (%s)' %
> - (arch, uri_iterator, uri))
> + (arch, uri_iterator, full_uri))
>
> - config_file.write("src/gz uri-%s-%d %s/ipk/%s\n" %
> - (arch, uri_iterator, uri, arch))
> + config_file.write("src/gz uri-%s-%d %s/%s\n" %
> + (arch, uri_iterator, full_uri, arch))
> uri_iterator += 1
>
> def update(self):
> @@ -1706,10 +1713,13 @@ class DpkgPM(PackageManager):
>
> with open(sources_conf, "w+") as sources_file:
> for uri in self.feed_uris.split():
> + full_uri = uri
> + if self.feed_prefix:
> + full_uri = os.path.join(uri, self.feed_prefix)
> for arch in arch_list:
> bb.note('Note: adding dpkg channel at (%s)' % uri)
> - sources_file.write("deb %s/deb/%s ./\n" %
> - (uri, arch))
> + sources_file.write("deb %s/%s ./\n" %
> + (full_uri, arch))
>
> def _create_configs(self, archs, base_archs):
> base_archs = re.sub("_", "-", base_archs)
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-09-02 19:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-11 21:09 [PATCH] lib/oe/package_manager: Include PACKAGE_FEED_PREFIX instead of hardcode paths leonardo.sandoval.gonzalez
2015-09-02 19:31 ` Leonardo Sandoval
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.