-
Notifications
You must be signed in to change notification settings - Fork 6
/
updater.sh
executable file
·62 lines (51 loc) · 1.47 KB
/
updater.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
export SUDO_ASKPASS=`pwd`/sudo_helper.sh
# Ask the user if they want to install a developer version of qtpyvcp
zenity --question --text="Is this a USER or DEVELOPER install?" --no-wrap --ok-label="USER" --cancel-label="DEVELOPER"
DEVELOPER=$?
# Developer = 1 for DEVELOPER install
# Developer = 0 for USER install
# Ask the user if they want to install a developer version of qtpyvcp
zenity --question --text="UPDATE linuxcnc 2.9-pre Yes or No?" --no-wrap --ok-label="yes" --cancel-label="no"
CHOICE=$?
if [ $CHOICE -eq 0 ]
then
# update linuxcnc
cd ~/dev/linuxcnc/rip
git pull
VERSION=`head -n1 debian/changelog |cut -f2 -d' ' | tr -d "()" | sed -e 's/^[0-9]://' `
# set up the build locations for self build
CPUS=`nproc`
cd ~/dev/linuxcnc/rip/src/
make clean
./autogen.sh
./configure --with-realtime=uspace
make -j$CPUS
sudo -A make setuid
# make the deb files
cd ~/dev/linuxcnc/rip/debian/
./configure no-docs
cd ~/dev/linuxcnc/rip/
dpkg-buildpackage -b -uc
# install the deb files
cd ~/dev/linuxcnc/
sudo -A dpkg -i linuxcnc-uspace_${VERSION}_amd64.deb
#sudo -A dpkg -i linuxcnc-doc-en_${VERSION}_all.deb
fi
if [ $DEVELOPER -eq 1 ]
then
# get qtpyvcp
echo "Updating Qtpyvcp"
cd ~/dev/qtpyvcp
git pull
# determine if PB is installed and if is installed, update
if [ -d ~/dev/probe_basic ]
then
echo "Updating Probe Basic and Conversational"
cd ~/dev/probe_basic
git pull
qcompile .
cd ~/dev/qtpyvcp_conversational_gcode
git pull
fi
fi