@@ -69,10 +69,11 @@ trap 'echo "$program($LINENO): Command failed with error code $? ([$$] $0 $*)";
6969# Option parsing
7070
7171# Options
72- shortopts=DhvV
73- longopts=no-download,help,verbose,version
72+ shortopts=DhqvV
73+ longopts=no-download,help,quiet, verbose,version
7474
7575DOWNLOAD=1
76+ QUIET=" "
7677
7778if [ " $( uname) " = " Linux" ]; then
7879 args=$( getopt -o " $shortopts " --long " $longopts " -n ' $program' -- $SV " $@ " )
@@ -91,6 +92,7 @@ while true ; do
9192 case " $1 " in
9293 -D| --no-download) DOWNLOAD=" " ;; # Don't download, use existing file
9394 -h| --help) usage; exit ;; # Show this help, then exit
95+ -q| --quiet) QUIET=" -q" ;; # Don't show progress
9496 -v| --verbose) VERBOSE=1;; # Be more talkative
9597 -V| --version) version; exit ;; # Show program version, then exit
9698 --) shift ; break ;;
@@ -124,14 +126,19 @@ DATADIR=$parent/data
124126
125127if [ " $DOWNLOAD " ]; then
126128 echo " Fetching database dump ..."
127- wget -N -P $DATADIR https://www.ietf.org/lib/dt/sprint/ietf_utf8.sql.gz || die " No new data, quitting."
129+ wget $QUIET -N -P $DATADIR https://www.ietf.org/lib/dt/sprint/ietf_utf8.sql.gz || die " No new data, quitting."
128130fi
129131
130132echo " Loading database ..."
131- gunzip < $DATADIR /ietf_utf8.sql.gz \
132- | pv --progress --bytes --rate --eta --size $( gzip --list --quiet $DATADIR /ietf_utf8.sql.gz | awk ' { print $2 }' ) \
133- | sed -e ' s/ENGINE=MyISAM/ENGINE=InnoDB/' \
134- | $parent /ietf/manage.py dbshell
135-
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
142+ fi
136143
137144
0 commit comments