[27558] in Source-Commits

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

pyhesiodfs commit: New upstream release with incorporated patches

daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Tue Dec 31 12:27:31 2013

Date: Tue, 31 Dec 2013 12:27:22 -0500
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201312311727.rBVHRMTh027046@drugstore.mit.edu>
To: source-commits@MIT.EDU

https://github.com/mit-athena/pyhesiodfs/commit/63feb4ee62d39dd46d364ef6e259ed195d33d448
commit 63feb4ee62d39dd46d364ef6e259ed195d33d448
Author: Jonathan Reed <jdreed@mit.edu>
Date:   Thu Nov 14 14:26:34 2013 -0500

    New upstream release with incorporated patches
    
    As we are now becoming upstream for PyHesiodFS, which involves:
     - apply all our patches to pyHesiodFS.py
     - delete the patch files
     - punt the dependencies on quilt and patchutils in debian/control
     - punt the patchsys-quilt rule in debian/rules
     - instead of patching setup.py to change the script name, add some
       Python code to retain the old script name on OS X only
     - Add a debian/source/format file, since we didn't have one (force this
       to be source format 1.0 until we deal)

 debian/changelog                                   |    8 ++
 debian/control                                     |    2 +-
 debian/patches/catch-traceback-when-starting.patch |   18 ----
 .../patches/install-script-without-extension.patch |   12 ---
 debian/patches/no-hello.patch                      |   93 --------------------
 debian/patches/print-err-lockers.patch             |   31 -------
 debian/patches/series                              |    4 -
 debian/rules                                       |    1 -
 debian/source/format                               |    1 +
 pyHesiodFS.py                                      |   56 ++++---------
 setup.py                                           |    9 ++-
 11 files changed, 33 insertions(+), 202 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 0fd2c81..28a1a96 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+debathena-pyhesiodfs (1.0.1-0debathena1) unstable; urgency=low
+
+  * Re-factor all our existing patches into the mainline code, as we are
+    now becoming upstream
+  * setup.py retains the old script name (pyHesiodFS.py) on Mac OS X
+
+ -- Jonathan Reed <jdreed@mit.edu>  Thu, 24 Oct 2013 14:44:29 -0400
+
 debathena-pyhesiodfs (0.0.r167-0debathena12) unstable; urgency=low
 
   * Depend on fuse 2.8.5-2 in preference to fuse-utils, which no longer
diff --git a/debian/control b/debian/control
index 35093e1..5e52916 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: debathena-pyhesiodfs
 Section: debathena/net
 Priority: extra
 Maintainer: Debathena Project <debathena@mit.edu>
-Build-Depends: cdbs, debhelper, quilt, patchutils, config-package-dev, python-dev, python-support
+Build-Depends: cdbs, debhelper, config-package-dev, python-dev, python-support
 Standards-Version: 3.9.3
 
 Package: debathena-pyhesiodfs
