-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathinstall.sh
executable file
·57 lines (46 loc) · 1.41 KB
/
install.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
#!/bin/sh
# This program is free software you can redistribute it under
# the terms of the GPL v3 or later license
#
# Copyright (c) 2013 Oscar Campos - <[email protected]>
EIX=/usr/bin/eix
LAYMAN=/usr/bin/layman
[ -e /etc/make.conf ] && MAKE_CONF=/etc/make.conf || {
[ -e /etc/portage/make.conf ] && MAKE_CONF=/etc/portage/make.conf || {
echo "Couln'd find make.conf neither in /etc or /ect/portage. aborting..."
exit
}
}
### functions ###
install_layman() {
emerge layman && {
echo "
# LAYMAN OVERLAYS
source /var/lib/layman/make.conf" >> $MAKE_CONF
}
}
### script ###
[ x$(whoami) == "xroot" ] || {
echo "You must be root to run this script. Try with sudo"
exit
}
# check for layman
[ -x $LAYMAN ] || {
echo -n "Layman is not installed on the system. Installing layman..."
install_layman
}
echo "Retrieving overlay definition file..."
hash wget >/dev/null && wget --no-check-certificate https://raw.github.com/DamnWidget/sublime-text/master/sublime-text.xml -O /etc/layman/overlays/sublime-text.xml || {
echo "wget is not installed or there is some problem with the donwload (do you have internet connection?)"
exit
}
echo "Installing Sublime Text repository to layman local overlays..."
$LAYMAN -a sublime-text
[ -x $EIX ] && {
echo "Updating emerge and eix cache..."
eix-sync
}
echo
echo "Installation complete, you can now install sublime-text using: "
echo "\temerge app-editors/sublime-text"
echo