diff --git a/files.sh b/files.sh new file mode 100644 index 0000000..9629263 --- /dev/null +++ b/files.sh @@ -0,0 +1,31 @@ +install_file root root 644 '/etc/tmux.conf' common +echo +install_dir root root 755 '/etc/vim' +install_file root root 644 '/etc/vim/vimrc.local' common +echo +install_dir root root 755 '/etc/fish' +install_dir root root 755 '/etc/fish/conf.d' +install_dir root root 755 '/etc/fish/functions' +install_file root root 644 '/etc/fish/config.fish' common +install_file root root 644 '/etc/fish/conf.d/rvm.fish' common +install_file root root 644 '/etc/fish/functions/fish_prompt.fish' common +install_file root root 644 '/etc/fish/functions/prompt_user_host.fish' common +install_file root root 644 '/etc/fish/functions/rvm.fish' common + +if [ "$PREFIX" = 'gentoo' ]; then +echo +install_file root root 644 '/etc/conf.d/display-manager' gentoo +install_file root root 644 '/etc/env.d/90xsession' gentoo +install_file root portage 644 '/var/lib/portage/world' gentoo +echo +install_dir root root 755 '/etc/portage/package.accept_keywords' +install_dir root root 755 '/etc/portage/package.mask' +install_dir root root 755 '/etc/portage/package.use' +install_file root root 644 '/etc/portage/make.conf' gentoo +install_file root root 644 '/etc/portage/package.license' gentoo +install_file root root 644 '/etc/portage/package.accept_keywords/package.accept_keywords' gentoo +install_file root root 644 '/etc/portage/package.mask/toolchains' gentoo +install_file root root 644 '/etc/portage/package.use/pluma' gentoo +install_file root root 644 '/etc/portage/package.use/toolchains' gentoo +install_file root root 644 '/etc/portage/package.use/zz-autounmask' gentoo +fi diff --git a/install b/install index a22b90a..56481a6 100755 --- a/install +++ b/install @@ -39,34 +39,4 @@ install_dir() { install -o "$owner" -g "$group" -m "$mode" -d "$path" } -install_file root root 644 '/etc/tmux.conf' common -echo -install_dir root root 755 '/etc/vim' -install_file root root 644 '/etc/vim/vimrc.local' common -echo -install_dir root root 755 '/etc/fish' -install_dir root root 755 '/etc/fish/conf.d' -install_dir root root 755 '/etc/fish/functions' -install_file root root 644 '/etc/fish/config.fish' common -install_file root root 644 '/etc/fish/conf.d/rvm.fish' common -install_file root root 644 '/etc/fish/functions/fish_prompt.fish' common -install_file root root 644 '/etc/fish/functions/prompt_user_host.fish' common -install_file root root 644 '/etc/fish/functions/rvm.fish' common - -if [ "$PREFIX" = 'gentoo' ]; then -echo -install_file root root 644 '/etc/conf.d/display-manager' gentoo -install_file root root 644 '/etc/env.d/90xsession' gentoo -install_file root portage 644 '/var/lib/portage/world' gentoo -echo -install_dir root root 755 '/etc/portage/package.accept_keywords' -install_dir root root 755 '/etc/portage/package.mask' -install_dir root root 755 '/etc/portage/package.use' -install_file root root 644 '/etc/portage/make.conf' gentoo -install_file root root 644 '/etc/portage/package.license' gentoo -install_file root root 644 '/etc/portage/package.accept_keywords/package.accept_keywords' gentoo -install_file root root 644 '/etc/portage/package.mask/toolchains' gentoo -install_file root root 644 '/etc/portage/package.use/pluma' gentoo -install_file root root 644 '/etc/portage/package.use/toolchains' gentoo -install_file root root 644 '/etc/portage/package.use/zz-autounmask' gentoo -fi +. "$REPO/files.sh" diff --git a/sync b/sync index cfb39ed..0cd0c78 100755 --- a/sync +++ b/sync @@ -11,9 +11,13 @@ REPO="$(dirname "$(realpath "$0")")" PREFIX="${1:-''}" -sync() { - prefix="$1" - path="$2" +install_dir() { + true +} + +install_file() { + path="$4" + prefix="$5" if [ -f "$path" ]; then echo cp "$path" "$REPO/$prefix$path" @@ -23,22 +27,4 @@ sync() { fi } -sync common '/etc/tmux.conf' -sync common '/etc/vim/vimrc.local' -sync common '/etc/fish/config.fish' -sync common '/etc/fish/conf.d/rvm.fish' -sync common '/etc/fish/functions/fish_prompt.fish' -sync common '/etc/fish/functions/prompt_user_host.fish' -sync common '/etc/fish/functions/rvm.fish' - -if [ "$PREFIX" = 'gentoo' ]; then -echo -sync gentoo '/var/lib/portage/world' -sync gentoo '/etc/portage/make.conf' -sync gentoo '/etc/portage/package.license' -sync gentoo '/etc/portage/package.accept_keywords/package.accept_keywords' -sync gentoo '/etc/portage/package.mask/toolchains' -sync gentoo '/etc/portage/package.use/pluma' -sync gentoo '/etc/portage/package.use/toolchains' -sync gentoo '/etc/portage/package.use/zz-autounmask' -fi +. "$REPO/files.sh"