Skip to contentSkip to conversation

downloads: add basic CVS support

PATCH New Gustavo Zacarias 3 participants 5 messages Sep 4, 2013 – Sep 12, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 downloads: add basic CVS support

The support is for pserver mode anonymous CVS.
source-check is based on login since many servers don't support or have ls/rls disabled.

Usage is pretty straightforward.
PKG_SITE defines the site hostname and remote directory. The module is defined by the bare package name. Version is date based.

---
 Config.in               |  4 ++++
 package/pkg-download.mk | 37 ++++++++++++++++++++++++++++---------
 package/pkg-generic.mk  |  2 ++
 3 files changed, 34 insertions(+), 9 deletions(-)
Config.in +4 -0
index cb246a4..33b3070 100644
@@ -42,6 +42,10 @@ config BR2_GIT
 	string "Git command"
 	default "git"
 
+config BR2_CVS
+	string "Cvs command"
+	default "cvs"
+
 config BR2_LOCALFILES
 	string "Local files retrieval command"
 	default "cp"
package/pkg-download.mk +28 -9
index 97c9226..07e7c54 100644
@@ -10,6 +10,7 @@
 # Download method commands
 WGET := $(call qstrip,$(BR2_WGET)) $(QUIET)
 SVN := $(call qstrip,$(BR2_SVN))
+CVS := $(call qstrip,$(BR2_CVS))
 BZR := $(call qstrip,$(BR2_BZR))
 GIT := $(call qstrip,$(BR2_GIT))
 HG := $(call qstrip,$(BR2_HG)) $(QUIET)
@@ -55,21 +56,21 @@ notdomain=$(patsubst $(call domain,$(1),$(2))$(call domainseparator,$(2))%,%,$(c
 domainseparator=$(if $(1),$(1),/)
 
 ################################################################################
-# The DOWNLOAD_{GIT,SVN,BZR,HG,LOCALFILES} helpers are in charge of getting a
-# working copy of the source repository for their corresponding SCM,
+# The DOWNLOAD_{GIT,SVN,BZR,HG,CVS,LOCALFILES} helpers are in charge of getting
+# a working copy of the source repository for their corresponding SCM,
 # checking out the requested version / commit / tag, and create an
 # archive out of it. DOWNLOAD_SCP uses scp to obtain a remote file with
 # ssh authentication. DOWNLOAD_WGET is the normal wget-based download
 # mechanism.
 #
-# The SOURCE_CHECK_{GIT,SVN,BZR,HG,WGET,LOCALFILES,SCP} helpers are in charge of
-# simply checking that the source is available for download. This can be used
-# to make sure one will be able to get all the sources needed for
-# one's build configuration.
+# The SOURCE_CHECK_{GIT,SVN,BZR,HG,WGET,CVS,LOCALFILES,SCP} helpers are
+# in charge of simply checking that the source is available for download.
+# This can be used to make sure one will be able to get all the sources needed
+# for one's build configuration.
 #
-# The SHOW_EXTERNAL_DEPS_{GIT,SVN,BZR,HG,WGET,LOCALFILES,SCP} helpers simply
-# output to the console the names of the files that will be downloaded, or path
-# and revision of the source repositories, producing a list of all the
+# The SHOW_EXTERNAL_DEPS_{GIT,SVN,BZR,HG,WGET,CVS,LOCALFILES,SCP} helpers
+# simply output to the console the names of the files that will be downloaded,
+# or path and revision of the source repositories, producing a list of all the
 # "external dependencies" of a given build configuration.
 ################################################################################
 
@@ -119,6 +120,23 @@ define SHOW_EXTERNAL_DEPS_BZR
 	echo $($(PKG)_SOURCE)
 endef
 
+define DOWNLOAD_CVS
+	test -e $(DL_DIR)/$($(PKG)_SOURCE) || \
+	(pushd $(DL_DIR) > /dev/null && \
+	$(CVS) -z3 -d:pserver:anonymous@$(call stripurischeme,$(call qstrip,$($(PKG)_SITE))) co -d $($(PKG)_BASE_NAME) -r :$($(PKG)_DL_VERSION) -P $($(PKG)_RAWNAME) && \
+	$(TAR) czf $($(PKG)_SOURCE) $($(PKG)_BASE_NAME)/ && \
+	rm -rf $($(PKG)_DL_DIR) && \
+	popd > /dev/null)
+endef
+
+# Not all CVS servers support ls/rls, use login to see if we can connect
+define SOURCE_CHECK_CVS
+	$(CVS) -d:pserver:anonymous:@$(call stripurischeme,$(call qstrip,$($(PKG)_SITE))) login
+endef
+
+define SHOW_EXTERNAL_DEPS_CVS
+	echo $($(PKG)_SOURCE)
+endef
 
 define DOWNLOAD_SVN
 	test -e $(DL_DIR)/$($(PKG)_SOURCE) || \
@@ -244,6 +262,7 @@ define DOWNLOAD_INNER
 		case "$$scheme" in \
 			git) $($(DL_MODE)_GIT) && exit ;; \
 			svn) $($(DL_MODE)_SVN) && exit ;; \
