aboutsummaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorGravatar Gustavo Zacarias <gustavo@zacarias.com.ar>2013-09-11 09:12:04 -0300
committerGravatar Peter Korsgaard <jacmet@sunsite.dk>2013-09-13 00:05:43 +0200
commit15eb1fafa35cd9a9a0bbb70508699bdea1262b01 (patch)
treee601ab8f6e60039fabb651dac61cbb09931e9560 /package
parent2bf58d7633f42bd1cec79873deabbf979f1c5e8b (diff)
downloadbuildroot-15eb1fafa35cd9a9a0bbb70508699bdea1262b01.tar.gz
buildroot-15eb1fafa35cd9a9a0bbb70508699bdea1262b01.tar.bz2
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. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package')
-rw-r--r--package/pkg-download.mk39
-rw-r--r--package/pkg-generic.mk2
2 files changed, 31 insertions, 10 deletions
diff --git a/package/pkg-download.mk b/package/pkg-download.mk
index 97c9226f1f..8e4a1ec33b 100644
--- a/package/pkg-download.mk
+++ b/package/pkg-download.mk
@@ -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,22 +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_* 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_* 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
-# "external dependencies" of a given build configuration.
+# The SHOW_EXTERNAL_DEPS_* 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.
################################################################################
# Try a shallow clone - but that only works if the version is a ref (tag or
@@ -119,6 +119,24 @@ 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 ;; \
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 4dd395b6ea..bfc4dc14f3 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -542,6 +542,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
# $(firstword) is used here because the extractor can have arguments, like