Skip to content

Commit

Permalink
INSTALL: using porcelain to detect if the clone is up-to-date (no ris…
Browse files Browse the repository at this point in the history
…k of locale or rebase strategy impacting the result)
  • Loading branch information
Commit-La-Grenouille committed Apr 28, 2022
1 parent 5a5a950 commit 5c8af62
Showing 1 changed file with 28 additions and 12 deletions.
40 changes: 28 additions & 12 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,13 @@ if [ $upgrade -eq 1 -a $makerfaire2018 -eq 0 -a -d ${home_dir}/wm8960 ]; then
echo "Updating sound driver - 2/14" > /tmp/pynab.upgrade
cd ${home_dir}/wm8960
sudo chown -R ${owner} .git
# Making sure we keep the up-to-date status message consistent no matter the rebase default behavior
pull=$(LANGUAGE=en git pull --no-rebase)
if [ "$pull" != "Already up to date." ]; then
# First we want to be sure we know everything from the remote branch status
git fetch
# Then we can check if the status considers our clone behind the remote (or not)
if git status --branch --porcelain | grep -q "\[behind"; then
echo "Sound driver already up-to-date."
else
git pull # Making sure we update the clone to the latest before rebuilding
make && sudo make install && make clean
sudo touch /tmp/pynab.upgrade.reboot
fi
Expand All @@ -89,9 +93,13 @@ if [ $upgrade -eq 1 ]; then
if [ -d ${home_dir}/tagtagtag-ears ]; then
cd ${home_dir}/tagtagtag-ears
sudo chown -R ${owner} .git
# Making sure we keep the up-to-date status message consistent no matter the rebase default behavior
pull=$(LANGUAGE=en git pull --no-rebase)
if [ "$pull" != "Already up to date." ]; then
# First we want to be sure we know everything from the remote branch status
git fetch
# Then we can check if the status considers our clone behind the remote (or not)
if git status --branch --porcelain | grep -q "\[behind"; then
echo "Ears driver already up-to-date."
else
git pull # Making sure we update the clone to the latest before rebuilding
make && sudo make install && make clean
sudo touch /tmp/pynab.upgrade.reboot
fi
Expand All @@ -114,9 +122,13 @@ if [ $upgrade -eq 1 ]; then
if [ -d ${home_dir}/cr14 ]; then
cd ${home_dir}/cr14
sudo chown -R ${owner} .git
# Making sure we keep the up-to-date status message consistent no matter the rebase default behavior
pull=$(LANGUAGE=en git pull --no-rebase)
if [ "$pull" != "Already up to date." ]; then
# First we want to be sure we know everything from the remote branch status
git fetch
# Then we can check if the status considers our clone behind the remote (or not)
if git status --branch --porcelain | grep -q "\[behind"; then
echo "RFID driver already up-to-date."
else
git pull # Making sure we update the clone to the latest before rebuilding
make && sudo make install && make clean
sudo touch /tmp/pynab.upgrade.reboot
fi
Expand All @@ -139,9 +151,13 @@ if [ $upgrade -eq 1 ]; then
if [ -d ${root_dir}/nabblockly ]; then
cd ${root_dir}/nabblockly
sudo chown -R ${owner} .
# Making sure we keep the up-to-date status message consistent no matter the rebase default behavior
pull=$(LANGUAGE=en git pull --no-rebase)
if [ "$pull" != "Already up to date." ]; then
# First we want to be sure we know everything from the remote branch status
git fetch
# Then we can check if the status considers our clone behind the remote (or not)
if git status --branch --porcelain | grep -q "\[behind"; then
echo "NabBlocky driver already up-to-date."
else
git pull # Making sure we update the clone to the latest before rebuilding
./rebar3 release
fi
else
Expand Down

0 comments on commit 5c8af62

Please sign in to comment.