Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
860d26e4
Commit
860d26e4
authored
Dec 23, 2013
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kicad-install.sh: abort on first failure.
parent
d6292053
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
16 deletions
+32
-16
kicad-install.sh
scripts/kicad-install.sh
+32
-16
No files found.
scripts/kicad-install.sh
View file @
860d26e4
#!/bin/bash
#!/bin/bash
-e
# Install KiCad from source onto either:
# -> a Ubuntu/Debian/Mint or
# -> a Red Hat
...
...
@@ -25,6 +25,12 @@
# bzr-git seems not up to the task. wget or curl would also work.
# Since bash is invoked with -e by the first line of this script, all the steps in this script
# must succeed otherwise bash will abort at the first non-zero error code. Therefore any script
# functions must be crafted to anticipate numerous conditions, such that no command fails unless it
# is a serious situation.
# Set where the 3 source trees will go, use a full path
WORKING_TREES
=
~/kicad_sources
...
...
@@ -113,9 +119,17 @@ install_prerequisites()
rm_build_dir
()
{
local dir
=
"
$1
"
# this file is often created as root, so remove as root
sudo rm
"
$dir
/install_manifest.txt"
2> /dev/null
rm
-rf
"
$dir
"
echo
"removing directory
$dir
"
if
[
-e
"
$dir
/install_manifest.txt"
]
;
then
# this file is often created as root, so remove as root
sudo rm
"
$dir
/install_manifest.txt"
2> /dev/null
fi
if
[
-d
"
$dir
"
]
;
then
rm
-rf
"
$dir
"
fi
}
...
...
@@ -142,24 +156,24 @@ cmake_uninstall()
# sets an environment variable globally.
set_env_var
()
{
local
VAR
=
$1
local
VAL
=
$2
local
var
=
$1
local
val
=
$2
if
[
-d
/etc/profile.d
]
;
then
if
[
!
-e
/etc/profile.d/kicad.sh
]
||
!
grep
"
$
VAR
"
/etc/profile.d/kicad.sh
;
then
if
[
!
-e
/etc/profile.d/kicad.sh
]
||
!
grep
"
$
var
"
/etc/profile.d/kicad.sh
>>
/dev/null
;
then
echo
echo
"Adding environment variable
$
VAR
to file /etc/profile.d/kicad.sh"
echo
"Adding environment variable
$
var
to file /etc/profile.d/kicad.sh"
echo
"Please logout and back in after this script completes for environment"
echo
"variable to get set into environment."
sudo
sh
-c
"echo export
$
VAR
=
$VAL
>> /etc/profile.d/kicad.sh"
sudo
sh
-c
"echo export
$
var
=
$val
>> /etc/profile.d/kicad.sh"
fi
elif
[
-e
/etc/environment
]
;
then
if
!
grep
"
$
VAR
"
/etc/environment
;
then
if
!
grep
"
$
var
"
/etc/environment
>>
/dev/null
;
then
echo
echo
"Adding environment variable
$
VAR
to file /etc/environment"
echo
"Adding environment variable
$
var
to file /etc/environment"
echo
"Please reboot after this script completes for environment variable to get set into environment."
sudo
sh
-c
"echo
$
VAR
=
$VAL
>> /etc/environment"
sudo
sh
-c
"echo
$
var
=
$val
>> /etc/environment"
fi
fi
}
...
...
@@ -239,7 +253,7 @@ install_or_update()
mkdir
build
&&
cd
build
cmake ../
sudo
make
install
echo
" kicad-lib installed."
echo
" kicad-lib
.bzr
installed."
echo
"step 9) as non-root, install user configuration files..."
...
...
@@ -256,12 +270,14 @@ install_or_update()
sudo
make
install
echo
" kicad-doc.bzr installed."
echo
echo
'All KiCad "--install-or-update" steps completed, you are up to date.'
echo
"step 11) check for environment variables..."
if
[
-z
"
${
KIGITHUB
}
"
]
;
then
set_env_var KIGITHUB https://github.com/KiCad
fi
echo
echo
'All KiCad "--install-or-update" steps completed, you are up to date.'
echo
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment