summaryrefslogtreecommitdiffstats
path: root/meta/classes/base.bbclass
diff options
context:
space:
mode:
authorChris Larson <kergoth@openedhand.com>2006-08-21 00:50:19 +0000
committerChris Larson <kergoth@openedhand.com>2006-08-21 00:50:19 +0000
commitfe7c8c26ed4f207101bddaf7f1d03a782927da7b (patch)
tree637e5c90494541c7cad32fdcd397c59cb6b20c2e /meta/classes/base.bbclass
parent4776ce09c45661d0ac5566c07e7cd8aa1d8302ed (diff)
downloadpoky-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.bbclass91
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
338addtask fetch 338addtask fetch
339do_fetch[dirs] = "${DL_DIR}" 339do_fetch[dirs] = "${DL_DIR}"
340#do_fetch[nostamp] = "1" 340do_fetch[nostamp] = "1"
341python base_do_fetch() { 341python 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
454addtask patch after do_unpack
455do_patch[dirs] = "${WORKDIR}"
456python 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
535addhandler base_eventhandler 455addhandler base_eventhandler
536python base_eventhandler() { 456python 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() {
599addtask configure after do_unpack do_patch 518addtask configure after do_unpack do_patch
600do_configure[dirs] = "${S} ${B}" 519do_configure[dirs] = "${S} ${B}"
601do_configure[bbdepcmd] = "do_populate_staging" 520do_configure[bbdepcmd] = "do_populate_staging"
602do_configure[deptask] = "do_populate_staging"
603base_do_configure() { 521base_do_configure() {
604 : 522 :
605} 523}
@@ -761,6 +679,9 @@ python () {
761 return 679 return
762} 680}
763 681
682# Patch handling
683inherit patch
684
764EXPORT_FUNCTIONS do_clean do_mrproper do_fetch do_unpack do_configure do_compile do_install do_package do_patch do_populate_pkgs do_stage 685EXPORT_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
766MIRRORS[func] = "0" 687MIRRORS[func] = "0"
@@ -802,9 +723,7 @@ ftp://ftp.gnutls.org/pub/gnutls ftp://ftp.gnupg.org/gcrypt/gnutls/
802ftp://ftp.gnutls.org/pub/gnutls http://www.mirrors.wiretapped.net/security/network-security/gnutls/ 723ftp://ftp.gnutls.org/pub/gnutls http://www.mirrors.wiretapped.net/security/network-security/gnutls/
803ftp://ftp.gnutls.org/pub/gnutls ftp://ftp.mirrors.wiretapped.net/pub/security/network-security/gnutls/ 724ftp://ftp.gnutls.org/pub/gnutls ftp://ftp.mirrors.wiretapped.net/pub/security/network-security/gnutls/
804ftp://ftp.gnutls.org/pub/gnutls http://josefsson.org/gnutls/releases/ 725ftp://ftp.gnutls.org/pub/gnutls http://josefsson.org/gnutls/releases/
805http://www.rpsys.net/openzaurus/patches/archive http://projects.o-hand.com/sources/kernel
806 726
807ftp://.*/.*/ http://www.oesources.org/source/current/ 727ftp://.*/.*/ http://www.oesources.org/source/current/
808http://.*/.*/ http://www.oesources.org/source/current/ 728http://.*/.*/ http://www.oesources.org/source/current/
809} 729}
810