diff --git a/debian/patches/catch-traceback-when-starting.patch b/debian/patches/catch-traceback-when-starting.patch
deleted file mode 100644
index 8cc52f0..0000000
--- a/debian/patches/catch-traceback-when-starting.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Index: pyhesiodfs/pyHesiodFS.py
-===================================================================
---- pyhesiodfs.orig/pyHesiodFS.py	2013-04-03 12:43:59.980979768 -0400
-+++ pyhesiodfs/pyHesiodFS.py	2013-04-03 12:46:09.498225631 -0400
-@@ -220,7 +220,12 @@
-             sys.argv.pop(1)
-         server = PyHesiodFS()
- 
--    server.main()
-+    try:
-+        server.main()
-+    except fuse.FuseError as fe:
-+        print >>sys.stderr, "An error occurred while starting PyHesiodFS:"
-+        print >>sys.stderr, fe
-+        sys.exit(1)
- 
- if __name__ == '__main__':
-     main()
diff --git a/debian/patches/install-script-without-extension.patch b/debian/patches/install-script-without-extension.patch
deleted file mode 100644
index 069b486..0000000
--- a/debian/patches/install-script-without-extension.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-Index: debathena-pyhesiodfs-0.0.r162/setup.py
-===================================================================
---- debathena-pyhesiodfs-0.0.r162.orig/setup.py	2008-12-22 13:53:01.000000000 -0500
-+++ debathena-pyhesiodfs-0.0.r162/setup.py	2008-12-22 14:18:33.000000000 -0500
-@@ -10,6 +10,6 @@
-       version='1.0',
-       author='Quentin Smith',
-       author_email='pyhesiodfs@mit.edu',
--      scripts=['pyHesiodFS.py'],
-+      scripts=['pyhesiodfs'],
-       requires=['PyHesiod (>=0.2.0)'],
-       **extra_options)
diff --git a/debian/patches/no-hello.patch b/debian/patches/no-hello.patch
deleted file mode 100644
index 2694a3d..0000000
--- a/debian/patches/no-hello.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-
-Index: debathena-pyhesiodfs-0.0.r162/pyHesiodFS.py
-===================================================================
---- debathena-pyhesiodfs-0.0.r162.orig/pyHesiodFS.py	2008-12-22 13:53:01.000000000 -0500
-+++ debathena-pyhesiodfs-0.0.r162/pyHesiodFS.py	2008-12-22 14:20:36.000000000 -0500
-@@ -69,13 +69,6 @@
- 
- fuse.fuse_python_api = (0, 2)
- 
--hello_path = '/README.txt'
--hello_str = """This is the pyhesiodfs FUSE autmounter. To access a Hesiod filsys, just access
--%(mountpoint)s/name.
--
--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
- 
-@@ -128,10 +121,6 @@
-         if path == '/':
-             st.st_mode = stat.S_IFDIR | 0777
-             st.st_nlink = 2
--        elif path == hello_path:
--            st.st_mode = stat.S_IFREG | 0444
--            st.st_nlink = 1
--            st.st_size = len(hello_str)
-         elif '/' not in path[1:]:
-             if path[1:] not in self.negcache and self.findLocker(path[1:]):
-                 st.st_mode = stat.S_IFLNK | 0777
-@@ -178,7 +167,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, zero) in self.getdir(path):
-@@ -187,27 +176,8 @@
-     def readlink(self, path):
-         return self.findLocker(path[1:])
- 
--    def open(self, path, flags):
--        if path != hello_path:
--            return -errno.ENOENT
--        accmode = os.O_RDONLY | os.O_WRONLY | os.O_RDWR
--        if (flags & accmode) != os.O_RDONLY:
--            return -errno.EACCES
--
--    def read(self, path, size, offset):
--        if path != hello_path:
--            return -errno.ENOENT
--        slen = len(hello_str)
--        if offset < slen:
--            if offset + size > slen:
--                size = slen - offset
--            buf = hello_str[offset:offset+size]
--        else:
--            buf = ''
--        return buf
--    
-     def symlink(self, src, path):
--        if path == '/' or path == hello_path:
-+        if path == '/':
-             return -errno.EPERM
-         elif '/' not in path[1:]:
-             self.mounts[self._user()][path[1:]] = src
-@@ -217,7 +187,7 @@
-             return -errno.EPERM
-     
-     def unlink(self, path):
--        if path == '/' or path == hello_path:
-+        if path == '/':
-             return -errno.EPERM
-         elif '/' not in path[1:]:
-             del self.mounts[self._user()][path[1:]]
-@@ -226,7 +196,6 @@
-             return -errno.EPERM
- 
- def main():
--    global hello_str
-     try:
-         usage = Fuse.fusage
-         server = PyHesiodFS(version="%prog " + fuse.__version__,
-@@ -242,7 +211,6 @@
-             sys.argv.pop(1)
-         server = PyHesiodFS()
- 
--    hello_str = hello_str % {'mountpoint': server.parse(errex=1).mountpoint}
-     server.main()
- 
- if __name__ == '__main__':
diff --git a/debian/patches/print-err-lockers.patch b/debian/patches/print-err-lockers.patch
deleted file mode 100644
index b9c1fd9..0000000
--- a/debian/patches/print-err-lockers.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-commit c4f208b4887f7d336561c10ce4ad7ca6f68dc515
-Author: Alex Dehnert <adehnert@mit.edu>
-Date:   Tue Jun 18 17:52:23 2013 -0400
-
-    Print ERR lockers
-
-diff --git a/debathena/debathena/pyhesiodfs/pyHesiodFS.py b/debathena/debathena/pyhesiodfs/pyHesiodFS.py
-index e48ebb1..2e21dba 100644
---- a/pyHesiodFS.py
-+++ b/pyHesiodFS.py
-@@ -165,13 +165,16 @@ class PyHesiodFS(Fuse):
-             if len(filsys.filsys) >= 1:
-                 pointers = filsys.filsys
-                 pointer = pointers[0]
--                if pointer['type'] != 'AFS' and pointer['type'] != 'LOC':
--                    syslog(LOG_NOTICE, "Unknown locker type "+pointer['type']+" for locker "+name+" ("+repr(pointer)+" )")
--                    return None
--                else:
-+                if pointer['type'] == 'AFS' or pointer['type'] == 'LOC':
-                     self.mounts[self._uid()][name] = pointer['location']
-                     syslog(LOG_INFO, "Mounting "+name+" on "+pointer['location'])
-                     return pointer['location']
-+                elif pointer['type'] == 'ERR':
-+                    syslog(LOG_NOTICE, "ERR for locker %s: %s" % (name, pointer['message'], ))
-+                    return None
-+                else:
-+                    syslog(LOG_NOTICE, "Unknown locker type "+pointer['type']+" for locker "+name+" ("+repr(pointer)+" )")
-+                    return None
-             else:
-                 syslog(LOG_WARNING, "Couldn't find filsys for "+name)
-                 return None
diff --git a/debian/patches/series b/debian/patches/series
deleted file mode 100644
index ad9233e..0000000
--- a/debian/patches/series
+++ /dev/null
@@ -1,4 +0,0 @@
-install-script-without-extension.patch
-no-hello.patch
-catch-traceback-when-starting.patch
-print-err-lockers.patch
diff --git a/debian/rules b/debian/rules
index 5bea56e..21f08bb 100755
--- a/debian/rules
+++ b/debian/rules
@@ -15,7 +15,6 @@ clean::
 	if [ -f pyhesiodfs ]; then mv pyhesiodfs pyHesiodFS.py; fi
 
 include /usr/share/cdbs/1/rules/debhelper.mk
-include /usr/share/cdbs/1/rules/patchsys-quilt.mk
 include /usr/share/cdbs/1/rules/config-package.mk
 include /usr/share/cdbs/1/class/python-distutils.mk
 
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..d3827e7
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+1.0
diff --git a/pyHesiodFS.py b/pyHesiodFS.py
index 01165be..b4f1e59 100644
--- a/pyHesiodFS.py
+++ b/pyHesiodFS.py
@@ -72,13 +72,6 @@ new_fuse = hasattr(fuse, '__version__')
 
 fuse.fuse_python_api = (0, 2)
 
-hello_path = '/README.txt'
-hello_str = """This is the pyhesiodfs FUSE autmounter. To access a Hesiod filsys, just access
-%(mountpoint)s/name.
-
-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
 
