[23506] in Source-Commits

home help back first fref pref prev next nref lref last post

/svn/athena r23151 - in trunk/debathena/debathena/debathena-pyhesiodfs: . debian debian/patches

daemon@ATHENA.MIT.EDU (broder@MIT.EDU)
Wed Aug 20 01:31:54 2008

Date: Wed, 20 Aug 2008 01:31:19 -0400 (EDT)
From: broder@MIT.EDU
Message-Id: <200808200531.BAA11522@drugstore.mit.edu>
To: source-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: broder
Date: 2008-08-20 01:31:19 -0400 (Wed, 20 Aug 2008)
New Revision: 23151

Added:
   trunk/debathena/debathena/debathena-pyhesiodfs/AUTHORS
   trunk/debathena/debathena/debathena-pyhesiodfs/MANIFEST.in
Removed:
   trunk/debathena/debathena/debathena-pyhesiodfs/copyright
   trunk/debathena/debathena/debathena-pyhesiodfs/debian/patches/crazy-cross-api-version-compat.patch
   trunk/debathena/debathena/debathena-pyhesiodfs/debian/patches/dont-use-mac-only-options.patch
   trunk/debathena/debathena/debathena-pyhesiodfs/debian/patches/no-os-x-launchdaemon.patch
   trunk/debathena/debathena/debathena-pyhesiodfs/hesiod.py
Modified:
   trunk/debathena/debathena/debathena-pyhesiodfs/debian/changelog
   trunk/debathena/debathena/debathena-pyhesiodfs/debian/control
   trunk/debathena/debathena/debathena-pyhesiodfs/debian/debathena-pyhesiodfs.init
   trunk/debathena/debathena/debathena-pyhesiodfs/debian/debathena-pyhesiodfs.postinst
   trunk/debathena/debathena/debathena-pyhesiodfs/debian/debathena-pyhesiodfs.preinst
   trunk/debathena/debathena/debathena-pyhesiodfs/debian/patches/install-script-without-extension.patch
   trunk/debathena/debathena/debathena-pyhesiodfs/debian/patches/no-hello.patch
   trunk/debathena/debathena/debathena-pyhesiodfs/debian/patches/series
   trunk/debathena/debathena/debathena-pyhesiodfs/debian/rules
   trunk/debathena/debathena/debathena-pyhesiodfs/pyHesiodFS.py
   trunk/debathena/debathena/debathena-pyhesiodfs/setup.py
Log:
Update pyhesiodfs to new version using python-hesiod


Added: trunk/debathena/debathena/debathena-pyhesiodfs/AUTHORS

Added: trunk/debathena/debathena/debathena-pyhesiodfs/MANIFEST.in

Deleted: trunk/debathena/debathena/debathena-pyhesiodfs/copyright

Modified: trunk/debathena/debathena/debathena-pyhesiodfs/debian/changelog
===================================================================
--- trunk/debathena/debathena/debathena-pyhesiodfs/debian/changelog	2008-08-20 05:29:11 UTC (rev 23150)
+++ trunk/debathena/debathena/debathena-pyhesiodfs/debian/changelog	2008-08-20 05:31:19 UTC (rev 23151)
@@ -1,3 +1,16 @@
+debathena-pyhesiodfs (0.0.r150-0debathena1) unstable; urgency=low
+
+  * New upstream version
+  * Use PyHesiod bindings
+  * Remove the initscript for debathena-afuse-automounter on install
+  * Check properly if the package is still installed in the initscript
+  * Fix condition where fuse group might not exist when package is
+    installed
+  * Ensure permissions for /mit are correct in the initscript
+  * Don't fail to stop if the automounter is not currently running
+
+ -- Evan Broder <evan@remus.mit.edu>  Sun, 10 Aug 2008 18:49:30 -0400
+
 debathena-pyhesiodfs (0.0.r77-0debathena1) unstable; urgency=low
 
   * Initial release

Modified: trunk/debathena/debathena/debathena-pyhesiodfs/debian/control
===================================================================
--- trunk/debathena/debathena/debathena-pyhesiodfs/debian/control	2008-08-20 05:29:11 UTC (rev 23150)
+++ trunk/debathena/debathena/debathena-pyhesiodfs/debian/control	2008-08-20 05:31:19 UTC (rev 23151)
@@ -7,10 +7,10 @@
 
 Package: debathena-pyhesiodfs
 Architecture: all
-Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, python-fuse, python-dns, debathena-afs-config, debathena-hesiod-config, adduser, fuse-utils
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, python-fuse, python-hesiod, debathena-afs-config, debathena-hesiod-config, adduser, fuse-utils, lsb-base (>= 3.0-6)
 Provides: ${python:Provides}
 Conflicts: debathena-afuse-automounter, debathena-autofs-config
 Replaces: debathena-afuse-automounter, debathena-autofs-config
-Description: Hesiod automounter for Athena lockers using pyFUSE
+Description: Hesiod automounter for Athena lockers
  This package includes a FUSE filesystem to automatically mount Athena
  lockers using the Hesiod directory information.

Modified: trunk/debathena/debathena/debathena-pyhesiodfs/debian/debathena-pyhesiodfs.init
===================================================================
--- trunk/debathena/debathena/debathena-pyhesiodfs/debian/debathena-pyhesiodfs.init	2008-08-20 05:29:11 UTC (rev 23150)
+++ trunk/debathena/debathena/debathena-pyhesiodfs/debian/debathena-pyhesiodfs.init	2008-08-20 05:31:19 UTC (rev 23151)
@@ -1,70 +1,130 @@
-#! /bin/sh -e
+#! /bin/sh
 ### BEGIN INIT INFO
-# Provides:             debathena-pyhesiodfs
-# Required-Start:	openafs-client
-# Required-Stop:        openafs-client
-# Should-Start:         $local_fs $network
-# Default-Start:	2 3 4 5
-# Default-Stop:         0 1 6
-# Short-Description:    Debathena automounter using pyFUSE
-# Description:          Auto-creates symlinks from /mit/LOCKER to AFS using Hesiod lookups.
+# Provides:          debathena-pyhesiodfs
+# Required-Start:    openafs-client
+# Required-Stop:     openafs-client
+# Should-Start:      $local_fs $network
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Hesiod automounter for Athena lockers
+# Description:       Auto-create symlinks from /mit/LOCKER to AFS using Hesiod lookups.
 ### END INIT INFO
 
-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin/:/usr/sbin:/usr/bin
-DAEMON="/usr/bin/pyhesiodfs"
+# Author: Evan Broder <broder@mit.edu>, Geoffrey Thomas <geofft@mit.edu>
+
+# Do NOT "set -e"
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="Debathena /mit automounter"
 NAME=debathena-pyhesiodfs
+DAEMON=/usr/bin/pyhesiodfs
 pyhesiodfs_dir="/mit"
+DAEMON_ARGS="-f $pyhesiodfs_dir"
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
 
-if [ -f /etc/default/pyhesiodfs ]; then
-  . /etc/default/pyhesiodfs
-fi
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
 
-# If the hesiod module hasn't been installed yet, this will fail and cause the
-# installation to fail, too. So fail silently instead
-if ! python -m hesiod >/dev/null 2>/dev/null
-then
-    exit 0
-fi
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
 
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
+. /lib/lsb/init-functions
+
+#
+# Function that starts the daemon/service
+#
+do_start()
+{
+    # Return
+    #   0 if daemon has been started
+    #   1 if daemon was already running
+    #   2 if daemon could not be started
+    
+    # Try to make sure fuse is setup
+    [ -e /dev/fuse ] || modprobe fuse || return 2
+    
+    if cat /proc/mounts | grep " $pyhesiodfs_dir " >/dev/null 2>&1; then
+	return 1
+    fi
+    
+    mkdir -p "$pyhesiodfs_dir"
+    chown root:pyhesiodfs "$pyhesiodfs_dir"
+    chmod 770 "$pyhesiodfs_dir"
+    
+    start-stop-daemon --start --quiet --pidfile $PIDFILE \
+        --chuid pyhesiodfs:pyhesiodfs --background \
+        --make-pidfile \
+	--exec $DAEMON -- \
+        $DAEMON_ARGS \
+        || return 2
+}
+
+#
+# Function that stops the daemon/service
+#
+do_stop()
+{
+    # Return
+    #   0 if daemon has been stopped
+    #   1 if daemon was already stopped
+    #   2 if daemon could not be stopped
+    #   other if a failure occurred
+    
+    if cat /proc/mounts | grep " $pyhesiodfs_dir " >/dev/null 2>&1; then
+        umount -l "$pyhesiodfs_dir" || return 2
+        # Many daemons don't delete their pidfiles when they exit.
+	rm -f "$PIDFILE"
+    else
+	return 1
+    fi
+}
+
 case "$1" in
