r118 - trunk

Peter Palfrader cabot-devel@lists.noreply.org
Thu, 25 Mar 2004 02:25:25 -0700


Author: weasel
Date: 2004-03-25 02:25:19 -0700 (Thu, 25 Mar 2004)
New Revision: 118

Added:
   trunk/Cabot.pm.in
   trunk/autogen.sh
   trunk/install-sh
Removed:
   trunk/Cabot.pm
Modified:
   trunk/
   trunk/configure.ac
   trunk/setversion
Log:
Add autogen.sh
Move Cabot.pm to Cabot.pm.in, make VERSION be @VERSION@
Cabot.pm is an output file of configure now (set in configure.ac)
add install-sh, configure needs it
Make setversion executeable
Add Cabot.pm to ignored files


Property changes on: trunk
___________________________________________________________________
Name: svn:ignore
   - *.7
*.5
*.1
*.html
*.txt
ChangeLog
Makefile
Makefile.in
VERSION.m4
aclocal.m4
autom4te.cache
autoscan.log
cabot-????????.tar.gz
cabot-????????.tar.gz.asc
config.log
config.status
configure
configure.lineno

   + *.7
*.5
*.1
*.html
*.txt
ChangeLog
Cabot.pm
Makefile
Makefile.in
VERSION.m4
aclocal.m4
autom4te.cache
autoscan.log
cabot-????????.tar.gz
cabot-????????.tar.gz.asc
config.log
config.status
configure
configure.lineno



