Skip to content

Commit 99fde98

Browse files
committed
Added a --no-download option to docker/updatedb
- Legacy-Id: 12323
1 parent a9db20e commit 99fde98

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

docker/updatedb

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ trap 'echo "$program($LINENO): Command failed with error code $? ([$$] $0 $*)";
6969
# Option parsing
7070

7171
# Options
72-
shortopts=hvV
73-
longopts=help,verbose,version
72+
shortopts=DhvV
73+
longopts=no-download,help,verbose,version
74+
75+
DOWNLOAD=1
7476

7577
if [ "$(uname)" = "Linux" ]; then
7678
args=$(getopt -o "$shortopts" --long "$longopts" -n '$program' -- $SV "$@")
@@ -87,6 +89,7 @@ fi
8789

8890
while true ; do
8991
case "$1" in
92+
-D| --no-download) DOWNLOAD="";; # Don't download, use existing file
9093
-h| --help) usage; exit;; # Show this help, then exit
9194
-v| --verbose) VERBOSE=1;; # Be more talkative
9295
-V| --version) version; exit;; # Show program version, then exit
@@ -119,9 +122,10 @@ DATADIR=$parent/data
119122
# mysql -u root ietf_utf8 <<< "GRANT ALL PRIVILEGES ON ietf_utf8.* TO django@localhost IDENTIFIED BY 'RkTkDPFnKpko'; FLUSH PRIVILEGES;"
120123
# fi
121124

122-
echo "Fetching database dump ..."
123-
wget -S -N -P $DATADIR http://www.ietf.org/lib/dt/sprint/ietf_utf8.sql.gz || die "No new data, quitting."
124-
#rsync -u --progress zin.tools.ietf.org::tools/tools/ietf_utf8.sql.gz $DATADIR/ || die "No new data, quitting."
125+
if [ "$DOWNLOAD" ]; then
126+
echo "Fetching database dump ..."
127+
wget -S -N -P $DATADIR http://www.ietf.org/lib/dt/sprint/ietf_utf8.sql.gz || die "No new data, quitting."
128+
fi
125129

126130
echo "Loading database ..."
127131
gunzip < $DATADIR/ietf_utf8.sql.gz \

0 commit comments

Comments
 (0)