]> git.sev.monster Git - dotfiles.git/blame - install.sh
wscons fix
[dotfiles.git] / install.sh
CommitLineData
189288f7 1#!/bin/sh
d9362f34 2
9938f1e2 3if [ 0 -eq 1 ]; then
ba63cd01 4 mkdir() { echo "$*"; }
9938f1e2 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
ba63cd01 12cd ~
5b39422d 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'
ba63cd01 19case "$OSTYPE" in
20 # TODO: make links safer for systems without -Fw
21 freebsd) lnargs=-sFhvw;;
22 netbsd|openbsd) lnargs=-sfhv;;
23 *) lnargs=-sfnv
24 #android busybox find doesn't have -executable
25 #and its sh doesn't set OSTYPE :DD
26 if [ -z "$ANDROID_ROOT" ]; then
27 fex=-executable
28 fi;;
138de127 29esac
30
9938f1e2 31l() {
f29cd560 32 # TODO: use install?
138de127 33 [ -L "$1" -o \! -e "$1" ] && ln $lnargs "${2:-$x}" "$1"
9938f1e2 34}
35
ba63cd01 36find "$PWD/base" -mindepth 1 -maxdepth 1 | while read -r x; do
9938f1e2 37 l "$HOME/`basename "$x"`"
38done
ba63cd01 39find bin share -mindepth 1 -maxdepth 1 | while read -r x; do
de6b1600 40 l "$HOME/$x" "$PWD/$x"
f29cd560 41done
ba63cd01 42find "$PWD/xdg" -mindepth 1 -maxdepth 1 | while read -r x; do
138de127 43 l "${XDG_CONFIG_HOME:-$HOME/etc}/`basename "$x"`"
7f0acd88 44done
138de127 45find "$PWD/urxvt-ext" -type f $fex -mindepth 1 -maxdepth 2 | while read -r x; do
9938f1e2 46 l "$HOME/.urxvt/ext/`basename $x`"
805ce2dc 47done
7f0acd88 48
138de127 49cd ~
ba63cd01 50if [ "$OSTYPE" = "freebsd" ]; then
138de127 51 touch .hushlogin
52
53 #FreeBSD tries `_secure_path' on `.login_conf' before reading the database,
54 #so it needs to be compiled and unlinked for it to actually take effect.
55 rm .login_conf.db
56 cap_mkdb .login_conf
57fi
39bd5e00 58unlink .login_conf
d9362f34 59cd -
This page took 0.045084 seconds and 4 git commands to generate.