-  start)
-	if start-stop-daemon --test --start --quiet \
-	    --pidfile "/var/run/$NAME.pid" \
-	    --startas "$DAEMON" -- -f "$pyhesiodfs_dir"
-	then
-	    modprobe fuse
-	    mkdir -p "$pyhesiodfs_dir"
-	    chgrp pyhesiodfs "$pyhesiodfs_dir"
-	    chmod g+w "$pyhesiodfs_dir"
-	    echo -n "Starting $DESC: "
-	    start-stop-daemon --oknodo --start --quiet \
-		--pidfile "/var/run/$NAME.pid" \
-		--chuid pyhesiodfs:pyhesiodfs --background \
-		--make-pidfile --startas "$DAEMON" -- -f "$pyhesiodfs_dir"
-	    echo "$NAME."
-	fi
-	;;
-  stop)
-	echo -n "Stopping $DESC: "
-	if start-stop-daemon --test --stop --quiet --pidfile "/var/run/$NAME.pid"
-	then
-	    fusermount -u "$pyhesiodfs_dir"
-	    echo "$NAME"
-	else
-	    echo "automounter for $pyhesiodfs_dir not running." >&2
-	fi
-	rm -f "/var/run/$NAME.pid"
-	;;
-  force-reload|restart)
-	"$0" stop
-	"$0" start
-	;;
-  *)
-	N=/"etc/init.d/$NAME"
-	# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
-	echo "Usage: $N {start|stop|restart|force-reload}" >&2
-	exit 1
-	;;
+    start)
+        [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+        do_start
+        case "$?" in
+            0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+            2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+        esac
+        ;;
+    stop)
+        [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+        do_stop
+        case "$?" in
+            0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+            2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+        esac
+        ;;
+    restart|force-reload)
+        log_daemon_msg "Restarting $DESC" "$NAME"
+        do_stop
+        case "$?" in
+            0|1)
+                do_start
+                case "$?" in
+                    0) log_end_msg 0 ;;
+                    1) log_end_msg 1 ;; # Old process is still running
+                    *) log_end_msg 1 ;; # Failed to start
+                esac
+                ;;
+            *)
+                # Failed to stop
+                log_end_msg 1
+                ;;
+        esac
+        ;;
+    *)
+        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+        exit 3
+        ;;
 esac
 
-exit 0
+:

Modified: trunk/debathena/debathena/debathena-pyhesiodfs/debian/debathena-pyhesiodfs.postinst
===================================================================
--- trunk/debathena/debathena/debathena-pyhesiodfs/debian/debathena-pyhesiodfs.postinst	2008-08-20 05:29:11 UTC (rev 23150)
+++ trunk/debathena/debathena/debathena-pyhesiodfs/debian/debathena-pyhesiodfs.postinst	2008-08-20 05:31:19 UTC (rev 23151)
@@ -25,11 +25,14 @@
 
 case "$1" in
     configure)
+        adduser pyhesiodfs fuse
+        
 	if hash invoke-rc.d 2>/dev/null; then
 	    invoke-rc.d debathena-pyhesiodfs restart
 	else
 	    /etc/init.d/debathena-pyhesiodfs restart
 	fi
+        update-rc.d -f debathena-afuse-automounter remove >/dev/null || :
     ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)

Modified: trunk/debathena/debathena/debathena-pyhesiodfs/debian/debathena-pyhesiodfs.preinst
===================================================================
--- trunk/debathena/debathena/debathena-pyhesiodfs/debian/debathena-pyhesiodfs.preinst	2008-08-20 05:29:11 UTC (rev 23150)
+++ trunk/debathena/debathena/debathena-pyhesiodfs/debian/debathena-pyhesiodfs.preinst	2008-08-20 05:31:19 UTC (rev 23151)
@@ -19,7 +19,6 @@
 	if ! getent passwd pyhesiodfs >/dev/null; then
 	    adduser --system --no-create-home --group pyhesiodfs
 	fi
-	adduser pyhesiodfs fuse
 	;;
     
     abort-upgrade)

