diff options
Diffstat (limited to 'meta/classes')
| -rw-r--r-- | meta/classes/buildhistory.bbclass | 43 |
1 files changed, 8 insertions, 35 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index ddb76e8771..f5494cd551 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass | |||
| @@ -156,7 +156,6 @@ python buildhistory_emit_pkghistory() { | |||
| 156 | rcpinfo.depends = sortlist(squashspaces(d.getVar('DEPENDS', True) or "")) | 156 | rcpinfo.depends = sortlist(squashspaces(d.getVar('DEPENDS', True) or "")) |
| 157 | rcpinfo.packages = packages | 157 | rcpinfo.packages = packages |
| 158 | write_recipehistory(rcpinfo, d) | 158 | write_recipehistory(rcpinfo, d) |
| 159 | write_latestlink(None, pe, pv, pr, d) | ||
| 160 | 159 | ||
| 161 | # Apparently the version can be different on a per-package basis (see Python) | 160 | # Apparently the version can be different on a per-package basis (see Python) |
| 162 | pkgdest = d.getVar('PKGDEST', True) | 161 | pkgdest = d.getVar('PKGDEST', True) |
| @@ -199,8 +198,6 @@ python buildhistory_emit_pkghistory() { | |||
| 199 | pkginfo.filelist = " ".join(filelist) | 198 | pkginfo.filelist = " ".join(filelist) |
| 200 | 199 | ||
| 201 | write_pkghistory(pkginfo, d) | 200 | write_pkghistory(pkginfo, d) |
| 202 | |||
| 203 | write_latestlink(pkg, pe, pv, pr, d) | ||
| 204 | } | 201 | } |
| 205 | 202 | ||
| 206 | 203 | ||
| @@ -212,8 +209,8 @@ def write_recipehistory(rcpinfo, d): | |||
| 212 | if not os.path.exists(pkghistdir): | 209 | if not os.path.exists(pkghistdir): |
| 213 | os.makedirs(pkghistdir) | 210 | os.makedirs(pkghistdir) |
| 214 | 211 | ||
| 215 | verfile = os.path.join(pkghistdir, "%s:%s-%s" % (rcpinfo.pe, rcpinfo.pv, rcpinfo.pr)) | 212 | infofile = os.path.join(pkghistdir, "latest") |
| 216 | f = open(verfile, "w") | 213 | f = open(infofile, "w") |
| 217 | try: | 214 | try: |
| 218 | if rcpinfo.pe != "0": | 215 | if rcpinfo.pe != "0": |
| 219 | f.write("PE = %s\n" % rcpinfo.pe) | 216 | f.write("PE = %s\n" % rcpinfo.pe) |
| @@ -226,16 +223,16 @@ def write_recipehistory(rcpinfo, d): | |||
| 226 | 223 | ||
| 227 | 224 | ||
| 228 | def write_pkghistory(pkginfo, d): | 225 | def write_pkghistory(pkginfo, d): |
| 229 | bb.debug(2, "Writing package history") | 226 | bb.debug(2, "Writing package history for package %s" % pkginfo.name) |
| 230 | 227 | ||
| 231 | pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE', True) | 228 | pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE', True) |
| 232 | 229 | ||
| 233 | verpath = os.path.join(pkghistdir, pkginfo.name) | 230 | pkgpath = os.path.join(pkghistdir, pkginfo.name) |
| 234 | if not os.path.exists(verpath): | 231 | if not os.path.exists(pkgpath): |
| 235 | os.makedirs(verpath) | 232 | os.makedirs(pkgpath) |
| 236 | 233 | ||
| 237 | verfile = os.path.join(verpath, "%s:%s-%s" % (pkginfo.pe, pkginfo.pv, pkginfo.pr)) | 234 | infofile = os.path.join(pkgpath, "latest") |
| 238 | f = open(verfile, "w") | 235 | f = open(infofile, "w") |
| 239 | try: | 236 | try: |
| 240 | if pkginfo.pe != "0": | 237 | if pkginfo.pe != "0": |
| 241 | f.write("PE = %s\n" % pkginfo.pe) | 238 | f.write("PE = %s\n" % pkginfo.pe) |
| @@ -250,30 +247,6 @@ def write_pkghistory(pkginfo, d): | |||
| 250 | f.close() | 247 | f.close() |
| 251 | 248 | ||
| 252 | 249 | ||
| 253 | def write_latestlink(pkg, pe, pv, pr, d): | ||
| 254 | import shutil | ||
| 255 | |||
| 256 | pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE', True) | ||
| 257 | |||
| 258 | def rm_link(path): | ||
| 259 | try: | ||
| 260 | os.unlink(path) | ||
| 261 | except OSError: | ||
| 262 | return | ||
| 263 | |||
| 264 | if pkg: | ||
| 265 | filedir = os.path.join(pkghistdir, pkg) | ||
| 266 | else: | ||
| 267 | filedir = pkghistdir | ||
| 268 | latest_file = os.path.join(filedir, "latest") | ||
| 269 | ver_file = os.path.join(filedir, "%s:%s-%s" % (pe, pv, pr)) | ||
| 270 | rm_link(latest_file) | ||
| 271 | if d.getVar('BUILDHISTORY_KEEP_VERSIONS', True) == '1': | ||
| 272 | shutil.copy(ver_file, latest_file) | ||
| 273 | else: | ||
| 274 | shutil.move(ver_file, latest_file) | ||
| 275 | |||
| 276 | |||
| 277 | buildhistory_get_image_installed() { | 250 | buildhistory_get_image_installed() { |
| 278 | # Anything requiring the use of the packaging system should be done in here | 251 | # Anything requiring the use of the packaging system should be done in here |
| 279 | # in case the packaging files are going to be removed for this image | 252 | # in case the packaging files are going to be removed for this image |