@@ -138,10 +131,6 @@ class PyHesiodFS(Fuse):
             st.st_mode = stat.S_IFDIR | 0755
             st.st_gid = self._gid()
             st.st_nlink = 2
-        elif path == hello_path:
-            st.st_mode = stat.S_IFREG | 0444
-            st.st_nlink = 1
-            st.st_size = len(hello_str)
         elif '/' not in path[1:]:
             if path[1:] not in self.negcache[self._uid()] and self.findLocker(path[1:]):
                 st.st_mode = stat.S_IFLNK | 0777
@@ -176,19 +165,22 @@ class PyHesiodFS(Fuse):
             if len(filsys.filsys) >= 1:
                 pointers = filsys.filsys
                 pointer = pointers[0]
-                if pointer['type'] != 'AFS' and pointer['type'] != 'LOC':
-                    syslog(LOG_NOTICE, "Unknown locker type "+pointer['type']+" for locker "+name+" ("+repr(pointer)+" )")
-                    return None
-                else:
+                if pointer['type'] == 'AFS' or pointer['type'] == 'LOC':
                     self.mounts[self._uid()][name] = pointer['location']
                     syslog(LOG_INFO, "Mounting "+name+" on "+pointer['location'])
                     return pointer['location']
+                elif pointer['type'] == 'ERR':
+                    syslog(LOG_NOTICE, "ERR for locker %s: %s" % (name, pointer['message'], ))
+                    return None
+                else:
+                    syslog(LOG_NOTICE, "Unknown locker type "+pointer['type']+" for locker "+name+" ("+repr(pointer)+" )")
+                    return None
             else:
                 syslog(LOG_WARNING, "Couldn't find filsys for "+name)
                 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, zero) in self.getdir(path):