Deleted: trunk/debathena/debathena/debathena-pyhesiodfs/debian/patches/crazy-cross-api-version-compat.patch

Deleted: trunk/debathena/debathena/debathena-pyhesiodfs/debian/patches/dont-use-mac-only-options.patch

Modified: trunk/debathena/debathena/debathena-pyhesiodfs/debian/patches/install-script-without-extension.patch
===================================================================
--- trunk/debathena/debathena/debathena-pyhesiodfs/debian/patches/install-script-without-extension.patch	2008-08-20 05:29:11 UTC (rev 23150)
+++ trunk/debathena/debathena/debathena-pyhesiodfs/debian/patches/install-script-without-extension.patch	2008-08-20 05:31:19 UTC (rev 23151)
@@ -1,11 +1,11 @@
-Index: debathena-pyhesiodfs-0.0.r77/setup.py
+Index: debathena-pyhesiodfs/setup.py
 ===================================================================
---- debathena-pyhesiodfs-0.0.r77.orig/setup.py	2008-07-11 13:23:58.000000000 -0400
-+++ debathena-pyhesiodfs-0.0.r77/setup.py	2008-07-11 13:24:08.000000000 -0400
-@@ -4,5 +4,5 @@
+--- debathena-pyhesiodfs.orig/setup.py
++++ debathena-pyhesiodfs/setup.py	
+@@ -11,5 +11,5 @@
        author='Quentin Smith',
        author_email='pyhesiodfs@mit.edu',
-       py_modules=['hesiod'],
 -      scripts=['pyHesiodFS.py'],
 +      scripts=['pyhesiodfs'],
-       )
+       requires=['PyHesiod (>=0.2.0)'],
+       **extra_options)

Modified: trunk/debathena/debathena/debathena-pyhesiodfs/debian/patches/no-hello.patch
===================================================================
--- trunk/debathena/debathena/debathena-pyhesiodfs/debian/patches/no-hello.patch	2008-08-20 05:29:11 UTC (rev 23150)
+++ trunk/debathena/debathena/debathena-pyhesiodfs/debian/patches/no-hello.patch	2008-08-20 05:31:19 UTC (rev 23151)
@@ -1,8 +1,9 @@
-Index: debathena-pyhesiodfs-0.0.r77/pyHesiodFS.py
+
+Index: debathena-pyhesiodfs/pyHesiodFS.py
 ===================================================================
---- debathena-pyhesiodfs-0.0.r77.orig/pyHesiodFS.py	2008-07-10 21:32:21.000000000 -0400
-+++ debathena-pyhesiodfs-0.0.r77/pyHesiodFS.py	2008-07-10 21:38:44.000000000 -0400
-@@ -21,13 +21,6 @@
+--- debathena-pyhesiodfs.orig/pyHesiodFS.py
++++ debathena-pyhesiodfs/pyHesiodFS.py	
+@@ -19,13 +19,6 @@
  
  fuse.fuse_python_api = (0, 2)
  
@@ -13,10 +14,10 @@
 -If you're using the Finder, try pressing Cmd+Shift+G and then entering
 -%(mountpoint)s/name"""
 -
- class MyStat(fuse.Stat):
-     def __init__(self):
-         self.st_mode = 0
-@@ -54,10 +47,6 @@
+ if not hasattr(fuse, 'Stat'):
+     fuse.Stat = object
+ 
+@@ -68,10 +61,6 @@
          if path == '/':
              st.st_mode = stat.S_IFDIR | 0755
              st.st_nlink = 2
@@ -27,14 +28,16 @@
          elif '/' not in path[1:]:
              if self.findLocker(path[1:]):
                  st.st_mode = stat.S_IFLNK | 0777
-@@ -94,33 +83,13 @@
+@@ -111,7 +100,7 @@
                  return None
  
+     def getdir(self, path):
+-        return [(i, 0) for i in (['.', '..', hello_path[1:]] + self.getCachedLockers())]
++        return [(i, 0) for i in (['.', '..'] + self.getCachedLockers())]
+ 
      def readdir(self, path, offset):
--        for r in  ['.', '..', hello_path[1:]]+self.getCachedLockers():
-+        for r in  ['.', '..']+self.getCachedLockers():
-             yield fuse.Direntry(r)
-             
+         for (r, zero) in self.getdir(path):
+@@ -120,27 +109,7 @@
      def readlink(self, path):
          return self.findLocker(path[1:])
  
@@ -59,13 +62,13 @@
 -
  def main():
 -    global hello_str
-     usage="""
- pyHesiodFS
+     try:
+         usage = Fuse.fusage
+         server = PyHesiodFS(version="%prog " + fuse.__version__,
+@@ -156,7 +125,6 @@
+             sys.argv.pop(1)
+         server = PyHesiodFS()
  
-@@ -130,7 +99,6 @@
-                      dash_s_do='setsingle')
- 
-     server.parse(errex=1)
 -    hello_str = hello_str % {'mountpoint': server.parse(errex=1).mountpoint}
      server.main()
  

