Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] support/download: Aternative access methods to CVS
@ 2016-01-15 12:55 Joao Mano
  2016-01-15 13:52 ` Thomas Petazzoni
  2016-01-15 20:13 ` [Buildroot] [PATCH v2] " Joao Mano
  0 siblings, 2 replies; 6+ messages in thread
From: Joao Mano @ 2016-01-15 12:55 UTC (permalink / raw)
  To: buildroot

Allows to user specify other access methods than
:pserver:anonymous@ on CVS repositories.

This shall be specifically defined along MODULE_SITE string.

Signed-off-by: Joao Mano <joao@datacom.ind.br>
---
 docs/manual/adding-packages-generic.txt | 3 ++-
 support/download/cvs                    | 8 +++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/docs/manual/adding-packages-generic.txt b/docs/manual/adding-packages-generic.txt
index 1c25c4e..a5726d8 100644
--- a/docs/manual/adding-packages-generic.txt
+++ b/docs/manual/adding-packages-generic.txt
@@ -279,7 +279,8 @@ information is (assuming the package name is +libfoo+) :
   ** +cvs+ for retrieving source code from a CVS repository.
      Used by default when +LIBFOO_SITE+ begins with +cvs://+.
      The downloaded source code is cached as with the +svn+ method.
-     Only anonymous pserver mode is supported.
+     Anonymous pserver mode is assumed otherwise explicitly defined
+     on +LIBFOO_SITE+.
      +LIBFOO_SITE+ 'must' contain the source URL as well as the remote
      repository directory. The module is the package name.
      +LIBFOO_VERSION+ is 'mandatory' and 'must' be a tag, a branch, or
diff --git a/support/download/cvs b/support/download/cvs
index e1d5035..b4e947a 100755
--- a/support/download/cvs
+++ b/support/download/cvs
@@ -40,8 +40,14 @@ else
     select="-r"
 fi
 
+# The absence of an initial : on ${repo} means access method undefined
+if [[ ${repo} == [^:]* ]]; then
+   # defaults to anonymous pserver
+   repo=":pserver:anonymous@${repo}"
+fi
+
 export TZ=UTC
-_cvs ${verbose} -z3 -d"':pserver:anonymous@${repo}'" \
+_cvs ${verbose} -z3 -d"'${repo}'" \
      co -d "'${basename}'" ${select} "'${rev}'" -P "'${rawname}'"
 
 tar czf "${output}" "${basename}"
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 1/1] support/download: Aternative access methods to CVS
  2016-01-15 12:55 [Buildroot] [PATCH 1/1] support/download: Aternative access methods to CVS Joao Mano
@ 2016-01-15 13:52 ` Thomas Petazzoni
  2016-01-15 20:24   ` DATACOM - Joao
  2016-01-15 20:13 ` [Buildroot] [PATCH v2] " Joao Mano
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2016-01-15 13:52 UTC (permalink / raw)
  To: buildroot

Dear Joao Mano,

On Fri, 15 Jan 2016 10:55:10 -0200, Joao Mano wrote:

> diff --git a/docs/manual/adding-packages-generic.txt b/docs/manual/adding-packages-generic.txt
> index 1c25c4e..a5726d8 100644
> --- a/docs/manual/adding-packages-generic.txt
> +++ b/docs/manual/adding-packages-generic.txt
> @@ -279,7 +279,8 @@ information is (assuming the package name is +libfoo+) :
>    ** +cvs+ for retrieving source code from a CVS repository.
>       Used by default when +LIBFOO_SITE+ begins with +cvs://+.
>       The downloaded source code is cached as with the +svn+ method.
> -     Only anonymous pserver mode is supported.
> +     Anonymous pserver mode is assumed otherwise explicitly defined
> +     on +LIBFOO_SITE+.

I think an example would be good (for both the anonymous pserver mode,
and the other mode).

Otherwise, it looks good.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2] support/download: Aternative access methods to CVS
  2016-01-15 12:55 [Buildroot] [PATCH 1/1] support/download: Aternative access methods to CVS Joao Mano
  2016-01-15 13:52 ` Thomas Petazzoni
