summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-11-13 18:24:39 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2009-11-13 18:24:39 +0100
commitd60fd694fc2090e0d99d5a64857af7bd4e19876b (patch)
tree3c8e2b26332beb8f92d44756777b8209fc50e867
parentb3c5b43a1c85a773d6acdcaf6b9a5e35c31c10b9 (diff)
Remove now useless genzshrc script
-rwxr-xr-xinclude/genzshrc52
1 files changed, 0 insertions, 52 deletions
diff --git a/include/genzshrc b/include/genzshrc
deleted file mode 100755
index 21a022a..0000000
--- a/include/genzshrc
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/env perl
-use strict;
-use warnings;
-
-my $zshrc = "$ENV{HOME}/.zshrc";
-my $zsource = "$ENV{HOME}/packages/zsh/etc/rc";
-my %subst = (
- ZDIR => "$ENV{HOME}/packages/zsh/etc",
- HOME => $ENV{HOME},
-);
-my ($command, $args);
-
-sub substitute($) {
- my $string = shift;
- my ($param, $value);
- while (($param, $value) = each(%subst)) {
- $string =~ s/\$($param|\{$param\})/$value/g;
- }
- return($string);
-}
-
-sub parse($) {
- my $file = shift;
- my $fh;
- open($fh, '<', $file) or die("Can't open $file: $!");
- while(<$fh>) {
- chomp;
- s/^\s*//;
- if (/^#/ or $_ eq '') {
- next
- }
- if (/^(\S+)(?:\s+(.+))?$/ and deploy($1, $2)) {
- next;
- }
- print;
- print "\n";
- }
- close($fh);
-}
-
-sub deploy($;$) {
- my ($command, $args) = @_;
- my $plain_args = substitute($args || '');
- if ($command =~ /^x?source$/ and -r $plain_args) {
- print "## source $plain_args\n";
- parse($plain_args);
- return(1);
- }
- return(0);
-}
-
-parse($zsource);