summaryrefslogtreecommitdiffstats
path: root/meta/classes/distrodata.bbclass
diff options
context:
space:
mode:
authorIrina Patru <irina.patru@intel.com>2013-11-14 10:54:19 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-20 14:03:27 +0000
commitf2ed8fa276df54a935037633e5ed5874dd52e2ca (patch)
treea66ae054fd73e53489a01100a7a45eb0d5123148 /meta/classes/distrodata.bbclass
parent1c0c6dc9d579ca8ad6b3b443824c37cea885ea81 (diff)
downloadpoky-f2ed8fa276df54a935037633e5ed5874dd52e2ca.tar.gz
distrodata.bbclass: Add fetch2 handlers to svn case in checkpkg
The existing code in checkpkg from distrodata.bbclass had similar functionality with fetch when searching for latest package version. For packages that use svn protocol that part was rewrote in order to use fetcher API. It now calls latest_revision method from Svn class in fetch2 so that it gets latest version. [ YOCTO #1813 ] (From OE-Core rev: 2686b92bbab88cc777fdc0e4dded5aeabca7ac77) Signed-off-by: Irina Patru <irina.patru@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/distrodata.bbclass')
-rw-r--r--meta/classes/distrodata.bbclass43
1 files changed, 17 insertions, 26 deletions
diff --git a/meta/classes/distrodata.bbclass b/meta/classes/distrodata.bbclass
index 085575a041..e4810273b2 100644
--- a/meta/classes/distrodata.bbclass
+++ b/meta/classes/distrodata.bbclass
@@ -751,34 +751,25 @@ python do_checkpkg() {
751 if not tmp3: 751 if not tmp3:
752 bb.plain("#DEBUG# Package %s: current version (%s) doesn't match the usual pattern" %(pname, pversion)) 752 bb.plain("#DEBUG# Package %s: current version (%s) doesn't match the usual pattern" %(pname, pversion))
753 elif type == 'svn': 753 elif type == 'svn':
754 options = [] 754 ud = bb.fetch2.FetchData(uri, d)
755 if user:
756 options.append("--username %s" % user)
757 if pswd:
758 options.append("--password %s" % pswd)
759 svnproto = 'svn'
760 if 'proto' in parm:
761 svnproto = parm['proto']
762 if 'rev' in parm:
763 pcurver = parm['rev']
764
765 svncmd = "svn info %s %s://%s%s/%s/ 2>&1" % (" ".join(options), svnproto, host, path, parm["module"])
766 print svncmd
767 svninfo = os.popen(svncmd).read()
768 if "Can't connect to host " in svninfo or "Connection timed out" in svninfo:
769 svncmd = "svn info %s %s://%s%s/%s/ 2>&1" % (" ".join(options), "http",
770 host, path, parm["module"])
771 svninfo = os.popen(svncmd).read()
772 for line in svninfo.split("\n"):
773 if re.search("^Last Changed Rev:", line):
774 pupver = line.split(" ")[-1]
775 if pupver in pversion:
776 pstatus = "MATCH"
777 else:
778 pstatus = "UPDATE"
779 755
780 if re.match("Err", pstatus): 756 svnFetcher = bb.fetch2.svn.Svn(d)
757 svnFetcher.urldata_init(ud, d)
758 try:
759 pupver = svnFetcher.latest_revision(uri, ud, d, ud.names[0])
760 except bb.fetch2.FetchError:
761 pstatus = "ErrSvnAccess"
762
763 if pupver:
764 if pupver in pversion:
765 pstatus = "MATCH"
766 else:
767 pstatus = "UPDATE"
768 else:
781 pstatus = "ErrSvnAccess" 769 pstatus = "ErrSvnAccess"
770
771 if 'rev' in ud.parm:
772 pcurver = ud.parm['rev']
782 773
783 if pstatus != "ErrSvnAccess": 774 if pstatus != "ErrSvnAccess":
784 tag = pversion.rsplit("+svn")[0] 775 tag = pversion.rsplit("+svn")[0]