From ed4d72a28e9df4da16e644b73514129c2f2d3e56 Mon Sep 17 00:00:00 2001 From: PHO Date: Sun, 7 Dec 2008 22:44:25 +0900 Subject: [PATCH] Auto commit by The Sugar System. --- GNUmakefile | 15 +++++++++- dot-files/_zshenv | 73 +++++++++++++++++++++++++++++++++++++++++++++++ tools/import.pl | 22 ++++++++++++++ 3 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 dot-files/_zshenv create mode 100644 tools/import.pl diff --git a/GNUmakefile b/GNUmakefile index 866991b..107eae2 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -7,6 +7,8 @@ help: @echo " make update - update repository with the current dot files" @echo " make commit - commit changes to the repository" @echo " make install - update the current dot files with the repository" + @echo " make import FILES=" + @echo " - import the dot files into the repository" @echo lint: @@ -29,4 +31,15 @@ commit: install: lint perl ./tools/list-files.pl | perl ./tools/install.pl -.PHONY: help lint update commit install +ifeq ($(FILES),) +import: + @echo "Specify at least one file." + @echo "Usage: make import FILES=" + @exit 1 +else +import: + perl ./tools/import.pl $(FILES) + -git status +endif + +.PHONY: help lint update commit install import diff --git a/dot-files/_zshenv b/dot-files/_zshenv new file mode 100644 index 0000000..807201e --- /dev/null +++ b/dot-files/_zshenv @@ -0,0 +1,73 @@ +# -*- sh -*- + +function append_path { + local _varname="$1" + local _path="$2" + + if [ -d "$_path" ]; then + local _var=$(eval echo $(printf '$%s' "$_varname")) + + if [ "$_var" = "" ]; then + eval $(printf 'export %s="%s"' "$_varname" "$_path") + else + eval $(printf 'export %s="%s:$%s"' "$_varname" "$_path" "$_varname") + fi + fi +} + +# PATH +export PATH="" +append_path PATH /bin +append_path PATH /sbin +append_path PATH /usr/bin +append_path PATH /usr/sbin +append_path PATH /usr/pkg/bin +append_path PATH /usr/pkg/sbin +append_path PATH /usr/local/bin +append_path PATH /usr/local/sbin +# Hope these could be removed someday! +append_path PATH /usr/local/ymir/perl/bin + +# MANPATH +export MANPATH="" +append_path MANPATH /usr/share/man +append_path MANPATH /usr/pkg/man +append_path MANPATH /usr/local/man +append_path MANPATH /usr/local/share/man + +# INFOPATH +export INFOPATH="" +append_path INFOPATH /usr/share/info +append_path INFOPATH /usr/pkg/info +append_path INFOPATH /usr/local/info +append_path INFOPATH /usr/local/share/info + +# PKG_CONFIG_PATH +export PKG_CONFIG_PATH="" +append_path PKG_CONFIG_PATH /usr/lib/pkgconfig +append_path PKG_CONFIG_PATH /usr/pkg/lib/pkgconfig +append_path PKG_CONFIG_PATH /usr/local/lib/pkgconfig + +# DYLD_FALLBACK_LIBRARY_PATH (Only for Darwin) +export DYLD_FALLBACK_LIBRARY_PATH="" +append_path DYLD_FALLBACK_LIBRARY_PATH /usr/pkg/lib + +# Languages +export LANG="ja_JP.UTF-8" +export OUTPUT_CHARSET="UTF-8" + +# Default Tools +export EDITOR="vi" +export PAGER="lv" + +# Application Settings +export LV="-Ia -c" +export LESS="--quit-if-one-screen" +export GTK_IM_MODULE=uim + +# darcs +export DARCS_EMAIL="pho@cielonegro.org" +export DARCS_DONT_ESCAPE_8BIT=1 + +# uim-fep +export UIM_FEP=skk diff --git a/tools/import.pl b/tools/import.pl new file mode 100644 index 0000000..b722db1 --- /dev/null +++ b/tools/import.pl @@ -0,0 +1,22 @@ +use strict; +use warnings; +use Smart::Comments; +use lib 'tools'; +require 'utils.pl'; +use File::Spec; +use File::Copy; + +sub main { + my @args = @_; + + foreach my $arg (@args) { + my $rel = File::Spec->abs2rel($arg, $ENV{HOME}); + my $abs = File::Spec->rel2abs($rel, $ENV{HOME}); + my $saved = rel2saved($rel); + + print "Copying $abs to $saved...\n"; + copy($abs, $saved) or die $!; + } +} + +main(@ARGV); -- 2.40.0