Deleted: trunk/Cabot.pm
===================================================================
--- trunk/Cabot.pm	2004-03-25 09:23:54 UTC (rev 117)
+++ trunk/Cabot.pm	2004-03-25 09:25:19 UTC (rev 118)
@@ -1,120 +0,0 @@
-#!/usr/bin/perl -w
-
-# $Id$
-
-# Copyright (c) 2001, 2003 Peter Palfrader
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Privacy Guard; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-#
-
-package Cabot;
-
-use warnings;
-use strict;
-use IO::Handle;
-use English;
-use File::Path;
-
-BEGIN {
-    use Exporter ();
-    our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
-
-    $VERSION = '$Revision$'; # FIXME
-    @ISA = qw(Exporter);
-    @EXPORT = qw(%CONFIG &getkeydir &makekeydir &mkfds &readwritegpg &ask);
-    @EXPORT_OK = qw(%CONFIG &getkeydir &makekeydir &mkfds &readwritegpg &ask);
-    %EXPORT_TAGS = ( );
-    push @EXPORT_OK, '&genrandstring';
-    %EXPORT_TAGS = ( );
-}
-
-our @EXPORT_OK;
-
-our %CONFIG;
-
-sub getkeydir($$;$) {
-	my ($what, $keyid, $uid) = @_;
-	$keyid =~ s/[^A-Za-z0-9 +_@<>()'.-]/_/g;
-	$uid =~ s/[^A-Za-z0-9 +_@<>()'.-]/_/g  if defined $uid;
-	return $CONFIG{$what}.'/'.$keyid. ( defined $uid ? '/'.$uid : '' );
-}
-
-sub makekeydir($$;$) {
-	my ($what, $keyid, $uid) = @_;
-	unless ( -d $CONFIG{$what} ) {
-	    mkpath($CONFIG{$what}, 0, 0711) or
-	      die "Cannot create dir ".$CONFIG{$what}."\n";
-	}
-	unless ( -d getkeydir($what, $keyid) ) {
-	    mkpath(getkeydir($what, $keyid), 0, 0711) or
-	      die "Cannot create dir ".getkeydir($what, $keyid)."\n";
-	}
-	return unless defined $uid;
-	unless ( -d getkeydir($what, $keyid, $uid) ) {
-	    mkpath(getkeydir($what, $keyid, $uid), 0, 0711) or
-	      die "Cannot create dir ".getkeydir($what, $keyid, $uid)."\n";
-	}
-}
-
-sub mkfds() {
-	my %fds = (
-		stdin => IO::Handle->new(),
-		stdout => IO::Handle->new(),
-		stderr => IO::Handle->new(),
-		status => IO::Handle->new() );
-	my $handles = GnuPG::Handles->new( %fds );
-	return ($fds{'stdin'}, $fds{'stdout'}, $fds{'stderr'}, $fds{'status'}, $handles);
-};
-
-sub readwritegpg($$$$$) {
-	my ($in, $inputfd, $stdoutfd, $stderrfd, $statusfd) = @_;
-	local $INPUT_RECORD_SEPARATOR = undef;
-
-	print $inputfd $in; close $inputfd;
-	my $stdout = <$stdoutfd>; close $stdoutfd;
-	my $stderr = <$stderrfd>; close $stderrfd;
-	my $status = <$statusfd>; close $statusfd;
-	return ($stdout, $stderr, $status);
-}
-
-sub ask($$) {
-	my ($question, $default) = @_;
-	my $answer;
-	while (1) {
-		print $question,' ',($default ? '[Y/n]' : '[y/N]'), ' ';
-		$answer = <STDIN>;
-		chomp $answer;
-		last if ((defined $answer) && (length $answer <= 1));
-		print "grrrrrr.\n";
-		sleep 1;
-	};
-	my $result = $default;
-	$result = 1 if $answer =~ /y/i;
-	$result = 0 if $answer =~ /n/i;
-	return $result;
-};
-
-sub genrandstring($) {
-        my ($size) = @_;
-        my $ret = "";
-        return "" if ($size <= 0);
-        for (my $i = 0; $i < $size; $i++) {
-            $ret .= ("A" .. "Z", "a" .."z")[rand 52];
-        }
-        return $ret;
-}
-
-1;

Copied: trunk/Cabot.pm.in (from rev 113, trunk/Cabot.pm)
===================================================================
--- trunk/Cabot.pm	2004-03-24 18:11:30 UTC (rev 113)
+++ trunk/Cabot.pm.in	2004-03-25 09:25:19 UTC (rev 118)
@@ -0,0 +1,120 @@
+#!/usr/bin/perl -w
+
+# $Id$
+
+# Copyright (c) 2001, 2003 Peter Palfrader
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Privacy Guard; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+
+package Cabot;
+
+use warnings;
+use strict;
+use IO::Handle;
+use English;
+use File::Path;
+
+BEGIN {
+    use Exporter ();
+    our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
+
+    $VERSION = '@VERSION@';
+    @ISA = qw(Exporter);
+    @EXPORT = qw(%CONFIG &getkeydir &makekeydir &mkfds &readwritegpg &ask);
+    @EXPORT_OK = qw(%CONFIG &getkeydir &makekeydir &mkfds &readwritegpg &ask);
+    %EXPORT_TAGS = ( );
+    push @EXPORT_OK, '&genrandstring';
+    %EXPORT_TAGS = ( );
+}
+
+our @EXPORT_OK;
+
+our %CONFIG;
+
+sub getkeydir($$;$) {
+	my ($what, $keyid, $uid) = @_;
+	$keyid =~ s/[^A-Za-z0-9 +_@<>()'.-]/_/g;
+	$uid =~ s/[^A-Za-z0-9 +_@<>()'.-]/_/g  if defined $uid;
+	return $CONFIG{$what}.'/'.$keyid. ( defined $uid ? '/'.$uid : '' );
+}
+
+sub makekeydir($$;$) {
+	my ($what, $keyid, $uid) = @_;
+	unless ( -d $CONFIG{$what} ) {
+	    mkpath($CONFIG{$what}, 0, 0711) or
+	      die "Cannot create dir ".$CONFIG{$what}."\n";
+	}
+	unless ( -d getkeydir($what, $keyid) ) {
+	    mkpath(getkeydir($what, $keyid), 0, 0711) or
+	      die "Cannot create dir ".getkeydir($what, $keyid)."\n";
+	}
+	return unless defined $uid;
+	unless ( -d getkeydir($what, $keyid, $uid) ) {
+	    mkpath(getkeydir($what, $keyid, $uid), 0, 0711) or
+	      die "Cannot create dir ".getkeydir($what, $keyid, $uid)."\n";
+	}
+}
+
+sub mkfds() {
+	my %fds = (
+		stdin => IO::Handle->new(),
+		stdout => IO::Handle->new(),
+		stderr => IO::Handle->new(),
+		status => IO::Handle->new() );
+	my $handles = GnuPG::Handles->new( %fds );
+	return ($fds{'stdin'}, $fds{'stdout'}, $fds{'stderr'}, $fds{'status'}, $handles);
+};
+
+sub readwritegpg($$$$$) {
+	my ($in, $inputfd, $stdoutfd, $stderrfd, $statusfd) = @_;
+	local $INPUT_RECORD_SEPARATOR = undef;
+
+	print $inputfd $in; close $inputfd;
+	my $stdout = <$stdoutfd>; close $stdoutfd;
+	my $stderr = <$stderrfd>; close $stderrfd;
+	my $status = <$statusfd>; close $statusfd;
+	return ($stdout, $stderr, $status);
+}
+
+sub ask($$) {
+	my ($question, $default) = @_;
+	my $answer;
+	while (1) {
+		print $question,' ',($default ? '[Y/n]' : '[y/N]'), ' ';
+		$answer = <STDIN>;
+		chomp $answer;
+		last if ((defined $answer) && (length $answer <= 1));
+		print "grrrrrr.\n";
+		sleep 1;
+	};
+	my $result = $default;
+	$result = 1 if $answer =~ /y/i;
+	$result = 0 if $answer =~ /n/i;
+	return $result;
+};
+
+sub genrandstring($) {
+        my ($size) = @_;
+        my $ret = "";
+        return "" if ($size <= 0);
+        for (my $i = 0; $i < $size; $i++) {
+            $ret .= ("A" .. "Z", "a" .."z")[rand 52];
+        }
+        return $ret;
+}
+
+1;

Added: trunk/autogen.sh
===================================================================
--- trunk/autogen.sh	2004-03-25 09:23:54 UTC (rev 117)
+++ trunk/autogen.sh	2004-03-25 09:25:19 UTC (rev 118)
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+./setversion && aclocal && autoconf && automake
+./configure


Property changes on: trunk/autogen.sh
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2004-03-25 09:23:54 UTC (rev 117)
+++ trunk/configure.ac	2004-03-25 09:25:19 UTC (rev 118)
@@ -34,4 +34,4 @@
 AC_CONFIG_FILES([Makefile
                  doc/Makefile])
 
-AC_OUTPUT
+AC_OUTPUT(Cabot.pm)

Added: trunk/install-sh
===================================================================
--- trunk/install-sh	2004-03-25 09:23:54 UTC (rev 117)
+++ trunk/install-sh	2004-03-25 09:25:19 UTC (rev 118)
@@ -0,0 +1,251 @@
+#!/bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission.  M.I.T. makes no representations about the
+# suitability of this software for any purpose.  It is provided "as is"
+# without express or implied warranty.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.  It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+    case $1 in
+	-c) instcmd="$cpprog"
+	    shift
+	    continue;;
+
+	-d) dir_arg=true
+	    shift
+	    continue;;
+
+	-m) chmodcmd="$chmodprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-o) chowncmd="$chownprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-g) chgrpcmd="$chgrpprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-s) stripcmd="$stripprog"
+	    shift
+	    continue;;
+
+	-t=*) transformarg=`echo $1 | sed 's/-t=//'`
+	    shift
+	    continue;;
+
+	-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+	    shift
+	    continue;;
+
+	*)  if [ x"$src" = x ]
+	    then
+		src=$1
+	    else
+		# this colon is to work around a 386BSD /bin/sh bug
+		:
+		dst=$1
+	    fi
+	    shift
+	    continue;;
+    esac
+done
+
+if [ x"$src" = x ]
+then
+	echo "install:	no input file specified"
+	exit 1
+else
+	:
+fi
+
+if [ x"$dir_arg" != x ]; then
+	dst=$src
+	src=""
+	
+	if [ -d $dst ]; then
+		instcmd=:
+		chmodcmd=""
+	else
+		instcmd=$mkdirprog
+	fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad 
+# if $src (and thus $dsttmp) contains '*'.
+
+	if [ -f $src -o -d $src ]
+	then
+		:
+	else
+		echo "install:  $src does not exist"
+		exit 1
+	fi
+	
+	if [ x"$dst" = x ]
+	then
+		echo "install:	no destination specified"
+		exit 1
+	else
+		:
+	fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+	if [ -d $dst ]
+	then
+		dst="$dst"/`basename $src`
+	else
+		:
+	fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+#  this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+	'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+	pathcomp="${pathcomp}${1}"
+	shift
+
+	if [ ! -d "${pathcomp}" ] ;
+        then
+		$mkdirprog "${pathcomp}"
+	else
+		:
+	fi
+
+	pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+	$doit $instcmd $dst &&
+
+	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi &&
+	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi &&
+	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi &&
+	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+	if [ x"$transformarg" = x ] 
+	then
+		dstfile=`basename $dst`
+	else
+		dstfile=`basename $dst $transformbasename | 
+			sed $transformarg`$transformbasename
+	fi
+
+# don't allow the sed command to completely eliminate the filename
+
+	if [ x"$dstfile" = x ] 
+	then
+		dstfile=`basename $dst`
+	else
+		:
+	fi
+
+# Make a temp file name in the proper directory.
+
+	dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+	$doit $instcmd $src $dsttmp &&
+
+	trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing.  If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi &&
+	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi &&
+	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi &&
+	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi &&
+
+# Now rename the file to the real destination.
+
+	$doit $rmcmd -f $dstdir/$dstfile &&
+	$doit $mvcmd $dsttmp $dstdir/$dstfile 
+
+fi &&
+
+
+exit 0


Property changes on: trunk/install-sh
___________________________________________________________________
Name: svn:executable
   + *


Property changes on: trunk/setversion
___________________________________________________________________
Name: svn:executable
   + *