Deleted: trunk/debathena/debathena/debathena-pyhesiodfs/debian/patches/no-os-x-launchdaemon.patch

Modified: trunk/debathena/debathena/debathena-pyhesiodfs/debian/patches/series
===================================================================
--- trunk/debathena/debathena/debathena-pyhesiodfs/debian/patches/series	2008-08-20 05:29:11 UTC (rev 23150)
+++ trunk/debathena/debathena/debathena-pyhesiodfs/debian/patches/series	2008-08-20 05:31:19 UTC (rev 23151)
@@ -1,5 +1,2 @@
-no-os-x-launchdaemon.patch
 install-script-without-extension.patch
-dont-use-mac-only-options.patch
 no-hello.patch
-crazy-cross-api-version-compat.patch

Modified: trunk/debathena/debathena/debathena-pyhesiodfs/debian/rules
===================================================================
--- trunk/debathena/debathena/debathena-pyhesiodfs/debian/rules	2008-08-20 05:29:11 UTC (rev 23150)
+++ trunk/debathena/debathena/debathena-pyhesiodfs/debian/rules	2008-08-20 05:31:19 UTC (rev 23151)
@@ -5,6 +5,10 @@
 	/etc/fuse.conf.debathena
 DEB_PYTHON_SYSTEM=pysupport
 
+ifneq ($(shell grep RESTART_AFTER_UPGRADE /usr/bin/dh_installinit),)
+	DEB_DH_INSTALLINIT_ARGS += --restart-after-upgrade
+endif
+
 clean::
 	if [ -f pyhesiodfs ]; then mv pyhesiodfs pyHesiodFS.py; fi
 

Deleted: trunk/debathena/debathena/debathena-pyhesiodfs/hesiod.py

Modified: trunk/debathena/debathena/debathena-pyhesiodfs/pyHesiodFS.py
===================================================================
--- trunk/debathena/debathena/debathena-pyhesiodfs/pyHesiodFS.py	2008-08-20 05:29:11 UTC (rev 23150)
+++ trunk/debathena/debathena/debathena-pyhesiodfs/pyHesiodFS.py	2008-08-20 05:31:19 UTC (rev 23151)
@@ -15,9 +15,7 @@
 
 import hesiod
 
-if not hasattr(fuse, '__version__'):
-    raise RuntimeError, \
-        "your fuse-py doesn't know of fuse.__version__, probably it's too old."
+new_fuse = hasattr(fuse, '__version__')
 
 fuse.fuse_python_api = (0, 2)
 
