Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Saul Wold <sgw@linux.intel.com>
To: Irina Patru <irina.patru@intel.com>,
	 openembedded-core@lists.openembedded.org
Subject: Re: [PATCH v2] distrodata.bbclass: Add fetch2 handlers to svn case in checkpkg
Date: Wed, 13 Nov 2013 08:26:47 -0800	[thread overview]
Message-ID: <5283A847.6030600@linux.intel.com> (raw)
In-Reply-To: <1384335941-25306-1-git-send-email-irina.patru@intel.com>

On 11/13/2013 01:45 AM, Irina Patru wrote:
> 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.
>
Do you mean SVN class here not Git, correct?

Sau!

> [ YOCTO #1813 ]
>
> Signed-off-by: Irina Patru <irina.patru@intel.com>
> ---
>   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]
>


  reply	other threads:[~2013-11-13 16:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0001-distrodata.bbclass-Add-fetch2-handlers-to-svn-case-i.patch>
2013-11-13  9:45 ` [PATCH v2] distrodata.bbclass: Add fetch2 handlers to svn case in checkpkg Irina Patru
2013-11-13 16:26   ` Saul Wold [this message]
2013-11-14  8:54   ` [PATCH v3] " Irina Patru

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5283A847.6030600@linux.intel.com \
    --to=sgw@linux.intel.com \
    --cc=irina.patru@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox