summaryrefslogtreecommitdiff
path: root/classes/base.bbclass
diff options
context:
space:
mode:
authorChris Larson <clarson@kergoth.com>2006-08-28 20:30:14 +0000
committerChris Larson <clarson@kergoth.com>2006-08-28 20:30:14 +0000
commitd3c0ca658f75bf8f2aa96c51126712eb8d45c875 (patch)
tree71f0dc44890c6004b9592936984495039d57454b /classes/base.bbclass
parent395ef28947528cc4cd955ae4480c2b6b5561c892 (diff)
Merge from poky:
Rework the way patches are handled. There are now two abstract base classes, initialized in patch.bbclass. One for patchset operations on a directory, and another for patch failure resolution. Currently includes 'patch' and 'quilt' concrete PatchSet classes, and a 'user' resolver class, which simply drops you into a shell in the source tree to fix the rejects.
Diffstat (limited to 'classes/base.bbclass')
-rw-r--r--classes/base.bbclass96
1 files changed, 11 insertions, 85 deletions
diff --git a/classes/base.bbclass b/classes/base.bbclass
index 670b97a72d..51b6d2111f 100644
--- a/classes/base.bbclass
+++ b/classes/base.bbclass
@@ -1,5 +1,4 @@
BB_DEFAULT_TASK = "build"
-PATCHES_DIR="${S}"
def base_dep_prepend(d):
import bb;
@@ -13,9 +12,11 @@ def base_dep_prepend(d):
# INHIBIT_DEFAULT_DEPS doesn't apply to the patch command. Whether or not
# we need that built is the responsibility of the patch function / class, not
# the application.
- patchdeps = bb.data.getVar("PATCH_DEPENDS", d, 1)
- if patchdeps and not patchdeps in bb.data.getVar("PROVIDES", d, 1):
- deps = patchdeps
+ patchdeps = bb.data.getVar("PATCHTOOL", d, 1)
+ if patchdeps:
+ patchdeps = "%s-native" % patchdeps
+ if not patchdeps in bb.data.getVar("PROVIDES", d, 1):
+ deps = patchdeps
if not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d):
if (bb.data.getVar('HOST_SYS', d, 1) !=
@@ -451,86 +452,6 @@ python base_do_unpack() {
raise bb.build.FuncFailed()
}
-addtask patch after do_unpack
-do_patch[dirs] = "${WORKDIR}"
-python base_do_patch() {
- import re
- import bb.fetch
-
- src_uri = (bb.data.getVar('SRC_URI', d, 1) or '').split()
- if not src_uri:
- return
-
- patchcleancmd = bb.data.getVar('PATCHCLEANCMD', d, 1)
- if patchcleancmd:
- bb.data.setVar("do_patchcleancmd", patchcleancmd, d)
- bb.data.setVarFlag("do_patchcleancmd", "func", 1, d)
- bb.build.exec_func("do_patchcleancmd", d)
-
- workdir = bb.data.getVar('WORKDIR', d, 1)
- for url in src_uri:
-
- (type, host, path, user, pswd, parm) = bb.decodeurl(url)
- if not "patch" in parm:
- continue
-
- bb.fetch.init([url],d)
- url = bb.encodeurl((type, host, path, user, pswd, []))
- local = os.path.join('/', bb.fetch.localpath(url, d))
-
- # did it need to be unpacked?
- dots = os.path.basename(local).split(".")
- if dots[-1] in ['gz', 'bz2', 'Z']:
- unpacked = os.path.join(bb.data.getVar('WORKDIR', d),'.'.join(dots[0:-1]))
- else:
- unpacked = local
- unpacked = bb.data.expand(unpacked, d)
-
- if "pnum" in parm:
- pnum = parm["pnum"]
- else:
- pnum = "1"
-
- if "pname" in parm:
- pname = parm["pname"]
- else:
- pname = os.path.basename(unpacked)
-
- if "mindate" in parm:
- mindate = parm["mindate"]
- else:
- mindate = 0
-
- if "maxdate" in parm:
- maxdate = parm["maxdate"]
- else:
- maxdate = "20711226"
-
- pn = bb.data.getVar('PN', d, 1)
- srcdate = bb.data.getVar('SRCDATE_%s' % pn, d, 1)
-
- if not srcdate:
- srcdate = bb.data.getVar('SRCDATE', d, 1)
-
- if srcdate == "now":
- srcdate = bb.data.getVar('DATE', d, 1)
-
- if (maxdate < srcdate) or (mindate > srcdate):
- if (maxdate < srcdate):
- bb.note("Patch '%s' is outdated" % pname)
-
- if (mindate > srcdate):
- bb.note("Patch '%s' is predated" % pname)
-
- continue
-
- bb.note("Applying patch '%s'" % pname)
- bb.data.setVar("do_patchcmd", bb.data.getVar("PATCHCMD", d, 1) % (pnum, pname, unpacked), d)
- bb.data.setVarFlag("do_patchcmd", "func", 1, d)
- bb.data.setVarFlag("do_patchcmd", "dirs", "${WORKDIR} ${S}", d)
- bb.build.exec_func("do_patchcmd", d)
-}
-
addhandler base_eventhandler
python base_eventhandler() {
@@ -615,6 +536,8 @@ base_do_compile() {
fi
}
+
+addtask stage after do_compile
base_do_stage () {
:
}
@@ -759,7 +682,10 @@ python () {
return
}
-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
+# Patch handling
+inherit patch
+
+EXPORT_FUNCTIONS do_clean do_mrproper do_fetch do_unpack do_configure do_compile do_install do_package do_populate_pkgs do_stage
MIRRORS[func] = "0"
MIRRORS () {