]> gitweb @ CieloNegro.org - sugar.git/commitdiff
Auto commit by The Sugar System.
authorPHO <pho@cielonegro.org>
Sun, 7 Dec 2008 13:44:25 +0000 (22:44 +0900)
committerPHO <pho@cielonegro.org>
Sun, 7 Dec 2008 13:44:25 +0000 (22:44 +0900)
GNUmakefile
dot-files/_zshenv [new file with mode: 0644]
tools/import.pl [new file with mode: 0644]

index 866991b30b96671a7298462c81ca4949960fb008..107eae235871179e7ae790efce16ae4194e1634f 100644 (file)
@@ -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=<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=<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 (file)
index 0000000..807201e
--- /dev/null
@@ -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 (file)
index 0000000..b722db1
--- /dev/null
@@ -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);