@ 2016-01-15 20:13 ` Joao Mano
  2016-01-19 21:40   ` Yann E. MORIN
  2016-01-20 22:26   ` Thomas Petazzoni
  1 sibling, 2 replies; 6+ messages in thread
From: Joao Mano @ 2016-01-15 20:13 UTC (permalink / raw)
  To: buildroot

Allows user to specify other access methods than
:pserver:anonymous@ on CVS repositories.

This shall be specifically defined along MODULE_SITE string.

Signed-off-by: Joao Mano <joao@datacom.ind.br>

---
Changes v1 -> v2:
 - Documentation improved with examples. (Thomas Petazzoni suggestion)

Signed-off-by: Joao Mano <joao@datacom.ind.br>
---
 docs/manual/adding-packages-generic.txt | 7 ++++++-
 support/download/cvs                    | 8 +++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/docs/manual/adding-packages-generic.txt b/docs/manual/adding-packages-generic.txt
index 1c25c4e..1f9c7bb 100644
--- a/docs/manual/adding-packages-generic.txt
+++ b/docs/manual/adding-packages-generic.txt
@@ -279,7 +279,12 @@ information is (assuming the package name is +libfoo+) :
   ** +cvs+ for retrieving source code from a CVS repository.
      Used by default when +LIBFOO_SITE+ begins with +cvs://+.
      The downloaded source code is cached as with the +svn+ method.
-     Only anonymous pserver mode is supported.
+     Anonymous pserver mode is assumed otherwise explicitly defined
+     on +LIBFOO_SITE+. Both
+     +LIBFOO_SITE=cvs://libfoo.net:/cvsroot/libfoo+ and
+     +LIBFOO_SITE=cvs://:ext:libfoo.net:/cvsroot/libfoo+
+     are accepted, on the former anonymous pserver access mode is
+     assumed.
      +LIBFOO_SITE+ 'must' contain the source URL as well as the remote
      repository directory. The module is the package name.
      +LIBFOO_VERSION+ is 'mandatory' and 'must' be a tag, a branch, or
diff --git a/support/download/cvs b/support/download/cvs
index e1d5035..b4e947a 100755
--- a/support/download/cvs
+++ b/support/download/cvs
@@ -40,8 +40,14 @@ else
     select="-r"
 fi
 
+# The absence of an initial : on ${repo} means access method undefined
+if [[ ${repo} == [^:]* ]]; then
+   # defaults to anonymous pserver
+   repo=":pserver:anonymous@${repo}"
+fi
+
 export TZ=UTC
-_cvs ${verbose} -z3 -d"':pserver:anonymous@${repo}'" \
+_cvs ${verbose} -z3 -d"'${repo}'" \
      co -d "'${basename}'" ${select} "'${rev}'" -P "'${rawname}'"
 
 tar czf "${output}" "${basename}"
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 1/1] support/download: Aternative access methods to CVS
  2016-01-15 13:52 ` Thomas Petazzoni
@ 2016-01-15 20:24   ` DATACOM - Joao
  0 siblings, 0 replies; 6+ messages in thread
From: DATACOM - Joao @ 2016-01-15 20:24 UTC (permalink / raw)
  To: buildroot

Hello Thomas.

Thanks for your analysis, already submitted a new version with better
examples.

Rgds,
Joao.


On Sex, 2016-01-15 at 14:52 +0100, Thomas Petazzoni wrote:
> Dear Joao Mano,
> 
> On Fri, 15 Jan 2016 10:55:10 -0200, Joao Mano wrote:
> 
> > diff --git a/docs/manual/adding-packages-generic.txt b/docs/manual/adding-packages-generic.txt
> > index 1c25c4e..a5726d8 100644
> > --- a/docs/manual/adding-packages-generic.txt
> > +++ b/docs/manual/adding-packages-generic.txt
> > @@ -279,7 +279,8 @@ information is (assuming the package name is +libfoo+) :
> >    ** +cvs+ for retrieving source code from a CVS repository.
> >       Used by default when +LIBFOO_SITE+ begins with +cvs://+.
> >       The downloaded source code is cached as with the +svn+ method.
> > -     Only anonymous pserver mode is supported.
> > +     Anonymous pserver mode is assumed otherwise explicitly defined
> > +     on +LIBFOO_SITE+.
> 
> I think an example would be good (for both the anonymous pserver mode,
> and the other mode).
> 
> Otherwise, it looks good.
> 
> Thomas

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2] support/download: Aternative access methods to CVS
  2016-01-15 20:13 ` [Buildroot] [PATCH v2] " Joao Mano
@ 2016-01-19 21:40   ` Yann E. MORIN
  2016-01-20 22:26   ` Thomas Petazzoni
  1 sibling, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2016-01-19 21:40 UTC (permalink / raw)
  To: buildroot

Joao, All,

