mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] ptxdist getdev: Download dev packages from ${PTXCONF_SETUP_DEVMIRROR}
@ 2014-01-21  2:11 jon
  2014-01-23 16:08 ` Michael Olbrich
  2014-01-23 16:45 ` Michael Olbrich
  0 siblings, 2 replies; 5+ messages in thread
From: jon @ 2014-01-21  2:11 UTC (permalink / raw)
  To: ptxdist; +Cc: Jon Ringle

From: Jon Ringle <jringle@gridpoint.com>

Version 2

This patch allows you to setup a dev package mirror to hold *-dev.tar.gz
packages.

Upload your *-dev.tar.gz packages to your mirror, then you can avoid
rebuilding all your packages by doing:

ptxdist getdev


Signed-off-by: Jon Ringle <jringle@gridpoint.com>
---
 bin/ptxdist                         |    5 +++++
 config/setup/Kconfig                |   10 ++++++++++
 rules/post/ptxd_make_world_get.make |    7 +++++++
 scripts/lib/ptxd_lib_dgen.awk       |    7 +++++++
 scripts/lib/ptxd_make_get.sh        |   15 ++++++++-------
 5 files changed, 37 insertions(+), 7 deletions(-)

diff --git a/bin/ptxdist b/bin/ptxdist
index f9cbdec..663c41e 100755
--- a/bin/ptxdist
+++ b/bin/ptxdist
@@ -1789,6 +1789,11 @@ EOF
 			fi
 			exit
 			;;
+		getdev)
+			check_premake &&
+			ptxd_make_log getdev
+			exit
+			;;
 		go|images)
 			do_${cmd}
 			exit
diff --git a/config/setup/Kconfig b/config/setup/Kconfig
index 790276b..e90949b 100644
--- a/config/setup/Kconfig
+++ b/config/setup/Kconfig
@@ -93,6 +93,16 @@ config SETUP_PROJECTPATH
 
 endmenu
 
+menu "Dev Download      "
+
+config SETUP_DEVMIRROR
+	string "Dev package Mirror"
+	help
+	  Enter a URL where *-dev.tar.gz packages can be downloaded
+	  Use: ptxdist getdev
+
+endmenu
+
 menu "Source Directories"
 
 config SETUP_SRCDIR
diff --git a/rules/post/ptxd_make_world_get.make b/rules/post/ptxd_make_world_get.make
index 152674c..ae11db9 100644
--- a/rules/post/ptxd_make_world_get.make
+++ b/rules/post/ptxd_make_world_get.make
@@ -26,6 +26,9 @@ $(SRCDIR)/%:
 	@$(call targetinfo)
 	@$(call get, $($@))
 
+$(call remove_quotes, $(PTXCONF_PROJECT_DEVPKGDIR))/%:
+	@$(call targetinfo)
+	@$(call getdev, $@)
 
 $(STATEDIR)/%.get:
 	@$(call targetinfo)
@@ -59,4 +62,8 @@ get = \
 check_src = \
 	ptxd_make_check_src "$($(strip $(1))_SOURCE)" "$($(strip $(1))_MD5)"
 
+getdev = \
+	ptxd_make_get_nofail=y \
+	ptxd_make_get "$(strip $(1))" "$(call remove_quotes, $(PTXCONF_SETUP_DEVMIRROR))/$(notdir $(1))"
+
 # vim: syntax=make
diff --git a/scripts/lib/ptxd_lib_dgen.awk b/scripts/lib/ptxd_lib_dgen.awk
index 7f790c9..0cd2ac1 100644
--- a/scripts/lib/ptxd_lib_dgen.awk
+++ b/scripts/lib/ptxd_lib_dgen.awk
@@ -241,6 +241,13 @@ function write_deps_pkg_all(this_PKG, this_pkg) {
 	# .get rule
 	#
 	print "$(STATEDIR)/" this_pkg ".get: $(" this_PKG "_SOURCES)"	> DGEN_DEPS_POST;
+	print "ifneq ($(call remove_quotes, $(PTXCONF_SETUP_DEVMIRROR)),)" > DGEN_DEPS_POST;
+	print "ifneq ($($(" this_PKG "_DEVPKG)),NO)" > DGEN_DEPS_POST;
+	print "ifneq ($(" this_PKG "_CFGHASH),)" > DGEN_DEPS_POST;
+	print "getdev: $(call remove_quotes, $(PTXCONF_PROJECT_DEVPKGDIR))/$(" this_PKG "_DEVPKG)" > DGEN_DEPS_POST;
+	print "endif" > DGEN_DEPS_POST;
+	print "endif" > DGEN_DEPS_POST;
+	print "endif" > DGEN_DEPS_POST;
 }
 
 function write_deps_pkg_active(this_PKG, this_pkg, prefix) {
diff --git a/scripts/lib/ptxd_make_get.sh b/scripts/lib/ptxd_make_get.sh
index f4d7922..185dc77 100644
--- a/scripts/lib/ptxd_make_get.sh
+++ b/scripts/lib/ptxd_make_get.sh
@@ -280,7 +280,7 @@ ptxd_make_get() {
 		shift
 
 		case "${url}" in
-		${PTXCONF_SETUP_PTXMIRROR}/*/*)
+		${PTXCONF_SETUP_PTXMIRROR}/*/*|${PTXCONF_SETUP_DEVMIRROR}/*)
 			# keep original URL, for stuff like glibc
 			argv[${#argv[@]}]="${url}"
 			mrd=true
@@ -397,11 +397,12 @@ ptxd_make_get() {
 		esac
 	done
 
-	echo
-	echo "Could not download package"
-	echo "URL: ${orig_argv[@]}"
-	echo
-	exit 1
+	if [ "${ptxd_make_get_nofail}" != "y" ]; then
+		echo
+		echo "Could not download package"
+		echo "URL: ${orig_argv[@]}"
+		echo
+		exit 1
+	fi
 }
-
 export -f ptxd_make_get
-- 
1.7.10.4


-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2014-01-24  9:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-21  2:11 [ptxdist] [PATCH] ptxdist getdev: Download dev packages from ${PTXCONF_SETUP_DEVMIRROR} jon
2014-01-23 16:08 ` Michael Olbrich
2014-01-24  8:43   ` Juergen Beisert
2014-01-24  9:17     ` Michael Olbrich
2014-01-23 16:45 ` Michael Olbrich

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