distrodata.bbclass: Add fetch2 handlers to svn case in checkpkg
A message that is not in the archive (sent off-list or not yet received): 0001-distrodata.bbclass-Add-fetch2-handlers-to-svn-case-i.patch
PATCH v2 1/1 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 Git class in fetch2 so that it gets latest version.
[ YOCTO #1813 ]
--- meta/classes/distrodata.bbclass | 43 ++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 26 deletions(-)
meta/classes/distrodata.bbclass +17 -26
@@ -751,34 +751,25 @@ python do_checkpkg() { if not tmp3: bb.plain("#DEBUG# Package %s: current version (%s) doesn't match the usual pattern" %(pname, pversion)) elif type == 'svn': - 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() - if "Can't connect to host " in svninfo or "Connection timed out" in svninfo: - svncmd = "svn info %s %s://%s%s/%s/ 2>&1" % (" ".join(options), "http", - host, path, parm["module"]) - svninfo = os.popen(svncmd).read() - for line in svninfo.split("\n"): - if re.search("^Last Changed Rev:", line): - pupver = line.split(" ")[-1] - if pupver in pversion: - pstatus = "MATCH" - else: - pstatus = "UPDATE" + ud = bb.fetch2.FetchData(uri, d) - if re.match("Err", pstatus): + svnFetcher = bb.fetch2.svn.Svn(d) + svnFetcher.urldata_init(ud, d) + try: + pupver = svnFetcher.latest_revision(uri, ud, d, ud.names[0]) + except bb.fetch2.FetchError: + pstatus = "ErrSvnAccess" + + if pupver: + if pupver in pversion: + pstatus = "MATCH" + else: + pstatus = "UPDATE" + else: pstatus = "ErrSvnAccess" + + if 'rev' in ud.parm: + pcurver = ud.parm['rev'] if pstatus != "ErrSvnAccess": tag = pversion.rsplit("+svn")[0]
Signature · 1 line
1.7.9.5
Quoted 8 lines · Irina Patru
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 callslatest_revisionmethod from Git class in fetch2 so that it gets latest version.
Do you mean SVN class here not Git, correct?
Sau!
Quoted 64 lines
[ YOCTO #1813 ]
Signed-off-by Irina Patru <[email protected]>--- meta/classes/distrodata.bbclass | 43 ++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 26 deletions(-)meta/classes/distrodata.bbclass +17
-26@@ -751,34 +751,25 @@ python do_checkpkg() { if not tmp3: bb.plain("#DEBUG# Package %s: current version (%s) doesn't match the usual pattern" %(pname, pversion)) elif type == 'svn': - 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() - if "Can't connect to host " in svninfo or "Connection timed out" in svninfo: - svncmd = "svn info %s %s://%s%s/%s/ 2>&1" % (" ".join(options), "http", - host, path, parm["module"]) - svninfo = os.popen(svncmd).read() - for line in svninfo.split("\n"): - if re.search("^Last Changed Rev:", line): - pupver = line.split(" ")[-1] - if pupver in pversion: - pstatus = "MATCH" - else: - pstatus = "UPDATE" + ud = bb.fetch2.FetchData(uri, d) - if re.match("Err", pstatus): + svnFetcher = bb.fetch2.svn.Svn(d) + svnFetcher.urldata_init(ud, d) + try: + pupver = svnFetcher.latest_revision(uri, ud, d, ud.names[0]) + except bb.fetch2.FetchError: + pstatus = "ErrSvnAccess" + + if pupver: + if pupver in pversion: + pstatus = "MATCH" + else: + pstatus = "UPDATE" + else: pstatus = "ErrSvnAccess" + + if 'rev' in ud.parm: + pcurver = ud.parm['rev'] if pstatus != "ErrSvnAccess": tag = pversion.rsplit("+svn")[0]
PATCH v3 1/1 distrodata.bbclass: Add fetch2 handlers to svn case in checkpkg
In reply to Irina PatruThe 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 ]
--- meta/classes/distrodata.bbclass | 43 ++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 26 deletions(-)
meta/classes/distrodata.bbclass +17 -26
@@ -751,34 +751,25 @@ python do_checkpkg() { if not tmp3: bb.plain("#DEBUG# Package %s: current version (%s) doesn't match the usual pattern" %(pname, pversion)) elif type == 'svn': - 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() - if "Can't connect to host " in svninfo or "Connection timed out" in svninfo: - svncmd = "svn info %s %s://%s%s/%s/ 2>&1" % (" ".join(options), "http", - host, path, parm["module"]) - svninfo = os.popen(svncmd).read() - for line in svninfo.split("\n"): - if re.search("^Last Changed Rev:", line): - pupver = line.split(" ")[-1] - if pupver in pversion: - pstatus = "MATCH" - else: - pstatus = "UPDATE" + ud = bb.fetch2.FetchData(uri, d) - if re.match("Err", pstatus): + svnFetcher = bb.fetch2.svn.Svn(d) + svnFetcher.urldata_init(ud, d) + try: + pupver = svnFetcher.latest_revision(uri, ud, d, ud.names[0]) + except bb.fetch2.FetchError: + pstatus = "ErrSvnAccess" + + if pupver: + if pupver in pversion: + pstatus = "MATCH" + else: + pstatus = "UPDATE" + else: pstatus = "ErrSvnAccess" + + if 'rev' in ud.parm: + pcurver = ud.parm['rev'] if pstatus != "ErrSvnAccess": tag = pversion.rsplit("+svn")[0]
Signature · 1 line
1.7.9.5