@@ -197,27 +189,8 @@ class PyHesiodFS(Fuse):
     def readlink(self, path):
         return self.findLocker(path[1:])
 
-    def open(self, path, flags):
-        if path != hello_path:
-            return -errno.ENOENT
-        accmode = os.O_RDONLY | os.O_WRONLY | os.O_RDWR
-        if (flags & accmode) != os.O_RDONLY:
-            return -errno.EACCES
-
-    def read(self, path, size, offset):
-        if path != hello_path:
-            return -errno.ENOENT
-        slen = len(hello_str)
-        if offset < slen:
-            if offset + size > slen:
-                size = slen - offset
-            buf = hello_str[offset:offset+size]
-        else:
-            buf = ''
-        return buf
-    
     def symlink(self, src, path):
-        if path == '/' or path == hello_path:
+        if path == '/':
             return -errno.EPERM
         elif '/' not in path[1:]:
             self.mounts[self._uid()][path[1:]] = src
@@ -226,7 +199,7 @@ class PyHesiodFS(Fuse):
             return -errno.EPERM
     
     def unlink(self, path):
-        if path == '/' or path == hello_path:
+        if path == '/':
             return -errno.EPERM
         elif '/' not in path[1:]:
             del self.mounts[self._uid()][path[1:]]
@@ -235,7 +208,6 @@ class PyHesiodFS(Fuse):
             return -errno.EPERM
 
 def main():
-    global hello_str
     try:
         usage = Fuse.fusage
         server = PyHesiodFS(version="%prog " + fuse.__version__,
@@ -251,8 +223,12 @@ pyHesiodFS [mountpath] [options]
             sys.argv.pop(1)
         server = PyHesiodFS()
 
-    hello_str = hello_str % {'mountpoint': server.parse(errex=1).mountpoint}
-    server.main()
+    try:
+        server.main()
+    except fuse.FuseError as fe:
+        print >>sys.stderr, "An error occurred while starting PyHesiodFS:"
+        print >>sys.stderr, fe
+        sys.exit(1)
 
 if __name__ == '__main__':
     main()
diff --git a/setup.py b/setup.py
index d13e355..4885939 100644
--- a/setup.py
+++ b/setup.py
@@ -3,13 +3,18 @@ import sys
 
 extra_options = {}
 
+# The script is named this on all platforms except OS X
+script_name='pyhesiodfs'
 if sys.platform == 'darwin':
     extra_options['data_files'] = [('/Library/LaunchDaemons', ('edu.mit.sipb.mit-automounter.plist',))]
+    script_name='pyHesiodFS.py
 
 setup(name='pyHesiodFS',
-      version='1.0',
+      version='1.0.1',
       author='Quentin Smith',
       author_email='pyhesiodfs@mit.edu',
-      scripts=['pyHesiodFS.py'],
+      maintainer='Debathena Project',
+      maintainer_email='debathena@mit.edu',
+      scripts=[script_name],
       requires=['PyHesiod (>=0.2.0)'],
       **extra_options)

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