]> Pileus Git - ~andy/fetchmail/commitdiff
Rename fetchmailconf to fetchmailconf.py.
authorMatthias Andree <matthias.andree@gmx.de>
Tue, 2 Aug 2005 01:20:23 +0000 (01:20 -0000)
committerMatthias Andree <matthias.andree@gmx.de>
Tue, 2 Aug 2005 01:20:23 +0000 (01:20 -0000)
Add a shell wrapper script fetchmailconf (with @PYTHON@ substituted).
Use automake's PYTHON mode to byte-compile the script at install time.

svn path=/trunk/; revision=4220

Makefile.am
configure.ac
fetchmailconf.in [new file with mode: 0644]
fetchmailconf.py [moved from fetchmailconf with 99% similarity]

index 629858647d2c5fe5571cbba31981cf98d42f3353..7d969b3b2fb1a5a150e46f9ba0aabb63e9ff1d50 100644 (file)
@@ -7,10 +7,11 @@ AM_CPPFLAGS=          @CPFLAGS@
 AM_LDFLAGS=            @LDEFLAGS@
 ACLOCAL_AMFLAGS=       -I m4 -I m4-local
 AM_YFLAGS=             -d
-BUILT_SOURCES=         rcfile_y.h
+BUILT_SOURCES=         rcfile_y.h fetchmailconf
 
 bin_PROGRAMS=          fetchmail
-dist_bin_SCRIPTS=      fetchmailconf
+nodist_bin_SCRIPTS=    fetchmailconf
+python_PYTHON=         fetchmailconf.py
 dist_noinst_SCRIPTS=   specgen.sh
 dist_man1_MANS=                fetchmail.man fetchmailconf.man
 
index 74736db5e6b0bef940e0851a84033ad55499ad79..34aeadbb4df28986593809f3b6a5adcc9afb4f53 100644 (file)
@@ -13,6 +13,9 @@ dnl we may need a newer automake version - the oldest tested is 1.7
 AC_PREREQ(2.59)
 AM_INIT_AUTOMAKE(1.5 foreign no-installinfo)
 
+dnl the : states that python is optional
+AM_PATH_PYTHON(2.0,,:)
+
 AC_PROG_AWK
 AC_PROG_CC
 AC_PROG_INSTALL
@@ -736,7 +739,7 @@ if test "$needtrio" = 1 ; then
 fi
 dnl ----------------------------------------------------------------'
 
-AC_CONFIG_FILES([Makefile m4/Makefile
+AC_CONFIG_FILES([Makefile m4/Makefile fetchmailconf
                 po/Makefile.in])
 AC_OUTPUT
 
diff --git a/fetchmailconf.in b/fetchmailconf.in
new file mode 100644 (file)
index 0000000..79aa092
--- /dev/null
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+exec @PYTHON@ fetchmailconf.py "$@"
similarity index 99%
rename from fetchmailconf
rename to fetchmailconf.py
index 4a0140363feb8c2c9a93879d42a327fae496801c..ce493627e1df0d6100b179fde5b27dcab10a1133 100755 (executable)
@@ -5,7 +5,7 @@
 # Matthias Andree <matthias.andree@gmx.de>
 # Requires Python with Tkinter, and the following OS-dependent services:
 #      posix, posixpath, socket
-version = "1.44"
+version = "1.46"
 
 from Tkinter import *
 from Dialog import *
@@ -2016,13 +2016,20 @@ gUSiYASJpMEHhilJTEnhAlGoQqYAZQ1AiqEMZ0jDGtqQImhwwA13yMMevoQAGvGhEAWHGMOAAAA7
 #
 
     # Process options
-    (options, arguments) = getopt.getopt(sys.argv[1:], "df:")
+    (options, arguments) = getopt.getopt(sys.argv[1:], "df:h")
     dump = rcfile = None;
     for (switch, val) in options:
        if (switch == '-d'):
            dump = TRUE
        elif (switch == '-f'):
            rcfile = val
+       elif (switch == '-h'):
+           print """
+Usage: fetchmailconf [-d] [-f fetchmailrc]
+-d       - dump configuration (for debugging)
+-f fmrc  - read alternate fetchmailrc file
+"""
+           sys.exit(0)
 
     # Get client host's FQDN
     hostname = socket.gethostbyaddr(socket.gethostname())[0]