]> git.sev.monster Git - dotfiles.git/blame - install.sh
fixed install.sh on gnu/busybox/android
[dotfiles.git] / install.sh
CommitLineData
189288f7 1#!/bin/sh
d9362f34 2
9938f1e2 3if [ 0 -eq 1 ]; then
4 alias mkdir="echo mkdir"
5 alias ln="echo ln"
6 alias rm="echo rm"
7 alias cap_mkdb="echo cap_mkdb"
8 alias unlink="echo unlink"
9fi
10
5b39422d 11#fix permissions from git (TODO: should probably move this to git hook)
12chmod go= base/.zshenv base/.Xresources
13
14#create preferred folder structure
15cd "$HOME"
16mkdir -p bin etc share .urxvt/ext > /dev/null 2>&1
17mkdir -m 700 tmp tmp/vim > /dev/null 2>&1
18cd -
19
138de127 20#accomodate linuxisms
21fex='-perm -ugo=x'
22case "$OSTYPE" in
23 *bsd*) lnargs=-sFhvw
24 d1='-depth 1'
25 bsd=yes;;
26 *) lnargs=-sfnv
27 d1='-mindepth 1 -maxdepth 1'
28 #android busybox find doesn't have -execute
29 #and its sh doesn't set OSTYPE :DD
30 if [ -z "$ANDROID_ROOT" ]; then
31 fex=-executable
32 fi;;
33esac
34
9938f1e2 35l() {
f29cd560 36 # TODO: use install?
138de127 37 [ -L "$1" -o \! -e "$1" ] && ln $lnargs "${2:-$x}" "$1"
9938f1e2 38}
39
138de127 40find "$PWD/base" $d1 | while read -r x; do
9938f1e2 41 l "$HOME/`basename "$x"`"
42done
138de127 43find bin share $d1 | while read -r x; do
de6b1600 44 l "$HOME/$x" "$PWD/$x"
f29cd560 45done
138de127 46find "$PWD/xdg" $d1 | while read -r x; do
47 l "${XDG_CONFIG_HOME:-$HOME/etc}/`basename "$x"`"
7f0acd88 48done
138de127 49find "$PWD/urxvt-ext" -type f $fex -mindepth 1 -maxdepth 2 | while read -r x; do
9938f1e2 50 l "$HOME/.urxvt/ext/`basename $x`"
805ce2dc 51done
7f0acd88 52
138de127 53cd ~
54if [ -n "$bsd" ]; then
55 touch .hushlogin
56
57 #FreeBSD tries `_secure_path' on `.login_conf' before reading the database,
58 #so it needs to be compiled and unlinked for it to actually take effect.
59 rm .login_conf.db
60 cap_mkdb .login_conf
61fi
39bd5e00 62unlink .login_conf
d9362f34 63cd -
This page took 0.044724 seconds and 4 git commands to generate.