New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jb53415 change data format #6
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few suggestions, also pointed out by shellcheck to the script but generally LGTM.
updateData.sh
Outdated
| popd | ||
| done | ||
| TOOL=$1 | ||
| FILE=$2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe quote these $1 and $2 ?
updateData.sh
Outdated
| @@ -1,22 +1,126 @@ | |||
| #/bin/sh | |||
| #/bin/bash | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#!/bin/bash ?
| Australia="au" | ||
| India="in" | ||
|
|
||
| cat <<EOF > $SPEC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that $SPEC contains spaces but maybe quotes?
updateData.sh
Outdated
| pushd $region | ||
| $TOOL -r $region $FILE | ||
| popd | ||
| mkdir -p $region |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mkdir -p $region
^-----^ SC2086: Double quote to prevent globbing and word splitting.
Did you mean:
mkdir -p "$region"
| $TOOL -r $region $FILE | ||
| popd | ||
| mkdir -p $region | ||
| echo "%files $region" | tr [:upper:] [:lower:] | tr '_' '-' >> $SPEC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echo "%files $region" | tr [:upper:] [:lower:] | tr '_' '-' >> $SPEC
^-------^ SC2060: Quote parameters to tr to prevent glob expansion.
^-------^ SC2060: Quote parameters to tr to prevent glob expansion.
updateData.sh
Outdated
| mkdir -p $region | ||
| echo "%files $region" | tr [:upper:] [:lower:] | tr '_' '-' >> $SPEC | ||
| echo "%defattr(-,root,root,-)" >> $SPEC | ||
| pushd $region |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pushd $region
^-----------^ SC2164: Use 'pushd ... || exit' or 'pushd ... || return' in case pushd fails.
^-----^ SC2086: Double quote to prevent globbing and word splitting.
updateData.sh
Outdated
| # ${!var} is bash indirect referencing, i.e. accessing whatever is in the | ||
| # variable with the name that is stored in $var. | ||
| for country in ${!region} ; do | ||
| mccs=`../$TOOL ../$FILE $country | sed 's/.*://'` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mccs=`../$TOOL ../$FILE $country | sed 's/.*://'`
^-- SC2006: Use $(...) notation instead of legacy backticked `...`.
^---^ SC2086: Double quote to prevent globbing and word splitting.
^---^ SC2086: Double quote to prevent globbing and word splitting.
^------^ SC2086: Double quote to prevent globbing and word splitting.
| echo "%{_datadir}/geoclue-provider-mlsdb/data/${mcc}.dat" >> ../$SPEC | ||
| done | ||
| done | ||
| popd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
popd
^--^ SC2164: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.
Did you mean:
popd || exit
|
Please squash the commits |
8abc75d
to
c148198
Compare
This matches the changes made in geoclue-providers-mlsdb. It also updates the data used to MLS-full-cell-export-2023-01-09T000000.csv
No description provided.