summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorLaurentiu Palcu <laurentiu.palcu@intel.com>2014-01-10 18:37:19 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-11 11:53:38 +0000
commit2ead36fabdfda0c472d412af0789be766b64688b (patch)
tree0540ea824a543f6eacf6484dc3ccc7d817870296 /meta/lib
parentab14336a2542579ef0170e2f7add443c33179de1 (diff)
downloadpoky-2ead36fabdfda0c472d412af0789be766b64688b.tar.gz
lib/oe/manifest.py: create global variables for package types
Manifest class clients don't really need to know how package types are encoded. (From OE-Core rev: bac2e279005b601daff4d53549612ceb76a6a857) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/manifest.py30
1 files changed, 20 insertions, 10 deletions
diff --git a/meta/lib/oe/manifest.py b/meta/lib/oe/manifest.py
index 3c5715e74a..4f61cb9d8c 100644
--- a/meta/lib/oe/manifest.py
+++ b/meta/lib/oe/manifest.py
@@ -9,6 +9,11 @@ class Manifest(object):
9 """ 9 """
10 __metaclass__ = ABCMeta 10 __metaclass__ = ABCMeta
11 11
12 PKG_TYPE_MUST_INSTALL = "mip"
13 PKG_TYPE_MULTILIB = "mlp"
14 PKG_TYPE_LANGUAGE = "lgp"
15 PKG_TYPE_ATTEMPT_ONLY = "aop"
16
12 initial_manifest_file_header = \ 17 initial_manifest_file_header = \
13 "# This file was generated automatically and contains the packages\n" \ 18 "# This file was generated automatically and contains the packages\n" \
14 "# passed on to the package manager in order to create the rootfs.\n\n" \ 19 "# passed on to the package manager in order to create the rootfs.\n\n" \
@@ -33,9 +38,9 @@ class Manifest(object):
33 self.initial_manifest = os.path.join(self.manifest_dir, "initial_manifest") 38 self.initial_manifest = os.path.join(self.manifest_dir, "initial_manifest")
34 self.final_manifest = os.path.join(self.manifest_dir, "final_manifest") 39 self.final_manifest = os.path.join(self.manifest_dir, "final_manifest")
35 40
36 self.var_map = {"PACKAGE_INSTALL": "mip", 41 self.var_map = {"PACKAGE_INSTALL": self.PKG_TYPE_MUST_INSTALL,
37 "PACKAGE_INSTALL_ATTEMPTONLY": "aop", 42 "PACKAGE_INSTALL_ATTEMPTONLY": self.PKG_TYPE_ATTEMPT_ONLY,
38 "LINGUAS_INSTALL": "lgp"} 43 "LINGUAS_INSTALL": self.PKG_TYPE_LANGUAGE}
39 44
40 """ 45 """
41 This creates a standard initial manifest for core-image-(minimal|sato|sato-sdk). 46 This creates a standard initial manifest for core-image-(minimal|sato|sato-sdk).
@@ -44,7 +49,7 @@ class Manifest(object):
44 def _create_dummy_initial(self): 49 def _create_dummy_initial(self):
45 pkg_list = dict() 50 pkg_list = dict()
46 if self.image_rootfs.find("core-image-sato-sdk") > 0: 51 if self.image_rootfs.find("core-image-sato-sdk") > 0:
47 pkg_list['mip'] = \ 52 pkg_list[self.PKG_TYPE_MUST_INSTALL] = \
48 "packagegroup-core-x11-sato-games packagegroup-base-extended " \ 53 "packagegroup-core-x11-sato-games packagegroup-base-extended " \
49 "packagegroup-core-x11-sato packagegroup-core-x11-base " \ 54 "packagegroup-core-x11-sato packagegroup-core-x11-base " \
50 "packagegroup-core-sdk packagegroup-core-tools-debug " \ 55 "packagegroup-core-sdk packagegroup-core-tools-debug " \
@@ -53,17 +58,17 @@ class Manifest(object):
53 "apt packagegroup-core-tools-profile psplash " \ 58 "apt packagegroup-core-tools-profile psplash " \
54 "packagegroup-core-standalone-sdk-target " \ 59 "packagegroup-core-standalone-sdk-target " \
55 "packagegroup-core-ssh-openssh dpkg kernel-dev" 60 "packagegroup-core-ssh-openssh dpkg kernel-dev"
56 pkg_list['lgp'] = \ 61 pkg_list[self.PKG_TYPE_LANGUAGE] = \
57 "locale-base-en-us locale-base-en-gb" 62 "locale-base-en-us locale-base-en-gb"
58 elif self.image_rootfs.find("core-image-sato") > 0: 63 elif self.image_rootfs.find("core-image-sato") > 0:
59 pkg_list['mip'] = \ 64 pkg_list[self.PKG_TYPE_MUST_INSTALL] = \
60 "packagegroup-core-ssh-dropbear packagegroup-core-x11-sato-games " \ 65 "packagegroup-core-ssh-dropbear packagegroup-core-x11-sato-games " \
61 "packagegroup-core-x11-base psplash apt dpkg packagegroup-base-extended " \ 66 "packagegroup-core-x11-base psplash apt dpkg packagegroup-base-extended " \
62 "packagegroup-core-x11-sato packagegroup-core-boot" 67 "packagegroup-core-x11-sato packagegroup-core-boot"
63 pkg_list['lgp'] = \ 68 pkg_list['lgp'] = \
64 "locale-base-en-us locale-base-en-gb" 69 "locale-base-en-us locale-base-en-gb"
65 elif self.image_rootfs.find("core-image-minimal") > 0: 70 elif self.image_rootfs.find("core-image-minimal") > 0:
66 pkg_list['mip'] = "run-postinsts packagegroup-core-boot" 71 pkg_list[self.PKG_TYPE_MUST_INSTALL] = "run-postinsts packagegroup-core-boot"
67 72
68 with open(self.initial_manifest, "w+") as manifest: 73 with open(self.initial_manifest, "w+") as manifest:
69 manifest.write(self.initial_manifest_file_header) 74 manifest.write(self.initial_manifest_file_header)
@@ -97,7 +102,12 @@ class Manifest(object):
97 with open(self.initial_manifest) as manifest: 102 with open(self.initial_manifest) as manifest:
98 for line in manifest.read().split('\n'): 103 for line in manifest.read().split('\n'):
99 comment = re.match("^#.*", line) 104 comment = re.match("^#.*", line)
100 pkg = re.match("^(mip|aop|mlp|lgp),(.*)$", line) 105 pattern = "^(%s|%s|%s|%s),(.*)$" % \
106 (self.PKG_TYPE_MUST_INSTALL,
107 self.PKG_TYPE_ATTEMPT_ONLY,
108 self.PKG_TYPE_MULTILIB,
109 self.PKG_TYPE_LANGUAGE)
110 pkg = re.match(pattern, line)
101 111
102 if comment is not None: 112 if comment is not None:
103 continue 113 continue
@@ -130,13 +140,13 @@ class OpkgManifest(Manifest):
130 pkgs = dict() 140 pkgs = dict()
131 141
132 for pkg in pkg_list.split(): 142 for pkg in pkg_list.split():
133 pkg_type = 'mip' 143 pkg_type = self.PKG_TYPE_MUST_INSTALL
134 144
135 ml_variants = self.d.getVar('MULTILIB_VARIANTS', True).split() 145 ml_variants = self.d.getVar('MULTILIB_VARIANTS', True).split()
136 146
137 for ml_variant in ml_variants: 147 for ml_variant in ml_variants:
138 if pkg.startswith(ml_variant + '-'): 148 if pkg.startswith(ml_variant + '-'):
139 pkg_type = 'mlp' 149 pkg_type = self.PKG_TYPE_MULTILIB
140 150
141 if not pkg_type in pkgs: 151 if not pkg_type in pkgs:
142 pkgs[pkg_type] = pkg 152 pkgs[pkg_type] = pkg