diff options
author | Laurentiu Palcu <laurentiu.palcu@intel.com> | 2014-01-08 10:02:28 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-02-11 11:53:38 +0000 |
commit | fdd40ce2f6a21cec009e279ec04c89b08d2da2d6 (patch) | |
tree | f5d90876d32f9777a117560975197a32a123ec72 /meta/lib/oe/manifest.py | |
parent | 7fc9bdaeed5aa3f2dd8b83a660eb97797bd2fcf4 (diff) | |
download | poky-fdd40ce2f6a21cec009e279ec04c89b08d2da2d6.tar.gz |
oe/manifest.py: Add manifest creation for opkg
In this commit:
* add ability to create initial manifest for opkg;
* make var_map available to all backends;
(From OE-Core rev: 8d14fbedcee02b723288004ae29a5c29524eec5a)
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/manifest.py')
-rw-r--r-- | meta/lib/oe/manifest.py | 51 |
1 files changed, 44 insertions, 7 deletions
diff --git a/meta/lib/oe/manifest.py b/meta/lib/oe/manifest.py index 5d01022c36..3c5715e74a 100644 --- a/meta/lib/oe/manifest.py +++ b/meta/lib/oe/manifest.py | |||
@@ -33,6 +33,10 @@ class Manifest(object): | |||
33 | self.initial_manifest = os.path.join(self.manifest_dir, "initial_manifest") | 33 | self.initial_manifest = os.path.join(self.manifest_dir, "initial_manifest") |
34 | self.final_manifest = os.path.join(self.manifest_dir, "final_manifest") | 34 | self.final_manifest = os.path.join(self.manifest_dir, "final_manifest") |
35 | 35 | ||
36 | self.var_map = {"PACKAGE_INSTALL": "mip", | ||
37 | "PACKAGE_INSTALL_ATTEMPTONLY": "aop", | ||
38 | "LINGUAS_INSTALL": "lgp"} | ||
39 | |||
36 | """ | 40 | """ |
37 | This creates a standard initial manifest for core-image-(minimal|sato|sato-sdk). | 41 | This creates a standard initial manifest for core-image-(minimal|sato|sato-sdk). |
38 | This will be used for testing until the class is implemented properly! | 42 | This will be used for testing until the class is implemented properly! |
@@ -119,8 +123,45 @@ class RpmManifest(Manifest): | |||
119 | 123 | ||
120 | 124 | ||
121 | class OpkgManifest(Manifest): | 125 | class OpkgManifest(Manifest): |
126 | """ | ||
127 | Returns a dictionary object with mip and mlp packages. | ||
128 | """ | ||
129 | def _split_multilib(self, pkg_list): | ||
130 | pkgs = dict() | ||
131 | |||
132 | for pkg in pkg_list.split(): | ||
133 | pkg_type = 'mip' | ||
134 | |||
135 | ml_variants = self.d.getVar('MULTILIB_VARIANTS', True).split() | ||
136 | |||
137 | for ml_variant in ml_variants: | ||
138 | if pkg.startswith(ml_variant + '-'): | ||
139 | pkg_type = 'mlp' | ||
140 | |||
141 | if not pkg_type in pkgs: | ||
142 | pkgs[pkg_type] = pkg | ||
143 | else: | ||
144 | pkgs[pkg_type] += " " + pkg | ||
145 | |||
146 | return pkgs | ||
147 | |||
122 | def create_initial(self): | 148 | def create_initial(self): |
123 | self._create_dummy_initial() | 149 | pkgs = dict() |
150 | |||
151 | with open(self.initial_manifest, "w+") as manifest: | ||
152 | manifest.write(self.initial_manifest_file_header) | ||
153 | |||
154 | for var in self.var_map: | ||
155 | if var == "PACKAGE_INSTALL": | ||
156 | split_pkgs = self._split_multilib(self.d.getVar(var, True)) | ||
157 | if split_pkgs is not None: | ||
158 | pkgs = dict(pkgs.items() + split_pkgs.items()) | ||
159 | else: | ||
160 | pkgs[self.var_map[var]] = self.d.getVar(var, True) | ||
161 | |||
162 | for pkg_type in pkgs: | ||
163 | for pkg in pkgs[pkg_type].split(): | ||
164 | manifest.write("%s,%s\n" % (pkg_type, pkg)) | ||
124 | 165 | ||
125 | def create_final(self): | 166 | def create_final(self): |
126 | pass | 167 | pass |
@@ -128,21 +169,17 @@ class OpkgManifest(Manifest): | |||
128 | 169 | ||
129 | class DpkgManifest(Manifest): | 170 | class DpkgManifest(Manifest): |
130 | def create_initial(self): | 171 | def create_initial(self): |
131 | var_map = {"PACKAGE_INSTALL": "mip", | ||
132 | "PACKAGE_INSTALL_ATTEMPTONLY": "aop", | ||
133 | "LINGUAS_INSTALL": "lgp"} | ||
134 | |||
135 | with open(self.initial_manifest, "w+") as manifest: | 172 | with open(self.initial_manifest, "w+") as manifest: |
136 | manifest.write(self.initial_manifest_file_header) | 173 | manifest.write(self.initial_manifest_file_header) |
137 | 174 | ||
138 | for var in var_map: | 175 | for var in self.var_map: |
139 | pkg_list = self.d.getVar(var, True) | 176 | pkg_list = self.d.getVar(var, True) |
140 | 177 | ||
141 | if pkg_list is None: | 178 | if pkg_list is None: |
142 | continue | 179 | continue |
143 | 180 | ||
144 | for pkg in pkg_list.split(): | 181 | for pkg in pkg_list.split(): |
145 | manifest.write("%s,%s\n" % (var_map[var], pkg)) | 182 | manifest.write("%s,%s\n" % (self.var_map[var], pkg)) |
146 | 183 | ||
147 | def create_final(self): | 184 | def create_final(self): |
148 | pass | 185 | pass |