@@ -28,6 +26,9 @@
 If you're using the Finder, try pressing Cmd+Shift+G and then entering
 %(mountpoint)s/name"""
 
+if not hasattr(fuse, 'Stat'):
+    fuse.Stat = object
+
 class MyStat(fuse.Stat):
     def __init__(self):
         self.st_mode = 0
@@ -41,15 +42,25 @@
         self.st_mtime = 0
         self.st_ctime = 0
 
+    def toTuple(self):
+        return (self.st_mode, self.st_ino, self.st_dev, self.st_nlink,
+                self.st_uid, self.st_gid, self.st_size, self.st_atime,
+                self.st_mtime, self.st_ctime)
+
 class PyHesiodFS(Fuse):
 
     def __init__(self, *args, **kwargs):
         Fuse.__init__(self, *args, **kwargs)
-        self.fuse_args.add("allow_other", True)
-        self.fuse_args.add("noappledouble", True)
-        self.fuse_args.add("noapplexattr", True)
-        self.fuse_args.add("fsname", "pyHesiodFS")
-        self.fuse_args.add("volname", "MIT")
+        try:
+            self.fuse_args.add("allow_other", True)
+        except AttributeError:
+            self.allow_other = 1
+
+        if sys.platform == 'darwin':
+            self.fuse_args.add("noappledouble", True)
+            self.fuse_args.add("noapplexattr", True)
+            self.fuse_args.add("volname", "MIT")
+            self.fuse_args.add("fsname", "pyHesiodFS")
         self.mounts = {}
     
     def getattr(self, path):
@@ -70,7 +81,10 @@
                 return -errno.ENOENT
         else:
             return -errno.ENOENT
-        return st
+        if new_fuse:
+            return st
+        else:
+            return st.toTuple()
 
     def getCachedLockers(self):
         return self.mounts.keys()
@@ -80,10 +94,16 @@
         if name in self.mounts:
             return self.mounts[name]
         else:
-            filsys = hesiod.FilsysLookup(name)
+            try:
+                filsys = hesiod.FilsysLookup(name)
+            except IOError, e:
+                if e.errno in (errno.ENOENT, errno.EMSGSIZE):
+                    raise IOError(errno.ENOENT, os.strerror(errno.ENOENT))
+                else:
+                    raise IOError(errno.EIO, os.strerror(errno.EIO))
             # FIXME check if the first locker is valid
-            if len(filsys.getFilsys()) >= 1:
-                pointers = filsys.getFilsys()
+            if len(filsys.filsys) >= 1:
+                pointers = filsys.filsys
                 pointer = pointers[0]
                 if pointer['type'] != 'AFS' and pointer['type'] != 'LOC':
                     print >>sys.stderr, "Unknown locker type "+pointer.type+" for locker "+name+" ("+repr(pointer)+" )"
@@ -96,8 +116,11 @@
                 print >>sys.stderr, "Couldn't find filsys for "+name
                 return None
 
+    def getdir(self, path):
+        return [(i, 0) for i in (['.', '..', hello_path[1:]] + self.getCachedLockers())]
+
     def readdir(self, path, offset):
-        for r in  ['.', '..', hello_path[1:]]+self.getCachedLockers():
+        for (r, zero) in self.getdir(path):
             yield fuse.Direntry(r)
             
     def readlink(self, path):
@@ -124,15 +147,21 @@
 
 def main():
     global hello_str
-    usage="""
-pyHesiodFS
+    try:
+        usage = Fuse.fusage
+        server = PyHesiodFS(version="%prog " + fuse.__version__,
+                            usage=usage,
+                            dash_s_do='setsingle')
+        server.parse(errex=1)
+    except AttributeError:
+        usage="""
+pyHesiodFS [mountpath] [options]
 
-""" + Fuse.fusage
-    server = PyHesiodFS(version="%prog " + fuse.__version__,
-                     usage=usage,
-                     dash_s_do='setsingle')
+"""
+        if sys.argv[1] == '-f':
+            sys.argv.pop(1)
+        server = PyHesiodFS()
 
-    server.parse(errex=1)
     hello_str = hello_str % {'mountpoint': server.parse(errex=1).mountpoint}
     server.main()
 

Modified: trunk/debathena/debathena/debathena-pyhesiodfs/setup.py
===================================================================
--- trunk/debathena/debathena/debathena-pyhesiodfs/setup.py	2008-08-20 05:29:11 UTC (rev 23150)
+++ trunk/debathena/debathena/debathena-pyhesiodfs/setup.py	2008-08-20 05:31:19 UTC (rev 23151)
@@ -1,8 +1,15 @@
 from distutils.core import setup
+import sys
+
+extra_options = {}
+
+if sys.platform == 'darwin':
+    extra_options['data_files'] = [('/Library/LaunchDaemons', ('edu.mit.sipb.mit-automounter.plist',))]
+
 setup(name='pyHesiodFS',
       version='1.0',
       author='Quentin Smith',
       author_email='pyhesiodfs@mit.edu',
-      py_modules=['hesiod'],
       scripts=['pyHesiodFS.py'],
-      data_files=[('/Library/LaunchDaemons', ('edu.mit.sipb.mit-automounter.plist',))])
+      requires=['PyHesiod (>=0.2.0)'],
+      **extra_options)


home help back first fref pref prev next nref lref last post