[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-user: "go"
I mentioned this on IRC...
I call this script "go". What it does is look for a .go file in the
current directory, it's parent, etc, and runs it there. Sounds
simple, yes? Well, it's the .go files that make it interesting. I've
attached the .go for my lesstif pcb build; type "go" anywhere in the
build tree and it gets fresh sources and builds them, maybe
reconfiguring too.
So when I'm testing a patch, emacs is editing the source and xterm is
in the src/ directory, I just save the files and type "go" :-)
---------- >8 ---------- sample .go file ---------- >8 ----------
#!/bin/sh
rsync -a ../pcb/ ./
cd $GOPWD
if test -d .git
then
./autogen.sh
./configure --enable-maintainer-mode --enable-doc --prefix=$HOME/geda --with-gui=lesstif
fi
make
---------- >8 ---------- ~/bin/go ---------- >8 ----------
#!/usr/bin/perl
# -*- perl -*-
$me = `pwd`;
$me =~ s/[\r\n]+$//;
$ENV{'OLDPWD'} = $me;
$ENV{'GOPWD'} = $me;
while ($me =~ m@/[^/]*/[^/]+$@ && ! -f "$me/.go") {
$me =~ s@(/[^/]*)/[^/]+$@$1@;
}
chdir ($me) or die "chdir: $!";
if ( ! -f "./.go") {
print STDERR "no .go to go to!\n";
exit(1);
}
if ( ! -x ".go" ) {
system "chmod a+x .go";
}
exec ("./.go", @ARGV) or die "exec: $!";
_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user