X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=lib.sh;h=9e2308d6adf988de977116d7b28713e52c077fce;hb=f30437901deddf4e539294eaddcd2f19af1d778b;hp=88b7b98a26f2ba84cf2c141191bc296dbac48ddc;hpb=8c731331a353d82adc61a81bd3cb92e79f3c2dc8;p=config%2Fdotfiles.git diff --git a/lib.sh b/lib.sh index 88b7b98..9e2308d 100644 --- a/lib.sh +++ b/lib.sh @@ -17,11 +17,14 @@ installed() { which $1 | grep -E '^/' > /dev/null } -# Prints the current OS. Supported are Debian (debian) and Mac OS X (darwin) -# at the moment. If an unsupported OS is used an error is printed. +# Prints the current OS. Supported are Debian (debian), Gentoo (gentoo) and +# Mac OS X (darwin) at the moment. If an unsupported OS is used an error is +# printed. os() { if [ -f /etc/debian_version ]; then echo debian + elif [ -f /etc/gentoo-release ]; then + echo gentoo elif [ x`uname` = xDarwin ]; then echo darwin else @@ -97,7 +100,7 @@ m4() { (echo "define(\`IF', \`ifelse(\`\$1', \`\$2',dnl')dnl define(\`FI', \`)dnl')dnl"; # Run the file (and the default macros) through m4. - cat $file.m4) | $m4 $* >> $file + cat $file.m4) | $m4 "$@" >> $file unset file }