diff options
author | Yann E. MORIN <yann.morin.1998@free.fr> | 2018-04-02 10:14:22 +0200 |
---|---|---|
committer | Peter Korsgaard <peter@korsgaard.com> | 2018-04-02 12:22:50 +0200 |
commit | 91e776b5af11f6f98646168fc8c16254fa3bb012 (patch) | |
tree | e4d9d6499d7485df8ee7862bf0043e32753abe17 /support/download/dl-wrapper | |
parent | f03cf639cfba961ca4cbfb73435f23b951941685 (diff) | |
download | buildroot-91e776b5af11f6f98646168fc8c16254fa3bb012.tar.gz buildroot-91e776b5af11f6f98646168fc8c16254fa3bb012.zip |
core/pkg-download: change all helpers to use common options
Currently all download helpers accepts the local output file, the remote
locations, the changesets and so on... as positional arguments.
This was well and nice when that's was all we needed.
But then we added an option to quiesce their verbosity, and that was
shoehorned with a trivial getopts, still keeping all the existing
positional arguments as... positional arguments.
Adding yet more options while keeping positional arguments will not be
very easy, even if we do not envision any new option in the foreseeable
future (but 640K ought to be enough for everyone, remember? ;-) ).
Change all helpers to accept a set of generic options (-q for quiet and
-o for the output file) as well as helper-specific options (like -r for
the repository, -c for a changeset...).
Maxime:
Changed -R to -r for recurse (only for the git backend)
Changed -r to -u for URI (for all backend)
Change -R to -c for cset (for CVS and SVN backend)
Add the export of the BR_BACKEND_DL_GETOPTS so all the backend wrapper
can use the same option easily
Now all the backends use the same common options.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'support/download/dl-wrapper')
-rwxr-xr-x | support/download/dl-wrapper | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/support/download/dl-wrapper b/support/download/dl-wrapper index b018819833..abc51f637a 100755 --- a/support/download/dl-wrapper +++ b/support/download/dl-wrapper @@ -19,6 +19,8 @@ # We want to catch any unexpected failure, and exit immediately. set -e +export BR_BACKEND_DL_GETOPTS=":hc:o:n:N:H:ru:q" + main() { local OPT OPTARG local backend output hfile recurse quiet rc @@ -83,7 +85,10 @@ main() { # If the backend fails, we can just remove the temporary directory to # remove all the cruft it may have left behind. Then we just exit in # error too. - if ! "${OLDPWD}/support/download/${backend}" ${quiet} ${recurse} "${tmpf}" "${@}"; then + if ! "${OLDPWD}/support/download/${backend}" \ + ${quiet} ${recurse} \ + -o "${tmpf}" "${@}" + then rm -rf "${tmpd}" exit 1 fi |