BitShares Forum

Main => Technical Support => Topic started by: VoR0220 on February 13, 2015, 07:49:56 pm

Title: Made a bash script for easy upgrading of binaries in Ubuntu
Post by: VoR0220 on February 13, 2015, 07:49:56 pm
Hey guys. Nothing fancy. I just took what you guys already had and compacted it into a single command line run to upgrade ubuntu binaries in a bash script. Sent the pull request up to the github. Here's the code:

Code: [Select]
#!/bin/bash
# A short little script to help with the annoyance of upgrading bitshares in a Linux Distro

if [ -z "$1" ]; then    #if no command line arguments inputted, ask user for version they'd like
  echo -n "What version of BitShares would you like?: "
  read version
fi

# env -i git pull
# ^ this was in the original documentation...but I don't know why


# Checkout a certain version ... bts/VERSIONNUMBER !! modify accordingly
env -i git checkout bts/$version
env -i git submodule update

# Compile
make
make forcebuildweb || exit
make BitShares     || exit

## Install Binaries system-wide
cp programs/qt_wallet/bin/BitShares /usr/local/bin/
mkdir -p /usr/local/share/icons/
cp programs/qt_wallet/images/qtapp80.png /usr/local/share/icons/BitShares.png
cp programs/qt_wallet/BitShares.desktop /usr/local/share/applications/

exit

Command to run it is:

sudo bitshares-upgrade [version]

if you do not give a version number it will request it from you. Let me know what you think.
Title: Re: Made a bash script for easy upgrading of binaries in Ubuntu
Post by: santaclause102 on February 13, 2015, 07:52:27 pm
I find that very helpful, thanks a lot! Will test over the next days.
Title: Re: Made a bash script for easy upgrading of binaries in Ubuntu
Post by: VoR0220 on February 13, 2015, 08:09:18 pm
don't forget to chmod so that you have permission to run it :)
Title: Re: Made a bash script for easy upgrading of binaries in Ubuntu
Post by: xeroc on February 14, 2015, 12:33:28 pm
This gives you the latest version number in "bts/" tags!
Code: [Select]
$ git tag --sort=version:refname | grep "bts/" | tail -n1 | awk -F"/" '{print $2}'
0.6.1

also note that I added a new issue on github to ask for a "make install" feature in the makefiles ..

+5% .. keep up the food work!
Title: Re: Made a bash script for easy upgrading of binaries in Ubuntu
Post by: VoR0220 on February 15, 2015, 11:50:43 pm
good idea. A script to just update to the latest issue. Will put that in.