mirror of
https://github.com/qurator-spk/train-calamari-gt4histocr.git
synced 2025-08-14 12:09:55 +02:00
⬆ update */qurator_data_lib.sh
This commit is contained in:
parent
a4e4e162e9
commit
15ea8a7e03
1 changed files with 23 additions and 5 deletions
|
@ -1,3 +1,19 @@
|
||||||
|
# ______________________________________
|
||||||
|
#/ always copy the file from \
|
||||||
|
#| mono-repo/qurator_data_lib.sh, never |
|
||||||
|
#\ edit the copy in the project /
|
||||||
|
# --------------------------------------
|
||||||
|
# \ ^__^
|
||||||
|
# \ (oo)\_______
|
||||||
|
# (__)\ )\/\
|
||||||
|
# ||----w |
|
||||||
|
# || ||
|
||||||
|
|
||||||
|
if [ -z "$BASH" ]; then
|
||||||
|
echo "qurator_data_lib.sh uses bash features, please make sure to run $0 in bash"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
check_data_subdir() {
|
check_data_subdir() {
|
||||||
result=0
|
result=0
|
||||||
|
|
||||||
|
@ -51,11 +67,11 @@ download_to() {
|
||||||
unpack_to="$2"
|
unpack_to="$2"
|
||||||
|
|
||||||
(
|
(
|
||||||
cd data
|
cd $DATA_SUBDIR
|
||||||
tmpf=`mktemp 'tmp.XXXXX'`
|
tmpf=`mktemp 'tmp.XXXXX'`
|
||||||
wget -O $tmpf "$download_source"
|
curl -sSL -o $tmpf "$download_source"
|
||||||
mkdir -p "$unpack_to"
|
mkdir -p "$unpack_to"
|
||||||
# XXX Unpacking relies on tar -a unpacking any tar compression, might not work everywhere?
|
# Unpacking relies on tar -a unpacking any tar compression
|
||||||
tar -C "$unpack_to" -af $tmpf -xv
|
tar -C "$unpack_to" -af $tmpf -xv
|
||||||
rm -f $tmpf
|
rm -f $tmpf
|
||||||
)
|
)
|
||||||
|
@ -66,7 +82,7 @@ suggest_commands() {
|
||||||
echo
|
echo
|
||||||
echo "git submodule update --init"
|
echo "git submodule update --init"
|
||||||
echo "(cd $DATA_SUBDIR && git annex init --version=7)"
|
echo "(cd $DATA_SUBDIR && git annex init --version=7)"
|
||||||
echo "(cd $DATA_SUBDIR && git remote add nfs /<... path to ...>/GitNX-Repository/qurator/qurator-data)"
|
echo "(cd $DATA_SUBDIR && git remote add nfs annex@b-lx0053.sbb.spk-berlin.de:/var/lib/annex/qurator-data.git)"
|
||||||
}
|
}
|
||||||
|
|
||||||
handle_data() {
|
handle_data() {
|
||||||
|
@ -77,7 +93,9 @@ handle_data() {
|
||||||
no_download=0
|
no_download=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! check_data_subdir; then
|
if [ -n "$FORCE_DOWNLOAD" ]; then
|
||||||
|
get_from_web
|
||||||
|
elif ! check_data_subdir; then
|
||||||
if [[ $no_download = 1 ]]; then
|
if [[ $no_download = 1 ]]; then
|
||||||
select choice in "Abort to manually fix $DATA_SUBDIR submodule"; do
|
select choice in "Abort to manually fix $DATA_SUBDIR submodule"; do
|
||||||
if [ $REPLY = 1 ]; then
|
if [ $REPLY = 1 ]; then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue