diff options
author | Paul Barker <paul@paulbarker.me.uk> | 2014-05-28 15:19:50 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-07-23 22:06:10 +0100 |
commit | 1306f263ed7b3de4e85c6dc8b377e5c05afd6bf0 (patch) | |
tree | 19315f74074adbd2660f622bbd38ce118b5b74cf | |
parent | 1529ef0504542145f2b81b2dba4bcc81d5dac96e (diff) | |
download | ast2050-yocto-poky-1306f263ed7b3de4e85c6dc8b377e5c05afd6bf0.zip ast2050-yocto-poky-1306f263ed7b3de4e85c6dc8b377e5c05afd6bf0.tar.gz |
package_ipk.bbclass: Support hierarchical feed
This patch allows for an optional new layout for ipk feed directories which I've
called a 'hierarchical feed' and is based on how Debian pools package files. It
is disabled by default and is enabled by setting IPK_HIERARCHICAL_FEED to "1".
In the traditional feed layout, package files are placed in <outdir>/<arch>/.
This can lead to several thousand files existing in a single directory which is
often a problem if developers want to upload a package feed to a shared web
hosting provider. For example, in my case, listing files via FTP only shows the
first 2000 files, breaking my scripts which attempt to upload only new and
changed files via FTP.
In the hierarchical feed, package files are written to
<outdir>/<arch>/<pkg_prefix>/<pkg_subdir>, where pkg_prefix is the first letter
of the package file name for non-lib packages or "lib" plus the 4th letter of
the package file name for lib packages (eg, 'l' for less, 'libc' for libc6).
pkg_subdir is the root of the package file name, discarding the version and
architecture parts and the common suffixes '-dbg', '-dev', '-doc', '-staticdev',
'-locale' and '-locale-*' which are listed in meta/conf/bitbake.conf.
This change relies on recent patches to opkg-utils which support hierarchical
package feeds.
Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/package_ipk.bbclass | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass index 2949d1d..9586e06 100644 --- a/meta/classes/package_ipk.bbclass +++ b/meta/classes/package_ipk.bbclass @@ -63,7 +63,32 @@ python do_package_ipk () { bb.data.update_data(localdata) basedir = os.path.join(os.path.dirname(root)) arch = localdata.getVar('PACKAGE_ARCH', True) - pkgoutdir = "%s/%s" % (outdir, arch) + + if localdata.getVar('IPK_HIERARCHICAL_FEED') == "1": + # Spread packages across subdirectories so each isn't too crowded + if pkgname.startswith('lib'): + pkg_prefix = 'lib' + pkgname[3] + else: + pkg_prefix = pkgname[0] + + # Keep -dbg, -dev, -doc, -staticdev, -locale and -locale-* packages + # together. These package suffixes are taken from the definitions of + # PACKAGES and PACKAGES_DYNAMIC in meta/conf/bitbake.conf + if pkgname[-4:] in ('-dbg', '-dev', '-doc'): + pkg_subdir = pkgname[:-4] + elif pkgname.endswith('-staticdev'): + pkg_subdir = pkgname[:-10] + elif pkgname.endswith('-locale'): + pkg_subdir = pkgname[:-7] + elif '-locale-' in pkgname: + pkg_subdir = pkgname[:pkgname.find('-locale-')] + else: + pkg_subdir = pkgname + + pkgoutdir = "%s/%s/%s/%s" % (outdir, arch, pkg_prefix, pkg_subdir) + else: + pkgoutdir = "%s/%s" % (outdir, arch) + bb.utils.mkdirhier(pkgoutdir) os.chdir(root) cleanupcontrol(root) |