@@ -72,6 +72,7 @@ trap 'echo "$program($LINENO): Command failed with error code $? ([$$] $0 $*)";
7272shortopts=DhqvV
7373longopts=no-download,help,quiet,verbose,version
7474
75+ LOAD=1
7576DOWNLOAD=1
7677QUIET=" "
7778
9091
9192while true ; do
9293 case " $1 " in
93- -D| --no-download) DOWNLOAD=" " ;; # Don't download, use existing file
94+ -d| --download) LOAD=" " ;; # Only download
95+ -D| --no-download) DOWNLOAD=" " ;; # Don't download, use existing file
9496 -h| --help) usage; exit ;; # Show this help, then exit
95- -q| --quiet) QUIET=" -q" ;; # Don't show progress
97+ -q| --quiet) QUIET=" -q" ;; # Don't show progress
9698 -v| --verbose) VERBOSE=1;; # Be more talkative
9799 -V| --version) version; exit ;; # Show program version, then exit
98100 --) shift ; break ;;
@@ -129,16 +131,17 @@ if [ "$DOWNLOAD" ]; then
129131 wget $QUIET -N -P $DATADIR https://www.ietf.org/lib/dt/sprint/ietf_utf8.sql.gz || die " No new data, quitting."
130132fi
131133
132- echo " Loading database ..."
133- if [ -z " $QUIET " ]; then
134- gunzip < $DATADIR /ietf_utf8.sql.gz \
135- | pv --progress --bytes --rate --eta --size $( gzip --list --quiet $DATADIR /ietf_utf8.sql.gz | awk ' { print $2 }' ) \
136- | sed -e ' s/ENGINE=MyISAM/ENGINE=InnoDB/' \
137- | $parent /ietf/manage.py dbshell
138- else
139- gunzip < $DATADIR /ietf_utf8.sql.gz \
140- | sed -e ' s/ENGINE=MyISAM/ENGINE=InnoDB/' \
141- | $parent /ietf/manage.py dbshell
134+ if [ " $LOAD " ]; then
135+ echo " Loading database ..."
136+ if [ -z " $QUIET " ]; then
137+ gunzip < $DATADIR /ietf_utf8.sql.gz \
138+ | pv --progress --bytes --rate --eta --size $( gzip --list --quiet $DATADIR /ietf_utf8.sql.gz | awk ' { print $2 }' ) \
139+ | sed -e ' s/ENGINE=MyISAM/ENGINE=InnoDB/' \
140+ | $parent /ietf/manage.py dbshell
141+ else
142+ gunzip < $DATADIR /ietf_utf8.sql.gz \
143+ | sed -e ' s/ENGINE=MyISAM/ENGINE=InnoDB/' \
144+ | $parent /ietf/manage.py dbshell
145+ fi
142146fi
143147
144-
0 commit comments