+			cvs) $($(DL_MODE)_CVS) && exit ;; \
 			bzr) $($(DL_MODE)_BZR) && exit ;; \
 			file) $($(DL_MODE)_LOCALFILES) && exit ;; \
 			scp) $($(DL_MODE)_SCP) && exit ;; \
package/pkg-generic.mk +2 -0
index 2e2e66f..7ae166f 100644
@@ -537,6 +537,8 @@ else ifeq ($$($(2)_SITE_METHOD),scp)
 DL_TOOLS_DEPENDENCIES += scp ssh
 else ifeq ($$($(2)_SITE_METHOD),hg)
 DL_TOOLS_DEPENDENCIES += hg
+else ifeq ($$($(2)_SITE_METHOD),cvs)
+DL_TOOLS_DEPENDENCIES += cvs
 endif # SITE_METHOD
 
 DL_TOOLS_DEPENDENCIES += $(firstword $(INFLATE$(suffix $($(2)_SOURCE))))
Signature · 1 line
1.8.1.5
#1 lore raw

PATCH 2/2 elf2flt: upgrade to latest version

Upgrade to the latest uclinux CVS snapshot, gives us blackfin support.

---
 package/elf2flt/Config.in.host     |    2 +-
 package/elf2flt/elf2flt.mk         |   10 +-
 package/elf2flt/src/LICENSE.TXT    |  340 ---
 package/elf2flt/src/Makefile.in    |   81 -
 package/elf2flt/src/README         |   62 -
 package/elf2flt/src/config.guess   | 1418 -----------
 package/elf2flt/src/config.sub     | 1577 ------------
 package/elf2flt/src/configure      | 4719 ------------------------------------
 package/elf2flt/src/configure.in   |  134 -
 package/elf2flt/src/cygwin-elf.h   | 2171 -----------------
 package/elf2flt/src/e1-elf2flt.ld  |  161 --
 package/elf2flt/src/elf2flt.c      | 2152 ----------------
 package/elf2flt/src/elf2flt.ld     |  179 --
 package/elf2flt/src/flat.h         |  111 -
 package/elf2flt/src/flthdr.c       |  382 ---
 package/elf2flt/src/install-sh     |  251 --
 package/elf2flt/src/ld-elf2flt.in  |  219 --
 package/elf2flt/src/maketarball.sh |   12 -
 package/elf2flt/src/stubs.c        |    6 -
 19 files changed, 4 insertions(+), 13983 deletions(-)
 delete mode 100644 package/elf2flt/src/LICENSE.TXT
 delete mode 100644 package/elf2flt/src/Makefile.in
 delete mode 100644 package/elf2flt/src/README
 delete mode 100755 package/elf2flt/src/config.guess
 delete mode 100755 package/elf2flt/src/config.sub
 delete mode 100755 package/elf2flt/src/configure
 delete mode 100644 package/elf2flt/src/configure.in
 delete mode 100644 package/elf2flt/src/cygwin-elf.h
 delete mode 100644 package/elf2flt/src/e1-elf2flt.ld
 delete mode 100644 package/elf2flt/src/elf2flt.c
 delete mode 100644 package/elf2flt/src/elf2flt.ld
 delete mode 100644 package/elf2flt/src/flat.h
 delete mode 100644 package/elf2flt/src/flthdr.c
 delete mode 100755 package/elf2flt/src/install-sh
 delete mode 100644 package/elf2flt/src/ld-elf2flt.in
 delete mode 100755 package/elf2flt/src/maketarball.sh
 delete mode 100644 package/elf2flt/src/stubs.c
