Added a download-only switch to docker/updatedb
- Legacy-Id: 17909
This commit is contained in:
parent
186e2ae67b
commit
4e79500df8
|
@ -72,6 +72,7 @@ trap 'echo "$program($LINENO): Command failed with error code $? ([$$] $0 $*)";
|
||||||
shortopts=DhqvV
|
shortopts=DhqvV
|
||||||
longopts=no-download,help,quiet,verbose,version
|
longopts=no-download,help,quiet,verbose,version
|
||||||
|
|
||||||
|
LOAD=1
|
||||||
DOWNLOAD=1
|
DOWNLOAD=1
|
||||||
QUIET=""
|
QUIET=""
|
||||||
|
|
||||||
|
@ -90,9 +91,10 @@ fi
|
||||||
|
|
||||||
while true ; do
|
while true ; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-D| --no-download) DOWNLOAD="";; # Don't download, use existing file
|
-d| --download) LOAD="";; # Only download
|
||||||
|
-D| --no-download) DOWNLOAD="";; # Don't download, use existing file
|
||||||
-h| --help) usage; exit;; # Show this help, then exit
|
-h| --help) usage; exit;; # Show this help, then exit
|
||||||
-q| --quiet) QUIET="-q";; # Don't show progress
|
-q| --quiet) QUIET="-q";; # Don't show progress
|
||||||
-v| --verbose) VERBOSE=1;; # Be more talkative
|
-v| --verbose) VERBOSE=1;; # Be more talkative
|
||||||
-V| --version) version; exit;; # Show program version, then exit
|
-V| --version) version; exit;; # Show program version, then exit
|
||||||
--) shift; break;;
|
--) shift; break;;
|
||||||
|
@ -129,16 +131,17 @@ if [ "$DOWNLOAD" ]; then
|
||||||
wget $QUIET -N -P $DATADIR https://www.ietf.org/lib/dt/sprint/ietf_utf8.sql.gz || die "No new data, quitting."
|
wget $QUIET -N -P $DATADIR https://www.ietf.org/lib/dt/sprint/ietf_utf8.sql.gz || die "No new data, quitting."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Loading database ..."
|
if [ "$LOAD" ]; then
|
||||||
if [ -z "$QUIET" ]; then
|
echo "Loading database ..."
|
||||||
gunzip < $DATADIR/ietf_utf8.sql.gz \
|
if [ -z "$QUIET" ]; then
|
||||||
| pv --progress --bytes --rate --eta --size $(gzip --list --quiet $DATADIR/ietf_utf8.sql.gz | awk '{ print $2 }') \
|
gunzip < $DATADIR/ietf_utf8.sql.gz \
|
||||||
| sed -e 's/ENGINE=MyISAM/ENGINE=InnoDB/' \
|
| pv --progress --bytes --rate --eta --size $(gzip --list --quiet $DATADIR/ietf_utf8.sql.gz | awk '{ print $2 }') \
|
||||||
| $parent/ietf/manage.py dbshell
|
| sed -e 's/ENGINE=MyISAM/ENGINE=InnoDB/' \
|
||||||
else
|
| $parent/ietf/manage.py dbshell
|
||||||
gunzip < $DATADIR/ietf_utf8.sql.gz \
|
else
|
||||||
| sed -e 's/ENGINE=MyISAM/ENGINE=InnoDB/' \
|
gunzip < $DATADIR/ietf_utf8.sql.gz \
|
||||||
| $parent/ietf/manage.py dbshell
|
| sed -e 's/ENGINE=MyISAM/ENGINE=InnoDB/' \
|
||||||
|
| $parent/ietf/manage.py dbshell
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue