diff options
author | Chris Larson <kergoth@openedhand.com> | 2006-08-21 00:50:19 +0000 |
---|---|---|
committer | Chris Larson <kergoth@openedhand.com> | 2006-08-21 00:50:19 +0000 |
commit | fe7c8c26ed4f207101bddaf7f1d03a782927da7b (patch) | |
tree | 637e5c90494541c7cad32fdcd397c59cb6b20c2e /meta/classes/base.bbclass | |
parent | 4776ce09c45661d0ac5566c07e7cd8aa1d8302ed (diff) | |
download | poky-fe7c8c26ed4f207101bddaf7f1d03a782927da7b.tar.gz |
Changes for ticket:8, with fixes for the bugs reported by Richard.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@622 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r-- | meta/classes/base.bbclass | 91 |
1 files changed, 5 insertions, 86 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index bb6171f19c..0fa2b8cd07 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass | |||
@@ -337,7 +337,7 @@ python base_do_mrproper() { | |||
337 | 337 | ||
338 | addtask fetch | 338 | addtask fetch |
339 | do_fetch[dirs] = "${DL_DIR}" | 339 | do_fetch[dirs] = "${DL_DIR}" |
340 | #do_fetch[nostamp] = "1" | 340 | do_fetch[nostamp] = "1" |
341 | python base_do_fetch() { | 341 | python base_do_fetch() { |
342 | import sys | 342 | import sys |
343 | 343 | ||
@@ -451,86 +451,6 @@ python base_do_unpack() { | |||
451 | raise bb.build.FuncFailed() | 451 | raise bb.build.FuncFailed() |
452 | } | 452 | } |
453 | 453 | ||
454 | addtask patch after do_unpack | ||
455 | do_patch[dirs] = "${WORKDIR}" | ||
456 | python base_do_patch() { | ||
457 | import re | ||
458 | import bb.fetch | ||
459 | |||
460 | src_uri = (bb.data.getVar('SRC_URI', d, 1) or '').split() | ||
461 | if not src_uri: | ||
462 | return | ||
463 | |||
464 | patchcleancmd = bb.data.getVar('PATCHCLEANCMD', d, 1) | ||
465 | if patchcleancmd: | ||
466 | bb.data.setVar("do_patchcleancmd", patchcleancmd, d) | ||
467 | bb.data.setVarFlag("do_patchcleancmd", "func", 1, d) | ||
468 | bb.build.exec_func("do_patchcleancmd", d) | ||
469 | |||
470 | workdir = bb.data.getVar('WORKDIR', d, 1) | ||
471 | for url in src_uri: | ||
472 | |||
473 | (type, host, path, user, pswd, parm) = bb.decodeurl(url) | ||
474 | if not "patch" in parm: | ||
475 | continue | ||
476 | |||
477 | bb.fetch.init([url],d) | ||
478 | url = bb.encodeurl((type, host, path, user, pswd, [])) | ||
479 | local = os.path.join('/', bb.fetch.localpath(url, d)) | ||
480 | |||
481 | # did it need to be unpacked? | ||
482 | dots = os.path.basename(local).split(".") | ||
483 | if dots[-1] in ['gz', 'bz2', 'Z']: | ||
484 | unpacked = os.path.join(bb.data.getVar('WORKDIR', d),'.'.join(dots[0:-1])) | ||
485 | else: | ||
486 | unpacked = local | ||
487 | unpacked = bb.data.expand(unpacked, d) | ||
488 | |||
489 | if "pnum" in parm: | ||
490 | pnum = parm["pnum"] | ||
491 | else: | ||
492 | pnum = "1" | ||
493 | |||
494 | if "pname" in parm: | ||
495 | pname = parm["pname"] | ||
496 | else: | ||
497 | pname = os.path.basename(unpacked) | ||
498 | |||
499 | if "mindate" in parm: | ||
500 | mindate = parm["mindate"] | ||
501 | else: | ||
502 | mindate = 0 | ||
503 | |||
504 | if "maxdate" in parm: | ||
505 | maxdate = parm["maxdate"] | ||
506 | else: | ||
507 | maxdate = "20711226" | ||
508 | |||
509 | pn = bb.data.getVar('PN', d, 1) | ||
510 | srcdate = bb.data.getVar('SRCDATE_%s' % pn, d, 1) | ||
511 | |||
512 | if not srcdate: | ||
513 | srcdate = bb.data.getVar('SRCDATE', d, 1) | ||
514 | |||
515 | if srcdate == "now": | ||
516 | srcdate = bb.data.getVar('DATE', d, 1) | ||
517 | |||
518 | if (maxdate < srcdate) or (mindate > srcdate): | ||
519 | if (maxdate < srcdate): | ||
520 | bb.note("Patch '%s' is outdated" % pname) | ||
521 | |||
522 | if (mindate > srcdate): | ||
523 | bb.note("Patch '%s' is predated" % pname) | ||
524 | |||
525 | continue | ||
526 | |||
527 | bb.note("Applying patch '%s'" % pname) | ||
528 | bb.data.setVar("do_patchcmd", bb.data.getVar("PATCHCMD", d, 1) % (pnum, pname, unpacked), d) | ||
529 | bb.data.setVarFlag("do_patchcmd", "func", 1, d) | ||
530 | bb.data.setVarFlag("do_patchcmd", "dirs", "${WORKDIR} ${S}", d) | ||
531 | bb.build.exec_func("do_patchcmd", d) | ||
532 | } | ||
533 | |||
534 | 454 | ||
535 | addhandler base_eventhandler | 455 | addhandler base_eventhandler |
536 | python base_eventhandler() { | 456 | python base_eventhandler() { |
@@ -557,8 +477,7 @@ python base_eventhandler() { | |||
557 | msg += messages.get(name[5:]) or name[5:] | 477 | msg += messages.get(name[5:]) or name[5:] |
558 | elif name == "UnsatisfiedDep": | 478 | elif name == "UnsatisfiedDep": |
559 | msg += "package %s: dependency %s %s" % (e.pkg, e.dep, name[:-3].lower()) | 479 | msg += "package %s: dependency %s %s" % (e.pkg, e.dep, name[:-3].lower()) |
560 | if msg: | 480 | note(msg) |
561 | note(msg) | ||
562 | 481 | ||
563 | if name.startswith("BuildStarted"): | 482 | if name.startswith("BuildStarted"): |
564 | bb.data.setVar( 'BB_VERSION', bb.__version__, e.data ) | 483 | bb.data.setVar( 'BB_VERSION', bb.__version__, e.data ) |
@@ -599,7 +518,6 @@ python base_eventhandler() { | |||
599 | addtask configure after do_unpack do_patch | 518 | addtask configure after do_unpack do_patch |
600 | do_configure[dirs] = "${S} ${B}" | 519 | do_configure[dirs] = "${S} ${B}" |
601 | do_configure[bbdepcmd] = "do_populate_staging" | 520 | do_configure[bbdepcmd] = "do_populate_staging" |
602 | do_configure[deptask] = "do_populate_staging" | ||
603 | base_do_configure() { | 521 | base_do_configure() { |
604 | : | 522 | : |
605 | } | 523 | } |
@@ -761,6 +679,9 @@ python () { | |||
761 | return | 679 | return |
762 | } | 680 | } |
763 | 681 | ||
682 | # Patch handling | ||
683 | inherit patch | ||
684 | |||
764 | EXPORT_FUNCTIONS do_clean do_mrproper do_fetch do_unpack do_configure do_compile do_install do_package do_patch do_populate_pkgs do_stage | 685 | EXPORT_FUNCTIONS do_clean do_mrproper do_fetch do_unpack do_configure do_compile do_install do_package do_patch do_populate_pkgs do_stage |
765 | 686 | ||
766 | MIRRORS[func] = "0" | 687 | MIRRORS[func] = "0" |
@@ -802,9 +723,7 @@ ftp://ftp.gnutls.org/pub/gnutls ftp://ftp.gnupg.org/gcrypt/gnutls/ | |||
802 | ftp://ftp.gnutls.org/pub/gnutls http://www.mirrors.wiretapped.net/security/network-security/gnutls/ | 723 | ftp://ftp.gnutls.org/pub/gnutls http://www.mirrors.wiretapped.net/security/network-security/gnutls/ |
803 | ftp://ftp.gnutls.org/pub/gnutls ftp://ftp.mirrors.wiretapped.net/pub/security/network-security/gnutls/ | 724 | ftp://ftp.gnutls.org/pub/gnutls ftp://ftp.mirrors.wiretapped.net/pub/security/network-security/gnutls/ |
804 | ftp://ftp.gnutls.org/pub/gnutls http://josefsson.org/gnutls/releases/ | 725 | ftp://ftp.gnutls.org/pub/gnutls http://josefsson.org/gnutls/releases/ |
805 | http://www.rpsys.net/openzaurus/patches/archive http://projects.o-hand.com/sources/kernel | ||
806 | 726 | ||
807 | ftp://.*/.*/ http://www.oesources.org/source/current/ | 727 | ftp://.*/.*/ http://www.oesources.org/source/current/ |
808 | http://.*/.*/ http://www.oesources.org/source/current/ | 728 | http://.*/.*/ http://www.oesources.org/source/current/ |
809 | } | 729 | } |
810 | |||