diff options
author | Mei Lei <lei.mei@intel.com> | 2011-01-30 15:28:46 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-02-01 23:59:38 +0000 |
commit | ba06cc8943d021f406c3d292ce415b77319ca5c6 (patch) | |
tree | 94eb82383bf4b7cafd33ce268e8e576b9948d98f /meta | |
parent | d22b4357c981dfd7b44dcaae59d276edc0f78dce (diff) | |
download | poky-ba06cc8943d021f406c3d292ce415b77319ca5c6.tar.gz |
distrodata.bbclass: Imporve the checkpkg task more precisely and generate data for pkg-report-system
Imporve some regular expression when checking recipes' upstream version, reduce the number of invalid recipes' upstream version and imporve the precision
Generate some data for package report system.
Signed-off-by: Mei Lei<lei.mei@intel.com>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/distrodata.bbclass | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/meta/classes/distrodata.bbclass b/meta/classes/distrodata.bbclass index e5f84d0641..868f65685b 100644 --- a/meta/classes/distrodata.bbclass +++ b/meta/classes/distrodata.bbclass | |||
@@ -229,7 +229,14 @@ python checkpkg_eventhandler() { | |||
229 | f.write("Package\tOwner\tURI Type\tVersion\tTracking\tUpstream\tTMatch\tRMatch\n") | 229 | f.write("Package\tOwner\tURI Type\tVersion\tTracking\tUpstream\tTMatch\tRMatch\n") |
230 | f.close() | 230 | f.close() |
231 | bb.utils.unlockfile(lf) | 231 | bb.utils.unlockfile(lf) |
232 | 232 | """initialize log files for package report system""" | |
233 | logfile2 = os.path.join(logpath, "get_pkg_info.%s.log" % bb.data.getVar('DATETIME', e.data, 1)) | ||
234 | if not os.path.exists(logfile2): | ||
235 | slogfile2 = os.path.join(logpath, "get_pkg_info.log") | ||
236 | if os.path.exists(slogfile2): | ||
237 | os.remove(slogfile2) | ||
238 | os.system("touch %s" % logfile2) | ||
239 | os.symlink(logfile2, slogfile2) | ||
233 | return | 240 | return |
234 | } | 241 | } |
235 | 242 | ||
@@ -322,7 +329,7 @@ python do_checkpkg() { | |||
322 | which is designed for check purpose but we override check command for our own purpose | 329 | which is designed for check purpose but we override check command for our own purpose |
323 | """ | 330 | """ |
324 | ld = bb.data.createCopy(d) | 331 | ld = bb.data.createCopy(d) |
325 | bb.data.setVar('CHECKCOMMAND_wget', "/usr/bin/env wget -t 1 --passive-ftp -O %s '${URI}'" \ | 332 | bb.data.setVar('CHECKCOMMAND_wget', "/usr/bin/env wget -t 1 --passive-ftp -O %s --user-agent=\"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101027 Ubuntu/9.10 (karmic) Firefox/3.6.12\" '${URI}'" \ |
326 | % tmpf.name, d) | 333 | % tmpf.name, d) |
327 | bb.data.update_data(ld) | 334 | bb.data.update_data(ld) |
328 | 335 | ||
@@ -420,7 +427,7 @@ python do_checkpkg() { | |||
420 | """match "{PN}-5.21.1.tar.gz">{PN}-5.21.1.tar.gz """ | 427 | """match "{PN}-5.21.1.tar.gz">{PN}-5.21.1.tar.gz """ |
421 | pn1 = re.search("^%s" % prefix, curname).group() | 428 | pn1 = re.search("^%s" % prefix, curname).group() |
422 | s = "[^\"]*%s[^\d\"]*?(\d+[\.\-_])+[^\"]*" % pn1 | 429 | s = "[^\"]*%s[^\d\"]*?(\d+[\.\-_])+[^\"]*" % pn1 |
423 | searchstr = "[hH][rR][eE][fF]=\"%s\">" % s | 430 | searchstr = "[hH][rR][eE][fF]=\"%s\".*>" % s |
424 | reg = re.compile(searchstr) | 431 | reg = re.compile(searchstr) |
425 | 432 | ||
426 | valid = 0 | 433 | valid = 0 |
@@ -438,7 +445,7 @@ python do_checkpkg() { | |||
438 | status = "ErrParseDir" | 445 | status = "ErrParseDir" |
439 | else: | 446 | else: |
440 | """newver still contains a full package name string""" | 447 | """newver still contains a full package name string""" |
441 | status = re.search("(\d+[.\-_])*\d+", newver[1]).group() | 448 | status = re.search("(\d+[.\-_])*[0-9a-zA-Z]+", newver[1]).group() |
442 | elif not len(fhtml): | 449 | elif not len(fhtml): |
443 | status = "ErrHostNoDir" | 450 | status = "ErrHostNoDir" |
444 | 451 | ||
@@ -459,11 +466,23 @@ python do_checkpkg() { | |||
459 | logpath = bb.data.getVar('LOG_DIR', d, 1) | 466 | logpath = bb.data.getVar('LOG_DIR', d, 1) |
460 | bb.utils.mkdirhier(logpath) | 467 | bb.utils.mkdirhier(logpath) |
461 | logfile = os.path.join(logpath, "checkpkg.csv") | 468 | logfile = os.path.join(logpath, "checkpkg.csv") |
469 | """initialize log files for package report system""" | ||
470 | logfile2 = os.path.join(logpath, "get_pkg_info.log") | ||
462 | 471 | ||
463 | """generate package information from .bb file""" | 472 | """generate package information from .bb file""" |
464 | pname = bb.data.getVar('PN', d, 1) | 473 | pname = bb.data.getVar('PN', d, 1) |
465 | pdesc = bb.data.getVar('DESCRIPTION', d, 1) | 474 | pdesc = bb.data.getVar('DESCRIPTION', d, 1) |
466 | pgrp = bb.data.getVar('SECTION', d, 1) | 475 | pgrp = bb.data.getVar('SECTION', d, 1) |
476 | pversion = bb.data.getVar('PV', d, 1) | ||
477 | plicense = bb.data.getVar('LICENSE',d,1) | ||
478 | psection = bb.data.getVar('SECTION',d,1) | ||
479 | phome = bb.data.getVar('HOMEPAGE', d, 1) | ||
480 | prelease = bb.data.getVar('PR',d,1) | ||
481 | ppriority = bb.data.getVar('PRIORITY',d,1) | ||
482 | pdepends = bb.data.getVar('DEPENDS',d,1) | ||
483 | pbugtracker = bb.data.getVar('BUGTRACKER',d,1) | ||
484 | ppe = bb.data.getVar('PE',d,1) | ||
485 | psrcuri = bb.data.getVar('SRC_URI',d,1) | ||
467 | 486 | ||
468 | found = 0 | 487 | found = 0 |
469 | for uri in src_uri.split(): | 488 | for uri in src_uri.split(): |
@@ -609,6 +628,14 @@ python do_checkpkg() { | |||
609 | (pname, maintainer, pproto, pcurver, pmver, pupver, pmstatus, pstatus)) | 628 | (pname, maintainer, pproto, pcurver, pmver, pupver, pmstatus, pstatus)) |
610 | f.close() | 629 | f.close() |
611 | bb.utils.unlockfile(lf) | 630 | bb.utils.unlockfile(lf) |
631 | |||
632 | """write into get_pkg_info log file to supply data for package report system""" | ||
633 | lf2 = bb.utils.lockfile(logfile2 + ".lock") | ||
634 | f2 = open(logfile2, "a") | ||
635 | f2.write("%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n" % \ | ||
636 | (pname,pversion,pupver,plicense,psection, phome,prelease, ppriority,pdepends,pbugtracker,ppe,pdesc,pstatus,pmver,psrcuri)) | ||
637 | f2.close() | ||
638 | bb.utils.unlockfile(lf2) | ||
612 | } | 639 | } |
613 | 640 | ||
614 | addtask checkpkgall after do_checkpkg | 641 | addtask checkpkgall after do_checkpkg |