Skip to contentSkip to conversation

Modify fetchers to warn user if "param" is used

PATCH In review Andrei Gherzan 2 participants 10 messages Jul 10, 2012

lore
Share & tools
lore
#0 lore raw

cover Modify fetchers to warn user if "param" is used

Andrei Gherzan (5):
fetch2/bzr.py: Use "protocol" parameter and warn user if recipe is
using "proto"
fetch2/git.py: Use "protocol" parameter and warn user if recipe is
using "proto"
fetch2/hg.py: Use "protocol" parameter and warn user if recipe is
using "proto"
fetch2/osc.py: Use "protocol" parameter and warn user if recipe is
using "proto"
fetch2/svn.py: Use "protocol" parameter and warn user if recipe is
using "proto"

 bitbake/lib/bb/fetch2/bzr.py |    7 ++++++-
 bitbake/lib/bb/fetch2/git.py |    4 ++++
 bitbake/lib/bb/fetch2/hg.py  |    7 ++++++-
 bitbake/lib/bb/fetch2/osc.py |    7 ++++++-
 bitbake/lib/bb/fetch2/svn.py |    7 ++++++-
 5 files changed, 28 insertions(+), 4 deletions(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/5 fetch2/bzr.py: Use "protocol" parameter and warn user if recipe is using "proto"

If SRC_URI uses the parameter "proto" while specifying the protocol, use this value but warn the user about this problem.

---
 bitbake/lib/bb/fetch2/bzr.py |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
bitbake/lib/bb/fetch2/bzr.py +6 -1
index 0d10eb4..e27c70e 100644
@@ -60,7 +60,12 @@ class Bzr(FetchMethod):
 
         basecmd = data.expand('${FETCHCMD_bzr}', d)
 
-        proto =  ud.parm.get('proto', 'http')
+        proto =  ud.parm.get('protocol', 'http')
+
+        if ud.parm.get('proto') is not None:
+            logger.warn('Update %s recipe to use "protocol" not "proto".', d.getVar('PN', True))
+            # Use proto value for now
+            proto =  ud.parm.get('proto')
 
         bzrroot = ud.host + ud.path
 
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/5 fetch2/git.py: Use "protocol" parameter and warn user if recipe is using "proto"

If SRC_URI uses the parameter "proto" while specifying the protocol, use this value but warn the user about this problem.

---
 bitbake/lib/bb/fetch2/git.py |    4 ++++
 1 file changed, 4 insertions(+)
bitbake/lib/bb/fetch2/git.py +4 -0
index 384007c..354f3b1 100644
@@ -92,6 +92,10 @@ class Git(FetchMethod):
         """
         if 'protocol' in ud.parm:
             ud.proto = ud.parm['protocol']
+        elif 'proto' in ud.parm:
+            logger.warn('Update %s recipe to use "protocol" not "proto".', d.getVar('PN', True))
+            # Use proto value for now
+            ud.proto = ud.parm['proto']
         elif not ud.host:
             ud.proto = 'file'
         else:
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH 3/5 fetch2/hg.py: Use "protocol" parameter and warn user if recipe is using "proto"

In reply to Andrei Gherzan

If SRC_URI uses the parameter "proto" while specifying the protocol, use this value but warn the user about this problem.

---
 bitbake/lib/bb/fetch2/hg.py |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
bitbake/lib/bb/fetch2/hg.py +6 -1
index ad6e85d..31ba1cf 100644
@@ -82,7 +82,12 @@ class Hg(FetchMethod):
 
         basecmd = data.expand('${FETCHCMD_hg}', d)
 
-        proto = ud.parm.get('proto', 'http')
+        proto = ud.parm.get('protocol', 'http')
+
+        if ud.parm.get('proto') is not None:
+            logger.warn('Update %s recipe to use "protocol" not "proto".', d.getVar('PN', True))
+            # Use proto value for now
+            proto =  ud.parm.get('proto')
 
         host = ud.host
         if proto == "file":
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH 4/5 fetch2/osc.py: Use "protocol" parameter and warn user if recipe is using "proto"

In reply to Andrei Gherzan

If SRC_URI uses the parameter "proto" while specifying the protocol, use this value but warn the user about this problem.

---
 bitbake/lib/bb/fetch2/osc.py |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
bitbake/lib/bb/fetch2/osc.py +6 -1
index a16a53e..5506829 100644
@@ -57,7 +57,12 @@ class Osc(FetchMethod):
 
         basecmd = data.expand('${FETCHCMD_osc}', d)
 
-        proto = ud.parm.get('proto', 'ocs')
+        proto = ud.parm.get('protocol', 'ocs')
+
+        if ud.parm.get('proto') is not None:
+            logger.warn('Update %s recipe to use "protocol" not "proto".', d.getVar('PN', True))
+            # Use proto value for now
+            proto =  ud.parm.get('proto')
 
         options = []
 
Signature · 1 line
1.7.9.5
#5 lore raw

PATCH 5/5 fetch2/svn.py: Use "protocol" parameter and warn user if recipe is using "proto"

In reply to Andrei Gherzan

If SRC_URI uses the parameter "proto" while specifying the protocol, use this value but warn the user about this problem.

---
 bitbake/lib/bb/fetch2/svn.py |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
bitbake/lib/bb/fetch2/svn.py +6 -1
index bc5b96b..48adce8 100644
@@ -71,7 +71,12 @@ class Svn(FetchMethod):
         command is "fetch", "update", "info"
         """
 
-        proto = ud.parm.get('proto', 'svn')
+        proto = ud.parm.get('protocol', 'svn')
+
+        if ud.parm.get('proto') is not None:
+            logger.warn('Update %s recipe to use "protocol" not "proto".', d.getVar('PN', True))
+            # Use proto value for now
+            proto =  ud.parm.get('proto')
 
         svn_rsh = None
         if proto == "svn+ssh" and "rsh" in ud.parm:
Signature · 1 line
1.7.9.5
#6 lore raw
In reply to Andrei Gherzan
Quoted 12 lines · Andrei Gherzan

Andrei Gherzan (5):
fetch2/bzr.py: Use "protocol" parameter and warn user if recipe is
using "proto"
fetch2/git.py: Use "protocol" parameter and warn user if recipe is
using "proto"
fetch2/hg.py: Use "protocol" parameter and warn user if recipe is
using "proto"
fetch2/osc.py: Use "protocol" parameter and warn user if recipe is
using "proto"
fetch2/svn.py: Use "protocol" parameter and warn user if recipe is
using "proto"

Quoted 6 lines
 bitbake/lib/bb/fetch2/bzr.py |    7 ++++++-
 bitbake/lib/bb/fetch2/git.py |    4 ++++
 bitbake/lib/bb/fetch2/hg.py  |    7 ++++++-
 bitbake/lib/bb/fetch2/osc.py |    7 ++++++-
 bitbake/lib/bb/fetch2/svn.py |    7 ++++++-
 5 files changed, 28 insertions(+), 4 deletions(-)

How about putting this check into __init__.py and then just setting the protocol parameter instead if its used? We can then change the backends just to use procotol right now.

Cheers,

Richard

#7 lore raw
Quoted 20 lines · Richard Purdie
Quoted 12 lines · Andrei Gherzan

Andrei Gherzan (5):
fetch2/bzr.py: Use "protocol" parameter and warn user if recipe is
using "proto"
fetch2/git.py: Use "protocol" parameter and warn user if recipe is
using "proto"
fetch2/hg.py: Use "protocol" parameter and warn user if recipe is
using "proto"
fetch2/osc.py: Use "protocol" parameter and warn user if recipe is
using "proto"
fetch2/svn.py: Use "protocol" parameter and warn user if recipe is
using "proto"

Quoted 6 lines
 bitbake/lib/bb/fetch2/bzr.py |    7 ++++++-
 bitbake/lib/bb/fetch2/git.py |    4 ++++
 bitbake/lib/bb/fetch2/hg.py  |    7 ++++++-
 bitbake/lib/bb/fetch2/osc.py |    7 ++++++-
 bitbake/lib/bb/fetch2/svn.py |    7 ++++++-
 5 files changed, 28 insertions(+), 4 deletions(-)
Quoted 5 lines

How about putting this check into __init__.py and then just setting the protocol parameter instead if its used? We can then change the backends just to use procotol right now.

I can add the warning in init but how would i define the local proto value to the one defined with parameter "proto"?

@g

#8 lore raw
Quoted 34 lines · Andrei Gherzan

On Tue, Jul 10, 2012 at 4:33 PM, Richard Purdie <[email protected]> wrote:
On Tue, 2012-07-10 at 14:15 +0300, Andrei Gherzan wrote:
> Andrei Gherzan (5):
> fetch2/bzr.py: Use "protocol" parameter and warn user if
recipe is
> using "proto"
> fetch2/git.py: Use "protocol" parameter and warn user if
recipe is
> using "proto"
> fetch2/hg.py: Use "protocol" parameter and warn user if
recipe is
> using "proto"
> fetch2/osc.py: Use "protocol" parameter and warn user if
recipe is
> using "proto"
> fetch2/svn.py: Use "protocol" parameter and warn user if
recipe is
> using "proto"
>
> bitbake/lib/bb/fetch2/bzr.py | 7 ++++++-
> bitbake/lib/bb/fetch2/git.py | 4 ++++
> bitbake/lib/bb/fetch2/hg.py | 7 ++++++-
> bitbake/lib/bb/fetch2/osc.py | 7 ++++++-
> bitbake/lib/bb/fetch2/svn.py | 7 ++++++-
> 5 files changed, 28 insertions(+), 4 deletions(-)

How about putting this check into __init__.py and then just setting the
protocol parameter instead if its used? We can then change the backends
just to use procotol right now.

Quoted 2 lines

I can add the warning in init but how would i define the local proto value to the one defined with parameter "proto"?

In FetchData::__init__(), add

proto = self.parm.get("proto", None) if proto and "protocol" not in self.param:
self.parm["protocol"] = proto

before urldata_init?

Cheers,

Richard

#9 lore raw
Quoted 40 lines · Richard Purdie
Quoted 34 lines · Andrei Gherzan

On Tue, Jul 10, 2012 at 4:33 PM, Richard Purdie <[email protected]> wrote:
On Tue, 2012-07-10 at 14:15 +0300, Andrei Gherzan wrote:
> Andrei Gherzan (5):
> fetch2/bzr.py: Use "protocol" parameter and warn user if
recipe is
> using "proto"
> fetch2/git.py: Use "protocol" parameter and warn user if
recipe is
> using "proto"
> fetch2/hg.py: Use "protocol" parameter and warn user if
recipe is
> using "proto"
> fetch2/osc.py: Use "protocol" parameter and warn user if
recipe is
> using "proto"
> fetch2/svn.py: Use "protocol" parameter and warn user if
recipe is
> using "proto"
>
> bitbake/lib/bb/fetch2/bzr.py | 7 ++++++-
> bitbake/lib/bb/fetch2/git.py | 4 ++++
> bitbake/lib/bb/fetch2/hg.py | 7 ++++++-
> bitbake/lib/bb/fetch2/osc.py | 7 ++++++-
> bitbake/lib/bb/fetch2/svn.py | 7 ++++++-
> 5 files changed, 28 insertions(+), 4 deletions(-)

How about putting this check into __init__.py and then just setting the
protocol parameter instead if its used? We can then change the backends
just to use procotol right now.

Quoted 2 lines

I can add the warning in init but how would i define the local proto value to the one defined with parameter "proto"?

In FetchData::__init__(), add

Quoted 7 lines

proto = self.parm.get("proto", None) if proto and "protocol" not in self.param:
self.parm["protocol"] = proto

before urldata_init?

Yes. It makes sense this way. V2 is on it's way.

@g