* [PATCH] [CT_NG] [config] [scripts] fix download options
@ 2012-08-12 11:51 Austin Morton
2012-09-15 21:35 ` Austin Morton
2012-09-17 22:31 ` Yann E. MORIN
0 siblings, 2 replies; 3+ messages in thread
From: Austin Morton @ 2012-08-12 11:51 UTC (permalink / raw)
To: crossgcc
Hello all,
I have been using crosstool-NG for the past few days to build a
toolchain for a powerpc64 system, and while using it, have discovered a
few bugs.
One of my testers was having issues getting crosstool-NG to download
tarballs successfully, and we managed to rule it as an issue with the
remote locations being used for various components. So I threw together
a mirror of just the components our project needed and changed the
sample I had been distributing to use that mirror.
One of the bugs I found while doing this was the wrongly named
"FORBID_DOWNLOAD" option does not in fact forbid downloads. Rather it
forbids using the locations specified in the call to CT_GetFile,
restricting the requests to only use the mirror specified.
In fixing this issue I found it pleasing to also implement a
"FORCE_MIRROR" option which, as it is named only allows the mirror
specified to be used.
Below is the patch
# HG changeset patch
# User Austin Morton <austinpmorton@gmail.com>
# Date 1344771942 14400
# Node ID f9d225d5e8b1791db661cef261613b9b327dff50
# Parent 9ddca166bb2703129235bacf2e04e0b80f997462
fix download options
Signed-off by: Austin Morton <austinpmorton@gmail.com>
diff -r 9ddca166bb27 -r f9d225d5e8b1 config/global/download.in
--- a/config/global/download.in Sun Aug 05 00:33:27 2012 +1000
+++ b/config/global/download.in Sun Aug 12 07:45:42 2012 -0400
@@ -55,8 +55,6 @@
Useful to pre-retrieve the tarballs before going off-line.
-endif # ! FORBID_DOWNLOAD
-
config USE_MIRROR
bool
prompt "Use a mirror"
@@ -69,6 +67,18 @@
*not* on your LAN, for example on another subnet of your
company's
network, or a mirror on the Internet.
+if USE_MIRROR
+
+config FORCE_MIRROR
+ bool
+ prompt "Only use mirror"
+ help
+ Only allow downloading from the mirror specified, other download
locations
+ will NOT be used, and the package will fail to be located if not
present
+ on the mirror provided
+
+endif # USE_MIRROR
+
config MIRROR_BASE_URL
string
prompt "Base URL"
@@ -90,3 +100,5 @@
The mirror is available at:
http://crosstool-ng.org/mirrors/
+
+endif # ! FORBID_DOWNLOAD
diff -r 9ddca166bb27 -r f9d225d5e8b1 scripts/functions
--- a/scripts/functions Sun Aug 05 00:33:27 2012 +1000
+++ b/scripts/functions Sun Aug 12 07:45:42 2012 -0400
@@ -556,6 +556,12 @@
fi
# No, it does not...
+ # If not allowed to download from the Internet, don't
+ if [ "${CT_FORBID_DOWNLOAD}" = "y" ]; then
+ CT_DoLog DEBUG "Not allowed to download from the Internet,
aborting ${file} download"
+ return 1
+ fi
+
# Try to retrieve the file
CT_DoLog EXTRA "Retrieving '${file}'"
@@ -566,7 +572,7 @@
URLS+=( "${CT_MIRROR_BASE_URL}" )
fi
- if [ "${CT_FORBID_DOWNLOAD}" != "y" ]; then
+ if [ "${CT_FORCE_MIRROR}" != "y" ]; then
URLS+=( "${@}" )
fi
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] [CT_NG] [config] [scripts] fix download options
2012-08-12 11:51 [PATCH] [CT_NG] [config] [scripts] fix download options Austin Morton
@ 2012-09-15 21:35 ` Austin Morton
2012-09-17 22:31 ` Yann E. MORIN
1 sibling, 0 replies; 3+ messages in thread
From: Austin Morton @ 2012-09-15 21:35 UTC (permalink / raw)
To: crossgcc
On Sun, 2012-08-12 at 07:50 -0400, Austin Morton wrote:
> Hello all,
>
> I have been using crosstool-NG for the past few days to build a
> toolchain for a powerpc64 system, and while using it, have discovered a
> few bugs.
>
> One of my testers was having issues getting crosstool-NG to download
> tarballs successfully, and we managed to rule it as an issue with the
> remote locations being used for various components. So I threw together
> a mirror of just the components our project needed and changed the
> sample I had been distributing to use that mirror.
>
> One of the bugs I found while doing this was the wrongly named
> "FORBID_DOWNLOAD" option does not in fact forbid downloads. Rather it
> forbids using the locations specified in the call to CT_GetFile,
> restricting the requests to only use the mirror specified.
>
> In fixing this issue I found it pleasing to also implement a
> "FORCE_MIRROR" option which, as it is named only allows the mirror
> specified to be used.
>
> Below is the patch
>
>
> # HG changeset patch
> # User Austin Morton <austinpmorton@gmail.com>
> # Date 1344771942 14400
> # Node ID f9d225d5e8b1791db661cef261613b9b327dff50
> # Parent 9ddca166bb2703129235bacf2e04e0b80f997462
> fix download options
>
> Signed-off by: Austin Morton <austinpmorton@gmail.com>
>
> diff -r 9ddca166bb27 -r f9d225d5e8b1 config/global/download.in
> --- a/config/global/download.in Sun Aug 05 00:33:27 2012 +1000
> +++ b/config/global/download.in Sun Aug 12 07:45:42 2012 -0400
> @@ -55,8 +55,6 @@
>
> Useful to pre-retrieve the tarballs before going off-line.
>
> -endif # ! FORBID_DOWNLOAD
> -
> config USE_MIRROR
> bool
> prompt "Use a mirror"
> @@ -69,6 +67,18 @@
> *not* on your LAN, for example on another subnet of your
> company's
> network, or a mirror on the Internet.
>
> +if USE_MIRROR
> +
> +config FORCE_MIRROR
> + bool
> + prompt "Only use mirror"
> + help
> + Only allow downloading from the mirror specified, other download
> locations
> + will NOT be used, and the package will fail to be located if not
> present
> + on the mirror provided
> +
> +endif # USE_MIRROR
> +
> config MIRROR_BASE_URL
> string
> prompt "Base URL"
> @@ -90,3 +100,5 @@
>
> The mirror is available at:
> http://crosstool-ng.org/mirrors/
> +
> +endif # ! FORBID_DOWNLOAD
> diff -r 9ddca166bb27 -r f9d225d5e8b1 scripts/functions
> --- a/scripts/functions Sun Aug 05 00:33:27 2012 +1000
> +++ b/scripts/functions Sun Aug 12 07:45:42 2012 -0400
> @@ -556,6 +556,12 @@
> fi
> # No, it does not...
>
> + # If not allowed to download from the Internet, don't
> + if [ "${CT_FORBID_DOWNLOAD}" = "y" ]; then
> + CT_DoLog DEBUG "Not allowed to download from the Internet,
> aborting ${file} download"
> + return 1
> + fi
> +
> # Try to retrieve the file
> CT_DoLog EXTRA "Retrieving '${file}'"
>
> @@ -566,7 +572,7 @@
> URLS+=( "${CT_MIRROR_BASE_URL}" )
> fi
>
> - if [ "${CT_FORBID_DOWNLOAD}" != "y" ]; then
> + if [ "${CT_FORCE_MIRROR}" != "y" ]; then
> URLS+=( "${@}" )
> fi
>
>
>
Ping?
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] [CT_NG] [config] [scripts] fix download options
2012-08-12 11:51 [PATCH] [CT_NG] [config] [scripts] fix download options Austin Morton
2012-09-15 21:35 ` Austin Morton
@ 2012-09-17 22:31 ` Yann E. MORIN
1 sibling, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2012-09-17 22:31 UTC (permalink / raw)
To: crossgcc; +Cc: Austin Morton
Austin, All,
On Sunday 12 August 2012 13:50:55 Austin Morton wrote:
> # HG changeset patch
> # User Austin Morton <austinpmorton@gmail.com>
> # Date 1344771942 14400
> # Node ID f9d225d5e8b1791db661cef261613b9b327dff50
> # Parent 9ddca166bb2703129235bacf2e04e0b80f997462
> fix download options
Applied with a few (cosmetic) changes as #2858a24a5846. Thank You!
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
--
For unsubscribe information see http://sourceware.org/lists.html#faq
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-09-17 22:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-12 11:51 [PATCH] [CT_NG] [config] [scripts] fix download options Austin Morton
2012-09-15 21:35 ` Austin Morton
2012-09-17 22:31 ` Yann E. MORIN
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).