From: Carsten Schlote <[email protected]>

Signed-off-by: Carsten Schlote <[email protected]>
---
 rules/pre/Rules.make         |   34 ++++++++++++++++++++++++++++++++++
 scripts/lib/ptxd_make_get.sh |    7 +++++++
 2 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/rules/pre/Rules.make b/rules/pre/Rules.make
index 51ed94e..9bfdfc4 100644
--- a/rules/pre/Rules.make
+++ b/rules/pre/Rules.make
@@ -13,6 +13,7 @@ GNU_BUILD     := $(shell $(SCRIPTSDIR)/autoconf/config.guess)
 GNU_HOST       := $(shell echo $(GNU_BUILD) | sed s/-[a-zA-Z0-9_]*-/-host-/)
 
 INSTALL                := install
+SVN            := svn
 FAKEROOT       := $(PTXDIST_SYSROOT_HOST)/bin/fakeroot -l 
$(PTXDIST_SYSROOT_HOST)/lib/libfakeroot.so
 
 CHECK_PIPE_STATUS := \
@@ -390,6 +391,39 @@ extract =                                                  
\
 
 
 #
+# getsvn
+#
+# Export a SVN repository URL into a directory from a repository.
+#
+# $1: Packet label; we export $1_SOURCE
+# $2: dir to export into; if $2 is not given we extract to $(BUILDDIR)
+# $3: version to checkout; if $3 is not given we use HEAD
+#
+getsvn =                                                       \
+       PACKET="$($(strip $(1))_URL)";                          \
+       PACKETDIR="$($(strip $(1))_DIR)";                       \
+       URL="$($(strip $(1))_URL)";                             \
+       DEST="$(strip $(2))";                                   \
+       DEST="$${DEST:-$(BUILDDIR)}";                           \
+       REV="$(strip $(3))";                                    \
+       REV="$${REV:-HEAD}";                                    \
+                                                               \
+       if [ "$$URL" = "" ]; then                               \
+               echo;                                           \
+               echo Error: empty parameter to \"getsvn\(\)\";  \
+               echo;                                           \
+               exit -1;                                        \
+       fi;                                                     \
+       [ -d $$DEST ] || $(MKDIR) -p $$DEST;                    \
+       if [ "$$PACKETDIR" = "" ]; then                         \
+               PACKETDIR="$${DEST}";                           \
+       fi;                                                     \
+                                                               \
+       echo "checkout: repository=$$URL";                      \
+       echo "checkout: dest=$$PACKETDIR";                      \
+       $(SVN) export -r $$REV $$URL $$PACKETDIR;
+
+#
 # get
 #
 # Download a package from a given URL. This macro has some magic
diff --git a/scripts/lib/ptxd_make_get.sh b/scripts/lib/ptxd_make_get.sh
index 9a9f964..a571a79 100644
--- a/scripts/lib/ptxd_make_get.sh
+++ b/scripts/lib/ptxd_make_get.sh
@@ -50,6 +50,7 @@ ptxd_make_get_http() {
            "${url}" && {
                chmod 644 -- "${temp_file}" &&
                mv -- "${temp_file}" "${PTXDIST_SRCDIR}/${file}"
+               touch "${PTXDIST_SRCDIR}/${file}"
                return
        }
 
@@ -180,6 +181,12 @@ ptxd_make_get() {
                        ptxd_make_get_download_permitted &&
                        ptxd_make_get_http && return
                        ;;
+               http*.svn)
+                       echo;
+                       echo "Virtual Subversion URL - skipping!";
+                       echo "URL: $$URL";
+                       return
+                       ;;
                file*)
                        local thing="${url/file:\/\///}"
 
-- 
1.6.5.6.gb3118


--
ptxdist mailing list
[email protected]

Reply via email to