* [ptxdist] [PATCH 1/2] ptxd_make_get: fix typo: .zup -> .zip
@ 2013-08-08 19:36 Stephan Linz
2013-08-08 19:36 ` [ptxdist] [PATCH 2/2] ptxd_make_get: support svn urls Stephan Linz
2013-08-12 17:10 ` [ptxdist] [PATCH 1/2] ptxd_make_get: fix typo: .zup -> .zip Marc Kleine-Budde
0 siblings, 2 replies; 4+ messages in thread
From: Stephan Linz @ 2013-08-08 19:36 UTC (permalink / raw)
To: ptxdist; +Cc: j.beisert, mkl
Signed-off-by: Stephan Linz <linz@li-pro.net>
---
scripts/lib/ptxd_make_get.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/scripts/lib/ptxd_make_get.sh b/scripts/lib/ptxd_make_get.sh
index f8722a6..8507dd5 100644
--- a/scripts/lib/ptxd_make_get.sh
+++ b/scripts/lib/ptxd_make_get.sh
@@ -92,7 +92,7 @@ ptxd_make_get_git() {
*.tar.gz|*.tar.bz2|*.tar.xz|*.zip)
;;
*)
- ptxd_bailout "Only .tar.gz, .tar.bz2, .tar.xz and .zup archives are supported for git downloads."
+ ptxd_bailout "Only .tar.gz, .tar.bz2, .tar.xz and .zip archives are supported for git downloads."
;;
esac
--
1.7.1
--
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 4+ messages in thread
* [ptxdist] [PATCH 2/2] ptxd_make_get: support svn urls
2013-08-08 19:36 [ptxdist] [PATCH 1/2] ptxd_make_get: fix typo: .zup -> .zip Stephan Linz
@ 2013-08-08 19:36 ` Stephan Linz
2013-08-12 17:13 ` Marc Kleine-Budde
2013-08-12 17:10 ` [ptxdist] [PATCH 1/2] ptxd_make_get: fix typo: .zup -> .zip Marc Kleine-Budde
1 sibling, 1 reply; 4+ messages in thread
From: Stephan Linz @ 2013-08-08 19:36 UTC (permalink / raw)
To: ptxdist; +Cc: j.beisert, mkl
In some circumstances it is important to fetch source code
directly from a repository, for example for software development
and/or evaluation. There are some few software projects that
still stay on Subversion, especially vendor specific projects.
In very rare cases the project maintainer will never provide
release tarballs and you have to fetch the Subversion release
branch (for example the eglibc project).
Signed-off-by: Stephan Linz <linz@li-pro.net>
---
scripts/lib/ptxd_make_get.sh | 86 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 86 insertions(+), 0 deletions(-)
diff --git a/scripts/lib/ptxd_make_get.sh b/scripts/lib/ptxd_make_get.sh
index 8507dd5..bfb03a3 100644
--- a/scripts/lib/ptxd_make_get.sh
+++ b/scripts/lib/ptxd_make_get.sh
@@ -141,6 +141,76 @@ export -f ptxd_make_get_git
#
+# in env:
+#
+# ${path} : local file name
+# ${url} : the url to download
+# ${opts[]} : an array of options
+#
+ptxd_make_get_svn() {
+ set -- "${opts[@]}"
+ unset opts
+ local rev
+ local tarcomp
+ local mirror="${url#[a-z]*//}"
+ mirror="$(dirname "${path}")/${mirror//\//.}"
+ local prefix="$(basename "${path}")"
+ prefix="${prefix%.tar.*}"
+
+ case "${path}" in
+ *.tar.gz)
+ tarcomp="--gzip"
+ ;;
+ *.tar.bz2)
+ tarcomp="--bzip2"
+ ;;
+ *.tar.xz)
+ tarcomp="--xz"
+ ;;
+ *)
+ ptxd_bailout "Only .tar.gz, .tar.bz2, .tar.xz and archives are supported for svn downloads."
+ ;;
+ esac
+
+ #
+ # scan for valid options
+ #
+ while [ ${#} -ne 0 ]; do
+ local opt="${1}"
+ shift
+
+ case "${opt}" in
+ rev=*)
+ rev="${opt#rev=}"
+ ;;
+ *)
+ ptxd_bailout "invalid option '${opt}' to ${FUNCNAME}"
+ ;;
+ esac
+ done
+ unset opt
+
+ if [ -z "${rev}" ]; then
+ ptxd_bailout "svn url '${url}' has no 'rev' option"
+ fi
+
+ echo "${PROMPT}svn: fetching '${url} into '${mirror}'..."
+ if [ ! -d "${mirror}" ]; then
+ svn checkout -r ${rev} "${url}" "${mirror}"
+ else
+ svn update -r ${rev} "${mirror}"
+ fi &&
+ lmtime=$(svn info -r ${rev} "${mirror}" | \
+ awk '/^Last Changed Date:/ {print $4 " " $5 " " $6}') &&
+ echo "${PROMPT}svn: last modification time '${lmtime}'" &&
+ tar --exclude-vcs --show-stored-names ${tarcomp} \
+ --mtime="${lmtime}" --transform "s|^\.|${prefix}|g" \
+ --create --file "${path}" -C "${mirror}" .
+}
+export -f ptxd_make_get_svn
+
+
+#
# check if download is disabled
#
# in env:
@@ -234,6 +304,18 @@ ptxd_make_get() {
mrd=true
fi
;;
+ svn://*)
+ # restrict donwload only to the PTXMIRROR
+ if [ -z "${PTXCONF_SETUP_PTXMIRROR_ONLY}" ]; then
+ # keep original URL
+ argv[${#argv[@]}]="${url}"
+ fi
+ # add mirror to URLs, but only once
+ if ! ${mrd}; then
+ ptxmirror_url="${path/#\/*\//${PTXCONF_SETUP_PTXMIRROR}/}"
+ mrd=true
+ fi
+ ;;
http://*|https://*|ftp://*)
# restrict donwload only to the PTXMIRROR
if [ -z "${PTXCONF_SETUP_PTXMIRROR_ONLY}" ]; then
@@ -280,6 +362,10 @@ ptxd_make_get() {
ptxd_make_get_download_permitted &&
ptxd_make_get_git && return
;;
+ svn://*)
+ ptxd_make_get_download_permitted &&
+ ptxd_make_get_svn && return
+ ;;
http://*|https://*|ftp://*)
ptxd_make_get_download_permitted &&
ptxd_make_get_http && return
--
1.7.1
--
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [ptxdist] [PATCH 2/2] ptxd_make_get: support svn urls
2013-08-08 19:36 ` [ptxdist] [PATCH 2/2] ptxd_make_get: support svn urls Stephan Linz
@ 2013-08-12 17:13 ` Marc Kleine-Budde
0 siblings, 0 replies; 4+ messages in thread
From: Marc Kleine-Budde @ 2013-08-12 17:13 UTC (permalink / raw)
To: Stephan Linz; +Cc: j.beisert, ptxdist
[-- Attachment #1.1: Type: text/plain, Size: 925 bytes --]
On 08/08/2013 09:36 PM, Stephan Linz wrote:
> In some circumstances it is important to fetch source code
> directly from a repository, for example for software development
> and/or evaluation. There are some few software projects that
> still stay on Subversion, especially vendor specific projects.
>
> In very rare cases the project maintainer will never provide
> release tarballs and you have to fetch the Subversion release
> branch (for example the eglibc project).
>
> Signed-off-by: Stephan Linz <linz@li-pro.net>
At the first glance it looks good. As it shouldn't break anything I have
applied it to master.
Tnx,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]
[-- Attachment #2: Type: text/plain, Size: 48 bytes --]
--
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [ptxdist] [PATCH 1/2] ptxd_make_get: fix typo: .zup -> .zip
2013-08-08 19:36 [ptxdist] [PATCH 1/2] ptxd_make_get: fix typo: .zup -> .zip Stephan Linz
2013-08-08 19:36 ` [ptxdist] [PATCH 2/2] ptxd_make_get: support svn urls Stephan Linz
@ 2013-08-12 17:10 ` Marc Kleine-Budde
1 sibling, 0 replies; 4+ messages in thread
From: Marc Kleine-Budde @ 2013-08-12 17:10 UTC (permalink / raw)
To: Stephan Linz; +Cc: j.beisert, ptxdist
[-- Attachment #1.1: Type: text/plain, Size: 393 bytes --]
On 08/08/2013 09:36 PM, Stephan Linz wrote:
> Signed-off-by: Stephan Linz <linz@li-pro.net>
tnx, applied
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]
[-- Attachment #2: Type: text/plain, Size: 48 bytes --]
--
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-08-12 17:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-08 19:36 [ptxdist] [PATCH 1/2] ptxd_make_get: fix typo: .zup -> .zip Stephan Linz
2013-08-08 19:36 ` [ptxdist] [PATCH 2/2] ptxd_make_get: support svn urls Stephan Linz
2013-08-12 17:13 ` Marc Kleine-Budde
2013-08-12 17:10 ` [ptxdist] [PATCH 1/2] ptxd_make_get: fix typo: .zup -> .zip Marc Kleine-Budde
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox