* [PATCH 1/3] distrodata.bbclass: Add fetch2 handlers to svn case in checkpkg
@ 2013-11-11 12:35 Irina Patru
2013-11-12 10:21 ` Richard Purdie
0 siblings, 1 reply; 2+ messages in thread
From: Irina Patru @ 2013-11-11 12:35 UTC (permalink / raw)
To: openembedded-core
---
meta/classes/distrodata.bbclass | 43 ++++++++++++++++-----------------------
1 file changed, 17 insertions(+), 26 deletions(-)
diff --git a/meta/classes/distrodata.bbclass b/meta/classes/distrodata.bbclass
index 085575a..e481027 100644
--- a/meta/classes/distrodata.bbclass
+++ b/meta/classes/distrodata.bbclass
@@ -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]
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/3] distrodata.bbclass: Add fetch2 handlers to svn case in checkpkg
2013-11-11 12:35 [PATCH 1/3] distrodata.bbclass: Add fetch2 handlers to svn case in checkpkg Irina Patru
@ 2013-11-12 10:21 ` Richard Purdie
0 siblings, 0 replies; 2+ messages in thread
From: Richard Purdie @ 2013-11-12 10:21 UTC (permalink / raw)
To: Irina Patru; +Cc: openembedded-core
Hi Irina,
You have a summary but this patch also needs a description of why we're
making this change and a Signed-off-by: line. The patch itself looks
good and is a nice cleanup.
Cheers,
Richard
On Mon, 2013-11-11 at 14:35 +0200, Irina Patru wrote:
> ---
> meta/classes/distrodata.bbclass | 43 ++++++++++++++++-----------------------
> 1 file changed, 17 insertions(+), 26 deletions(-)
>
> diff --git a/meta/classes/distrodata.bbclass b/meta/classes/distrodata.bbclass
> index 085575a..e481027 100644
> --- a/meta/classes/distrodata.bbclass
> +++ b/meta/classes/distrodata.bbclass
> @@ -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]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-11-12 10:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-11 12:35 [PATCH 1/3] distrodata.bbclass: Add fetch2 handlers to svn case in checkpkg Irina Patru
2013-11-12 10:21 ` Richard Purdie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox