Created
September 25, 2015 04:11
-
-
Save philiprhoades/2fab1f08d1c729582166 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Fedora 23 x86_64 | |
# Always first updating rust and cargo | |
# If there are pull changes, always doing "cargo clean & update" | |
safedir=`pwd` | |
echo "" | |
echo -n "Have you run rustup.sh today? [y|N]: " | |
read yorn | |
if test "$yorn" != "y" | |
then | |
curl -sSf https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly | |
rm -fr ./cargo-nightly-x86_64-unknown-linux-gnu* | |
wget https://static.rust-lang.org/cargo-dist/cargo-nightly-x86_64-unknown-linux-gnu.tar.gz | |
tar xvfz ./cargo-nightly-x86_64-unknown-linux-gnu.tar.gz | |
cd ./cargo-nightly-x86_64-unknown-linux-gnu && ./install.sh | |
fi | |
cd $safedir | |
echo "" | |
echo -n "Hit ENTER to continue: " | |
read junk | |
dirs="crust-routing \ | |
routing-safe_client \ | |
safe_client-safe_vault \ | |
safe_vault-safe_nfs \ | |
safe_nfs-finished" | |
for dir in $dirs | |
do | |
currdir="${dir%-*}" | |
nextdir="${dir#*-}" | |
cd ${safedir} | |
clear | |
echo "" | |
echo "Pulling dir -->${currdir}" | |
echo "" | |
if [ ! -d $currdir ]; then | |
git clone https://github.com/maidsafe/$currdir | |
cd $currdir | |
else | |
cd $currdir | |
git pull origin master | |
fi | |
echo "" | |
echo -n "Skip this directory -->${currdir} ? [y|N]: " | |
read yorn | |
if test "$yorn" = "y" | |
then | |
continue | |
else | |
for action in clean \ | |
update \ | |
build \ | |
tst | |
do | |
echo "" | |
echo -n "Directory -->${currdir} Action -->${action} Skip this action? [y|N]: " | |
read yorn | |
if test "$yorn" = "y" | |
then | |
continue | |
fi | |
case "$action" in | |
clean) | |
cargo clean | |
;; | |
update) | |
cargo update | |
;; | |
build) | |
cargo build | |
;; | |
tst) | |
# xterm -maximized -hold -e "cd ${dir} && RUST_TEST_THREADS=1 cargo test" & | |
parms=`grep Features .travis.yml | sed -e 's/^.*F/--f/' -e 's/=/ /'` | |
RUST_TEST_THREADS=1 cargo test --release $parms | |
;; | |
*) | |
echo "Invalid option, choose again..." | |
read junk | |
;; | |
esac | |
echo "" | |
echo -n "Current loop -->${currdir}-->$action Hit ENTER to continue: " | |
read junk | |
done | |
echo "" | |
echo "" | |
echo -n "Next loop -->${nextdir}-->pull Hit ENTER to continue: " | |
read junk | |
fi | |
done | |
Presumably at some stage when things are stable, I could probably comment out all of it . .
Yeah - we're keen to be able to move off requiring Rust Nightly. Crust is the only one of our projects which forces us onto the Nightly channel, mainly because of the networking dependencies I think.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The other thing was that if a pull did not get anything new, I would skip doing anything on that dir altogether . .