Skip to content
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

Merged
merged 1 commit into from Jan 12, 2023

Conversation

dsuni
Copy link

@dsuni dsuni commented Jan 9, 2023

No description provided.

Copy link

@LaakkonenJussi LaakkonenJussi left a 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

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

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

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

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

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

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/.*://'`

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

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

@pvuorela
Copy link
Contributor

Please squash the commits

@dsuni dsuni force-pushed the jb53415_change_data_format branch 3 times, most recently from 8abc75d to c148198 Compare January 12, 2023 12:47
This matches the changes made in geoclue-providers-mlsdb.
It also updates the data used to MLS-full-cell-export-2023-01-09T000000.csv
@pvuorela pvuorela merged commit 776a3ca into sailfishos:master Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants