|
|
@ -1,14 +1,14 @@ |
|
|
#!/bin/bash |
|
|
#!/bin/bash |
|
|
# --- SDE-COPYRIGHT-NOTE-BEGIN --- |
|
|
# --- SDE-COPYRIGHT-NOTE-BEGIN --- |
|
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|
|
# |
|
|
|
|
|
|
|
|
# |
|
|
# Filename: bin/sde-download |
|
|
# Filename: bin/sde-download |
|
|
# Copyright (C) 2006 - 2008 The OpenSDE Project |
|
|
# Copyright (C) 2006 - 2008 The OpenSDE Project |
|
|
# Copyright (C) 2004 - 2006 The T2 SDE Project |
|
|
# Copyright (C) 2004 - 2006 The T2 SDE Project |
|
|
# Copyright (C) 1998 - 2003 Clifford Wolf |
|
|
# Copyright (C) 1998 - 2003 Clifford Wolf |
|
|
# |
|
|
|
|
|
|
|
|
# |
|
|
# More information can be found in the files COPYING and README. |
|
|
# More information can be found in the files COPYING and README. |
|
|
# |
|
|
|
|
|
|
|
|
# |
|
|
# This program is free software; you can redistribute it and/or modify |
|
|
# This program is free software; you can redistribute it and/or modify |
|
|
# it under the terms of the GNU General Public License as published by |
|
|
# it under the terms of the GNU General Public License as published by |
|
|
# the Free Software Foundation; version 2 of the License. A copy of the |
|
|
# the Free Software Foundation; version 2 of the License. A copy of the |
|
|
@ -30,7 +30,7 @@ download_usage() { |
|
|
cat <<EOT |
|
|
cat <<EOT |
|
|
Usage: |
|
|
Usage: |
|
|
sde download <options> [ Package(s) ] |
|
|
sde download <options> [ Package(s) ] |
|
|
sde download <options> [ Desc file(s) ] |
|
|
|
|
|
|
|
|
sde download <options> [ Desc file(s) ] |
|
|
sde download <options> -repository Repositories |
|
|
sde download <options> -repository Repositories |
|
|
sde download <options> [ -all | -required ] |
|
|
sde download <options> [ -all | -required ] |
|
|
|
|
|
|
|
|
@ -41,7 +41,7 @@ Usage: |
|
|
[ -copy ] [ -move ] |
|
|
[ -copy ] [ -move ] |
|
|
|
|
|
|
|
|
On default, this script auto-detects the best OpenSDE mirror. |
|
|
On default, this script auto-detects the best OpenSDE mirror. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mirrors can also be a local directories in the form of 'file:///<dir>'. |
|
|
Mirrors can also be a local directories in the form of 'file:///<dir>'. |
|
|
|
|
|
|
|
|
sde download [ -list | -list-missing | -list-cksums ] |
|
|
sde download [ -list | -list-missing | -list-cksums ] |
|
|
@ -79,7 +79,7 @@ while [ $# -gt 0 ]; do |
|
|
case "$1" in |
|
|
case "$1" in |
|
|
|
|
|
|
|
|
-this_is_the_2nd_run) |
|
|
-this_is_the_2nd_run) |
|
|
this_is_the_2nd_run=1 |
|
|
|
|
|
|
|
|
this_is_the_2nd_run=1 |
|
|
;; |
|
|
;; |
|
|
|
|
|
|
|
|
-cfg) |
|
|
-cfg) |
|
|
@ -89,7 +89,7 @@ while [ $# -gt 0 ]; do |
|
|
-q) |
|
|
-q) |
|
|
options="$options -q" |
|
|
options="$options -q" |
|
|
verbose=0 ;; |
|
|
verbose=0 ;; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-nock) |
|
|
-nock) |
|
|
# -nock skips checksum checking (don't use lightly) |
|
|
# -nock skips checksum checking (don't use lightly) |
|
|
options="$options -nock" |
|
|
options="$options -nock" |
|
|
@ -148,7 +148,7 @@ while [ $# -gt 0 ]; do |
|
|
# also try to download questionable URLs |
|
|
# also try to download questionable URLs |
|
|
options="$options -try-questionable" |
|
|
options="$options -try-questionable" |
|
|
tryques=1 ;; |
|
|
tryques=1 ;; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-move) altcopy=move ;; |
|
|
-move) altcopy=move ;; |
|
|
-copy) altcopy=copy ;; |
|
|
-copy) altcopy=copy ;; |
|
|
|
|
|
|
|
|
@ -175,7 +175,7 @@ if [ -n "$proxy" ]; then |
|
|
[ $this_is_the_2nd_run = 1 ] || echo_info "Using <$proxy> as ${proxyauth:+authenticated }http proxy." |
|
|
[ $this_is_the_2nd_run = 1 ] || echo_info "Using <$proxy> as ${proxyauth:+authenticated }http proxy." |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
#Disable checking for certificates on https downloads |
|
|
|
|
|
|
|
|
#Disable checking for certificates on https downloads |
|
|
curl_options="$curl_options -k" |
|
|
curl_options="$curl_options -k" |
|
|
|
|
|
|
|
|
# Autodetect best Mirror and safe url in $mirror |
|
|
# Autodetect best Mirror and safe url in $mirror |
|
|
@ -317,7 +317,7 @@ download_file() { |
|
|
if [ ! -d `dirname "$bzfile"` ] ; then |
|
|
if [ ! -d `dirname "$bzfile"` ] ; then |
|
|
mkdir -p `dirname "$bzfile"` |
|
|
mkdir -p `dirname "$bzfile"` |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Alternative Directory |
|
|
# Alternative Directory |
|
|
# |
|
|
# |
|
|
if [ "$altdir" ] ; then |
|
|
if [ "$altdir" ] ; then |
|
|
@ -357,7 +357,7 @@ download_file() { |
|
|
echo "INFO: download from mirror failed, trying original URL." |
|
|
echo "INFO: download from mirror failed, trying original URL." |
|
|
download_file_now "$location" $gzfile $bzfile \ |
|
|
download_file_now "$location" $gzfile $bzfile \ |
|
|
|| downloaderror=1 |
|
|
|| downloaderror=1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else |
|
|
else |
|
|
gzfile="$bzfile" |
|
|
gzfile="$bzfile" |
|
|
fi |
|
|
fi |
|
|
@ -414,7 +414,7 @@ download_file_now() { |
|
|
manual://*) |
|
|
manual://*) |
|
|
# Determine if the file has already been downloaded |
|
|
# Determine if the file has already been downloaded |
|
|
# manually. For this we first look in $HOME then in |
|
|
# manually. For this we first look in $HOME then in |
|
|
# download/manual. |
|
|
|
|
|
|
|
|
# download/manual. |
|
|
downloadpath=${altdir:-$HOME} |
|
|
downloadpath=${altdir:-$HOME} |
|
|
downloadfile="${gzfile##*/}" |
|
|
downloadfile="${gzfile##*/}" |
|
|
if [ -e $downloadpath/$downloadfile ]; then |
|
|
if [ -e $downloadpath/$downloadfile ]; then |
|
|
@ -532,7 +532,7 @@ download_file_now() { |
|
|
module="${options%% *}" |
|
|
module="${options%% *}" |
|
|
options="${options#* }" |
|
|
options="${options#* }" |
|
|
cmdline="cvs -z4 -Q -d $url co -P $options $module" |
|
|
cmdline="cvs -z4 -Q -d $url co -P $options $module" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# sometimes cvs wants to read ~/.cvspass just for fun .. |
|
|
# sometimes cvs wants to read ~/.cvspass just for fun .. |
|
|
touch $HOME/.cvspass |
|
|
touch $HOME/.cvspass |
|
|
;; |
|
|
;; |
|
|
@ -542,7 +542,7 @@ download_file_now() { |
|
|
else |
|
|
else |
|
|
url="svn://$url" |
|
|
url="svn://$url" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ "${options:0:1}" = "-" ]; then |
|
|
if [ "${options:0:1}" = "-" ]; then |
|
|
# the module is the last dir of $url |
|
|
# the module is the last dir of $url |
|
|
module="${url##*/}" |
|
|
module="${url##*/}" |
|
|
@ -618,7 +618,7 @@ download_file_now() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
list_dtags() { |
|
|
list_dtags() { |
|
|
{ |
|
|
|
|
|
|
|
|
{ |
|
|
grep -H '^\[D\] ' package/*/*/*.desc |
|
|
grep -H '^\[D\] ' package/*/*/*.desc |
|
|
grep -H '^[X0-9]' target/*/download.txt 2> /dev/null | sed 's,:,:[D] ,' |
|
|
grep -H '^[X0-9]' target/*/download.txt 2> /dev/null | sed 's,:,:[D] ,' |
|
|
} | column_clean |
|
|
} | column_clean |
|
|
@ -675,7 +675,7 @@ required() { |
|
|
done < config/$config/packages |
|
|
done < config/$config/packages |
|
|
|
|
|
|
|
|
# NOTE: ROCKCFG -> SDECFG automatized convertion |
|
|
# NOTE: ROCKCFG -> SDECFG automatized convertion |
|
|
grep -q 'ROCKCFG' ./config/$config/config && |
|
|
|
|
|
|
|
|
grep -q 'ROCKCFG' ./config/$config/config && |
|
|
sed -i -e 's,ROCKCFG,SDECFG,g' ./config/$config/config |
|
|
sed -i -e 's,ROCKCFG,SDECFG,g' ./config/$config/config |
|
|
|
|
|
|
|
|
target=`grep '^export SDECFG_TARGET=' config/$config/config | \ |
|
|
target=`grep '^export SDECFG_TARGET=' config/$config/config | \ |
|
|
@ -707,7 +707,7 @@ all() { |
|
|
done < <(grep -H '^\[D\] ' package/$repo/$pkg/$pkg.desc) |
|
|
done < <(grep -H '^\[D\] ' package/$repo/$pkg/$pkg.desc) |
|
|
done |
|
|
done |
|
|
done |
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for each in $( ls -1 target/*/download.txt 2> /dev/null ); do |
|
|
for each in $( ls -1 target/*/download.txt 2> /dev/null ); do |
|
|
target="`echo $each | cut -f2 -d/`" |
|
|
target="`echo $each | cut -f2 -d/`" |
|
|
|
|
|
|
|
|
@ -775,7 +775,7 @@ packages() { |
|
|
done |
|
|
done |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
set +e |
|
|
|
|
|
|
|
|
set +e |
|
|
|
|
|
|
|
|
# Things to do only for downloading |
|
|
# Things to do only for downloading |
|
|
# |
|
|
# |
|
|
|