package/elf2flt/Config.in.host +1 -1
index 31a6c7f..dad48d8 100644
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_HOST_ELF2FLT
 	bool "Enable elf2flt support?"
-	depends on BR2_arm || BR2_sh || BR2_sparc
+	depends on BR2_arm || BR2_bfin || BR2_sh || BR2_sparc
 	help
 	  uCLinux uses a Binary Flat format commonly known as BFLT. It
 	  is a relatively simple and lightweight executable format
package/elf2flt/elf2flt.mk +3 -7
index 27dd807..ce40f8d 100644
@@ -4,9 +4,9 @@
 #
 ################################################################################
 
-ELF2FLT_SOURCE =
-HOST_ELF2FLT_SOURCE =
-ELF2FLT_VERSION = cvs
+ELF2FLT_VERSION = 20130904
+ELF2FLT_SITE = cvs://cvs.uclinux.org:/var/cvs
+ELF2FLT_SITE_METHOD = cvs
 ELF2FLT_LICENSE = GPLv2+
 ELF2FLT_LICENSE_FILES = LICENSE.TXT
 
@@ -23,8 +23,4 @@ HOST_ELF2FLT_CONF_OPT = \
 
 HOST_ELF2FLT_CONF_ENV = LIBS=-lz
 
-define HOST_ELF2FLT_EXTRACT_CMDS
-	cp -r package/elf2flt/src/* $(@D)
-endef
-
 $(eval $(host-autotools-package))
package/elf2flt/src/LICENSE.TXT deleted +0 -340

340 lines not on this page · raw message

package/elf2flt/src/Makefile.in deleted +0 -81

81 lines not on this page · raw message

package/elf2flt/src/README deleted +0 -62

62 lines not on this page · raw message

package/elf2flt/src/config.guess deleted +0 -1418

1,418 lines not on this page · raw message

package/elf2flt/src/config.sub deleted +0 -1577

1,072 lines not on this page · raw message

package/elf2flt/src/configure deleted +0 -4719

4,719 lines not on this page · raw message

package/elf2flt/src/configure.in deleted +0 -134

134 lines not on this page · raw message

package/elf2flt/src/cygwin-elf.h deleted +0 -2171

2,171 lines not on this page · raw message

package/elf2flt/src/e1-elf2flt.ld deleted +0 -161

161 lines not on this page · raw message

package/elf2flt/src/elf2flt.c deleted +0 -2152

2,152 lines not on this page · raw message

package/elf2flt/src/elf2flt.ld deleted +0 -179

179 lines not on this page · raw message

package/elf2flt/src/flat.h deleted +0 -111

111 lines not on this page · raw message

package/elf2flt/src/flthdr.c deleted +0 -382

382 lines not on this page · raw message

package/elf2flt/src/install-sh deleted +0 -251

251 lines not on this page · raw message

package/elf2flt/src/ld-elf2flt.in deleted +0 -219

219 lines not on this page · raw message

package/elf2flt/src/maketarball.sh deleted +0 -12
deleted file mode 100755
index 1014860..0000000

Lines of this file are not shown. View the raw message.

package/elf2flt/src/stubs.c deleted +0 -6
deleted file mode 100644
index fb14d63..0000000

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.8.1.5

Part of the diff is not shown here. View the raw message.

#2 lore raw

PATCH 2/2 elf2flt: upgrade to latest version

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Gustavo" == Gustavo Zacarias <[email protected]> writes:

Gustavo> Upgrade to the latest uclinux CVS snapshot, gives us blackfin support. Gustavo> Signed-off-by: Gustavo Zacarias <[email protected]>

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 1/2 downloads: add basic CVS support

In reply to Gustavo Zacarias

Dear Gustavo Zacarias,

Great!

Quoted 8 lines · Gustavo Zacarias

The support is for pserver mode anonymous CVS.
source-check is based on login since many servers don't support or have ls/rls disabled.

Usage is pretty straightforward.
PKG_SITE defines the site hostname and remote directory. The module is defined by the bare package name. Version is date based.

Those details should probably go into an update of docs/manual/adding-packages-generic.txt, which documents all the source methods.

Quoted 35 lines
---
 Config.in               |  4 ++++
 package/pkg-download.mk | 37 ++++++++++++++++++++++++++++---------
 package/pkg-generic.mk  |  2 ++
 3 files changed, 34 insertions(+), 9 deletions(-)
Config.in +4 -0
index cb246a4..33b3070 100644
@@ -42,6 +42,10 @@ config BR2_GIT
 	string "Git command"
 	default "git"
 
+config BR2_CVS
+	string "Cvs command"
+	default "cvs"
+
 config BR2_LOCALFILES
 	string "Local files retrieval command"
 	default "cp"
package/pkg-download.mk +1 -0
index 97c9226..07e7c54 100644
@@ -10,6 +10,7 @@
 # Download method commands
 WGET := $(call qstrip,$(BR2_WGET)) $(QUIET)
 SVN := $(call qstrip,$(BR2_SVN))
+CVS := $(call qstrip,$(BR2_CVS))
 BZR := $(call qstrip,$(BR2_BZR))
 GIT := $(call qstrip,$(BR2_GIT))
 HG := $(call qstrip,$(BR2_HG)) $(QUIET)

package/pkg-download.mk notdomain=$(patsubst $(call domain,$(1),$(2))$(call domainseparator,$(2))%,%,$(c · line 60

Quoted 7 lines
package/pkg-download.mk +2 -2
@@ -55,21 +56,21 @@ notdomain=$(patsubst $(call domain,$(1),$(2))$(call domainseparator,$(2))%,%,$(c
 domainseparator=$(if $(1),$(1),/)
 
 ################################################################################
-# The DOWNLOAD_{GIT,SVN,BZR,HG,LOCALFILES} helpers are in charge of getting a
-# working copy of the source repository for their corresponding SCM,
+# The DOWNLOAD_{GIT,SVN,BZR,HG,CVS,LOCALFILES} helpers are in charge of getting
+# a working copy of the source repository for their corresponding SCM,

Not related to your change, but interesting to see that LOCALFILES is a SCM :)

package/pkg-download.mk notdomain=$(patsubst $(call domain,$(1),$(2))$(call domainseparator,$(2))%,%,$(c · line 66

Quoted 10 lines
package/pkg-download.mk +1 -4
 # checking out the requested version / commit / tag, and create an
 # archive out of it. DOWNLOAD_SCP uses scp to obtain a remote file with
 # ssh authentication. DOWNLOAD_WGET is the normal wget-based download
 # mechanism.
 #
-# The SOURCE_CHECK_{GIT,SVN,BZR,HG,WGET,LOCALFILES,SCP} helpers are in charge of
-# simply checking that the source is available for download. This can be used
-# to make sure one will be able to get all the sources needed for
-# one's build configuration.
+# The SOURCE_CHECK_{GIT,SVN,BZR,HG,WGET,CVS,LOCALFILES,SCP} helpers are

Maybe we could replace this with SOURCE_CHECK_*

package/pkg-download.mk notdomain=$(patsubst $(call domain,$(1),$(2))$(call domainseparator,$(2))%,%,$(c · line 71

Quoted 8 lines
package/pkg-download.mk +4 -3
+# in charge of simply checking that the source is available for download.
+# This can be used to make sure one will be able to get all the sources needed
+# for one's build configuration.
 #
-# The SHOW_EXTERNAL_DEPS_{GIT,SVN,BZR,HG,WGET,LOCALFILES,SCP} helpers simply
-# output to the console the names of the files that will be downloaded, or path
-# and revision of the source repositories, producing a list of all the
+# The SHOW_EXTERNAL_DEPS_{GIT,SVN,BZR,HG,WGET,CVS,LOCALFILES,SCP} helpers

and similar here :-)

package/pkg-download.mk define SHOW_EXTERNAL_DEPS_BZR · line 126

Quoted 13 lines
package/pkg-download.mk +6 -0
+# simply output to the console the names of the files that will be downloaded,
+# or path and revision of the source repositories, producing a list of all the
 # "external dependencies" of a given build configuration.
 ################################################################################
 
@@ -119,6 +120,23 @@ define SHOW_EXTERNAL_DEPS_BZR
 	echo $($(PKG)_SOURCE)
 endef
 
+define DOWNLOAD_CVS
+	test -e $(DL_DIR)/$($(PKG)_SOURCE) || \
+	(pushd $(DL_DIR) > /dev/null && \
+	$(CVS) -z3 -d:pserver:anonymous@$(call stripurischeme,$(call qstrip,$($(PKG)_SITE))) co -d $($(PKG)_BASE_NAME) -r :$($(PKG)_DL_VERSION) -P $($(PKG)_RAWNAME) && \

This line is quite long. Split it maybe?

Quoted 29 lines
package/pkg-download.mk +14 -0
+	$(TAR) czf $($(PKG)_SOURCE) $($(PKG)_BASE_NAME)/ && \
+	rm -rf $($(PKG)_DL_DIR) && \
+	popd > /dev/null)
+endef
+
+# Not all CVS servers support ls/rls, use login to see if we can connect
+define SOURCE_CHECK_CVS
+	$(CVS) -d:pserver:anonymous:@$(call stripurischeme,$(call qstrip,$($(PKG)_SITE))) login
+endef
+
+define SHOW_EXTERNAL_DEPS_CVS
+	echo $($(PKG)_SOURCE)
+endef
 
 define DOWNLOAD_SVN
 	test -e $(DL_DIR)/$($(PKG)_SOURCE) || \
@@ -244,6 +262,7 @@ define DOWNLOAD_INNER
 		case "$$scheme" in \
 			git) $($(DL_MODE)_GIT) && exit ;; \
 			svn) $($(DL_MODE)_SVN) && exit ;; \
+			cvs) $($(DL_MODE)_CVS) && exit ;; \
 			bzr) $($(DL_MODE)_BZR) && exit ;; \
 			file) $($(DL_MODE)_LOCALFILES) && exit ;; \
 			scp) $($(DL_MODE)_SCP) && exit ;; \
package/pkg-generic.mk +0 -0
index 2e2e66f..7ae166f 100644

package/pkg-generic.mk else ifeq ($$($(2)_SITE_METHOD),scp) · line 544

Quoted 8 lines
package/pkg-generic.mk +2 -0
@@ -537,6 +537,8 @@ else ifeq ($$($(2)_SITE_METHOD),scp)
 DL_TOOLS_DEPENDENCIES += scp ssh
 else ifeq ($$($(2)_SITE_METHOD),hg)
 DL_TOOLS_DEPENDENCIES += hg
+else ifeq ($$($(2)_SITE_METHOD),cvs)
+DL_TOOLS_DEPENDENCIES += cvs
 endif # SITE_METHOD
 
 DL_TOOLS_DEPENDENCIES += $(firstword $(INFLATE$(suffix $($(2)_SOURCE))))

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#4 lore raw

PATCH 1/2 downloads: add basic CVS support

Quoted 4 lines · Thomas Petazzoni
Quoted 4 lines

The support is for pserver mode anonymous CVS.
source-check is based on login since many servers don't support or have ls/rls disabled.

Quoted 8 lines
Quoted 4 lines

Usage is pretty straightforward.
PKG_SITE defines the site hostname and remote directory. The module is defined by the bare package name. Version is date based.

Those details should probably go into an update of docs/manual/adding-packages-generic.txt, which documents all the source methods.

Yes, that'll follow once the method is accepted as proposed, docs aren't easy to modify if there's substantial change.

Quoted 2 lines

Not related to your change, but interesting to see that LOCALFILES is a SCM :)

Well, if someone wants RCS that might be syntactically correct, not for now though ;)

Quoted 3 lines

Maybe we could replace this with SOURCE_CHECK_*

and similar here :-)

Sure, i can follow up with the docs patchset.

Quoted 1 line

This line is quite long. Split it maybe?

True, DOWNLOAD_GIT also exceeds the 80 column "standard", and so do other parts so don't blame me :)
I also do on SOURCE_CHECK_CVS but that's hardly splittable in a coherent/useful way, and cvs is very picky with parameter order to rephrase it.

Regards.