summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorKevin Tian <kevin.tian@intel.com>2010-07-08 15:42:42 +0800
committerSaul Wold <Saul.Wold@intel.com>2010-07-08 21:08:19 -0700
commit90ceeff2587c932f9d998ccf05f01c01300f3268 (patch)
treea037b855ab3db993d356bb5ed265af065a174ebe /meta
parent43bd7936793701839df4dd4e49ef91985ee11e06 (diff)
downloadopenembedded-core-90ceeff2587c932f9d998ccf05f01c01300f3268.tar.gz
openembedded-core-90ceeff2587c932f9d998ccf05f01c01300f3268.tar.bz2
openembedded-core-90ceeff2587c932f9d998ccf05f01c01300f3268.zip
utility-tasks.bbclass: add automatic version check for GIT/SVN proto
both git/svn supports remote information query: 'git ls-remote', and 'svn info'. With them, now upstream version will be automatically checked for git/svn packages. In the meantime, manual latest version tagged in distro tracking fields are also compared as one alternative if upstream check fails. Also such check is one indicator whether tracking field is missing. Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/utility-tasks.bbclass72
-rw-r--r--meta/conf/distro/include/private/distro_base_utils_1.inc8
-rw-r--r--meta/conf/distro/include/private/distro_x11_libs.inc2
-rw-r--r--meta/conf/distro/poky.conf2
4 files changed, 70 insertions, 14 deletions
diff --git a/meta/classes/utility-tasks.bbclass b/meta/classes/utility-tasks.bbclass
index c3001ecfc8..a4db4f8beb 100644
--- a/meta/classes/utility-tasks.bbclass
+++ b/meta/classes/utility-tasks.bbclass
@@ -276,7 +276,6 @@ python do_checkpkg() {
"""generate package information from .bb file"""
pname = bb.data.getVar('PN', d, 1)
- pcurver = bb.data.getVar('PV', d, 1)
pdesc = bb.data.getVar('DESCRIPTION', d, 1)
pgrp = bb.data.getVar('SECTION', d, 1)
@@ -296,6 +295,11 @@ python do_checkpkg() {
(type, host, path, user, pswd, parm) = bb.decodeurl(uri)
if type in ['http', 'https', 'ftp']:
+ pcurver = bb.data.getVar('PV', d, 1)
+ else:
+ pcurver = bb.data.getVar("SRCREV", d, 1)
+
+ if type in ['http', 'https', 'ftp']:
newver = pcurver
altpath = path
dirver = "-"
@@ -342,12 +346,52 @@ python do_checkpkg() {
if re.match("Err", newver):
pstatus = newver + ":" + altpath + ":" + dirver + ":" + curname
elif type == 'git':
- """N.B. Now hardcode UPDATE for git/svn/cvs."""
- pupver = "master"
- pstatus = "UPDATE"
+ if user:
+ gituser = user + '@'
+ else:
+ gituser = ""
+
+ if 'protocol' in parm:
+ gitproto = parm['protocol']
+ else:
+ gitproto = "rsync"
+
+ gitcmd = "git ls-remote %s://%s%s%s HEAD 2>&1" % (gitproto, gituser, host, path)
+ print gitcmd
+ ver = os.popen(gitcmd).read()
+ if ver and re.search("HEAD", ver):
+ pupver = ver.split("\t")[0]
+ if pcurver == pupver:
+ pstatus = "MATCH"
+ else:
+ pstatus = "UPDATE"
+ else:
+ pstatus = "ErrGitAccess"
elif type == 'svn':
- pupver = "HEAD"
- pstatus = "UPDATE"
+ options = []
+ if user:
+ options.append("--username %s" % user)
+ if pswd:
+ options.append("--password %s" % pswd)
+ svnproto = 'svn'
+ if 'proto' in parm:
+ svnproto = parm['proto']
+ if 'rev' in parm:
+ pcurver = parm['rev']
+
+ svncmd = "svn info %s %s://%s%s/%s/ 2>&1" % (" ".join(options), svnproto, host, path, parm["module"])
+ print svncmd
+ svninfo = os.popen(svncmd).read()
+ for line in svninfo.split("\n"):
+ if re.search("^Last Changed Rev:", line):
+ pupver = line.split(" ")[-1]
+ if pcurver == pupver:
+ pstatus = "MATCH"
+ else:
+ pstatus = "UPDATE"
+
+ if re.match("Err", pstatus):
+ pstatus = "ErrSvnAccess"
elif type == 'cvs':
pupver = "HEAD"
pstatus = "UPDATE"
@@ -360,10 +404,22 @@ python do_checkpkg() {
if re.match("Err", pstatus):
pstatus += ":%s%s" % (host, path)
+
+ """Read from manual distro tracking fields as alternative"""
+ pmver = bb.data.getVar("RECIPE_LATEST_VERSION", d, 1)
+ if not pmver:
+ pmver = "N/A"
+ pmstatus = "ErrNoRecipeData"
+ else:
+ if pmver == pcurver:
+ pmstatus = "MATCH"
+ else:
+ pmstatus = "UPDATE"
+
lf = bb.utils.lockfile(logfile + ".lock")
f = open(logfile, "a")
- f.write("\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % \
- (pname, pgrp, pproto, pcurver, pupver, pstatus, pdesc))
+ f.write("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % \
+ (pname, pgrp, pproto, pcurver, pmver, pupver, pmstatus, pstatus, pdesc))
f.close()
bb.utils.unlockfile(lf)
}
diff --git a/meta/conf/distro/include/private/distro_base_utils_1.inc b/meta/conf/distro/include/private/distro_base_utils_1.inc
index b36eec7e40..8f7559ac83 100644
--- a/meta/conf/distro/include/private/distro_base_utils_1.inc
+++ b/meta/conf/distro/include/private/distro_base_utils_1.inc
@@ -47,7 +47,7 @@ RECIPE_COMMENTS_pn-initramfs-live-install = "local scripts follow Poky's MIT lic
RECIPE_STATUS_pn-initscripts = "green"
DEPENDENCY_CHECK_pn-initscripts = "not done"
RECIPE_LATEST_VERSION_pn-initscripts = "1.0"
-RECIPE_PATCH_pn-initscripts+* = "many local scripts"
+RECIPE_PATCH_pn-initscripts = "many local scripts"
RECIPE_INTEL_SECTION_pn-initscripts = "base utils"
RECIPE_TIME_BETWEEN_LAST_TWO_RELEASES_pn-initscripts = "n/a"
RECIPE_LATEST_RELEASE_DATE_pn-initscripts = "n/a"
@@ -56,7 +56,7 @@ RECIPE_COMMENTS_pn-initscripts = "local scripts follow Poky's MIT license"
RECIPE_STATUS_pn-keymaps = "yellow" # LICENSE
DEPENDENCY_CHECK_pn-keymaps = "not done"
RECIPE_LATEST_VERSION_pn-keymaps = "1.0"
-RECIPE_PATCH_pn-keymaps+* = "many local keymap files"
+RECIPE_PATCH_pn-keymaps = "many local keymap files"
RECIPE_INTEL_SECTION_pn-keymaps = "base utils"
RECIPE_TIME_BETWEEN_LAST_TWO_RELEASES_pn-keymaps = "n/a"
RECIPE_LATEST_RELEASE_DATE_pn-keymaps = "n/a"
@@ -74,7 +74,7 @@ RECIPE_COMMENTS_pn-modutils-initscripts = "local scripts follow Poky's MIT licen
RECIPE_STATUS_pn-network-suspend-scripts = "yellow" # no PV
DEPENDENCY_CHECK_pn-network-suspend-scripts = "not done"
RECIPE_LATEST_VERSION_pn-network-suspend-scripts = "1.0"
-RECIPE_PATCH_pn-network-suspend-scripts+* = "local scripts"
+RECIPE_PATCH_pn-network-suspend-scripts = "local scripts"
RECIPE_INTEL_SECTION_pn-network-suspend-scripts = "base utils"
RECIPE_TIME_BETWEEN_LAST_TWO_RELEASES_pn-network-suspend-scripts = "n/a"
RECIPE_LATEST_RELEASE_DATE_pn-network-suspend-scripts = "n/a"
@@ -83,7 +83,7 @@ RECIPE_COMMENTS_pn-network-suspend-scripts = "local scripts follow Poky's MIT li
RECIPE_STATUS_pn-opkg-collateral = "yellow" # license
DEPENDENCY_CHECK_pn-opkg-collateral = "not done"
RECIPE_LATEST_VERSION_pn-opkg-collateral = "1.0"
-RECIPE_PATCH_pn-opkg-collateral+* = "local"
+RECIPE_PATCH_pn-opkg-collateral = "local"
RECIPE_INTEL_SECTION_pn-opkg-collateral = "base utils"
RECIPE_TIME_BETWEEN_LAST_TWO_RELEASES_pn-opkg-collateral = "n/a"
RECIPE_LATEST_RELEASE_DATE_pn-opkg-collateral = "n/a"
diff --git a/meta/conf/distro/include/private/distro_x11_libs.inc b/meta/conf/distro/include/private/distro_x11_libs.inc
index 3fbc582f61..73e89be099 100644
--- a/meta/conf/distro/include/private/distro_x11_libs.inc
+++ b/meta/conf/distro/include/private/distro_x11_libs.inc
@@ -426,7 +426,7 @@ RECIPE_COMMENTS_pn-libxau = ""
RECIPE_STATUS_pn-libxcalibrate = "yellow"
DEPENDENCY_CHECK_pn-libxcalibrate = "not done"
-RECIPE_LATEST_VERSION_pn-libxcalibrate = "0.0+git0+209d83af61ed38a002c8096377deac292b3e396c"
+RECIPE_LATEST_VERSION_pn-libxcalibrate = "209d83af61ed38a002c8096377deac292b3e396c"
RECIPE_NO_OF_PATCHES_pn-libxcalibrate = "1"
RECIPE_PATCH_pn-libxcalibrate+fix-xcb = "There is no extra reply data and if we say not to disgard it, xcb throws fatal asserts. RP - 26/11/09"
RECIPE_INTEL_SECTION_pn-libxcalibrate = "x11/libs"
diff --git a/meta/conf/distro/poky.conf b/meta/conf/distro/poky.conf
index 951e156c25..a99aba7966 100644
--- a/meta/conf/distro/poky.conf
+++ b/meta/conf/distro/poky.conf
@@ -116,4 +116,4 @@ IMAGE_FEATURES ?= ""
EXTRAOPKGCONFIG = "poky-feed-config-opkg"
require conf/distro/include/world-broken.inc
-
+require conf/distro/include/distro_tracking_fields.inc