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