On 2016-01-15 18:13 -0200, Joao Mano spake thusly:
> Allows user to specify other access methods than
> :pserver:anonymous@ on CVS repositories.
> 
> This shall be specifically defined along MODULE_SITE string.
> 
> Signed-off-by: Joao Mano <joao@datacom.ind.br>
> 
> ---
> Changes v1 -> v2:
>  - Documentation improved with examples. (Thomas Petazzoni suggestion)
> 
> Signed-off-by: Joao Mano <joao@datacom.ind.br>
> ---
>  docs/manual/adding-packages-generic.txt | 7 ++++++-
>  support/download/cvs                    | 8 +++++++-
>  2 files changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/docs/manual/adding-packages-generic.txt b/docs/manual/adding-packages-generic.txt
> index 1c25c4e..1f9c7bb 100644
> --- a/docs/manual/adding-packages-generic.txt
> +++ b/docs/manual/adding-packages-generic.txt
> @@ -279,7 +279,12 @@ information is (assuming the package name is +libfoo+) :
>    ** +cvs+ for retrieving source code from a CVS repository.
>       Used by default when +LIBFOO_SITE+ begins with +cvs://+.
>       The downloaded source code is cached as with the +svn+ method.
> -     Only anonymous pserver mode is supported.
> +     Anonymous pserver mode is assumed otherwise explicitly defined
> +     on +LIBFOO_SITE+. Both
> +     +LIBFOO_SITE=cvs://libfoo.net:/cvsroot/libfoo+ and
> +     +LIBFOO_SITE=cvs://:ext:libfoo.net:/cvsroot/libfoo+
> +     are accepted, on the former anonymous pserver access mode is
> +     assumed.
>       +LIBFOO_SITE+ 'must' contain the source URL as well as the remote
>       repository directory. The module is the package name.
>       +LIBFOO_VERSION+ is 'mandatory' and 'must' be a tag, a branch, or
> diff --git a/support/download/cvs b/support/download/cvs
> index e1d5035..b4e947a 100755
> --- a/support/download/cvs
> +++ b/support/download/cvs
> @@ -40,8 +40,14 @@ else
>      select="-r"
>  fi
>  
> +# The absence of an initial : on ${repo} means access method undefined
> +if [[ ${repo} == [^:]* ]]; then

  - quote variable expansions, to protect against empty variables.
  - I think a regexp would be better to match against

    if [[ ! "${repo}" =~ ^: ]]; then

(yes I know, the other condition is not quoting the variable. My bad, I
forgot to state so in my review of that patch, back then. Still, that's
not an exscue for not doing it properly here. Maybe you can also fix it
when you resubmit, please? ;-) )

> +   # defaults to anonymous pserver
> +   repo=":pserver:anonymous@${repo}"
> +fi
> +
>  export TZ=UTC
> -_cvs ${verbose} -z3 -d"':pserver:anonymous@${repo}'" \
> +_cvs ${verbose} -z3 -d"'${repo}'" \

Otherwise, I'm fine with it.

Regards,
Yann E. MORIN.

>       co -d "'${basename}'" ${select} "'${rev}'" -P "'${rawname}'"
>  
>  tar czf "${output}" "${basename}"
> -- 
> 1.9.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH v2] support/download: Aternative access methods to CVS
  2016-01-15 20:13 ` [Buildroot] [PATCH v2] " Joao Mano
  2016-01-19 21:40   ` Yann E. MORIN
@ 2016-01-20 22:26   ` Thomas Petazzoni
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2016-01-20 22:26 UTC (permalink / raw)
  To: buildroot

Dear Joao Mano,

On Fri, 15 Jan 2016 18:13:15 -0200, Joao Mano wrote:
> Allows user to specify other access methods than
> :pserver:anonymous@ on CVS repositories.
> 
> This shall be specifically defined along MODULE_SITE string.
> 
> Signed-off-by: Joao Mano <joao@datacom.ind.br>
> 
> ---
> Changes v1 -> v2:
>  - Documentation improved with examples. (Thomas Petazzoni suggestion)

Thanks, applied after doing some changes (mainly suggested by Yann) :

    [Thomas:
     - as suggested by Yann, quote the variable expansion
     - as suggested by Yann, use a regexp match
     - tweak commit log]

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-01-20 22:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-15 12:55 [Buildroot] [PATCH 1/1] support/download: Aternative access methods to CVS Joao Mano
2016-01-15 13:52 ` Thomas Petazzoni
2016-01-15 20:24   ` DATACOM - Joao
2016-01-15 20:13 ` [Buildroot] [PATCH v2] " Joao Mano
2016-01-19 21:40   ` Yann E. MORIN
2016-01-20 22:26   ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox