Added a download-only switch to docker/updatedb

- Legacy-Id: 17909
This commit is contained in:
Henrik Levkowetz 2020-06-05 11:54:51 +00:00
parent 186e2ae67b
commit 4e79500df8

View file

@ -72,6 +72,7 @@ trap 'echo "$program($LINENO): Command failed with error code $? ([$$] $0 $*)";
shortopts=DhqvV
longopts=no-download,help,quiet,verbose,version
LOAD=1
DOWNLOAD=1
QUIET=""
@ -90,6 +91,7 @@ fi
while true ; do
case "$1" in
-d| --download) LOAD="";; # Only download
-D| --no-download) DOWNLOAD="";; # Don't download, use existing file
-h| --help) usage; exit;; # Show this help, then exit
-q| --quiet) QUIET="-q";; # Don't show progress
@ -129,6 +131,7 @@ if [ "$DOWNLOAD" ]; then
wget $QUIET -N -P $DATADIR https://www.ietf.org/lib/dt/sprint/ietf_utf8.sql.gz || die "No new data, quitting."
fi
if [ "$LOAD" ]; then
echo "Loading database ..."
if [ -z "$QUIET" ]; then
gunzip < $DATADIR/ietf_utf8.sql.gz \
@ -140,5 +143,5 @@ else
| sed -e 's/ENGINE=MyISAM/ENGINE=InnoDB/' \
| $parent/ietf/manage.py dbshell
fi
fi