diffs for packmail.py to fix problems with '.' and '..'

lance@fox.com
Tue, 28 Jun 94 12:56:33 PDT

packmail.py as it currently is distributed does not work when
using packtree() and packall() and packnotolder(). The problem is that
os.listdir() returns '.' and '..'. This patch fixes this.

*** packmail.py~ Wed Dec 29 07:28:55 1993
--- packmail.py Tue Jun 28 12:50:17 1994
***************
*** 41,52 ****
--- 41,68 ----
# Pack all files from a directory
def packall(outfp, dirname):
names = os.listdir(dirname)
+ try:
+ names.remove('.')
+ except:
+ pass
+ try:
+ names.remove('..')
+ except:
+ pass
names.sort()
packsome(outfp, dirname, names)

# Pack all files from a directory that are not older than a give one
def packnotolder(outfp, dirname, oldest):
names = os.listdir(dirname)
+ try:
+ names.remove('.')
+ except:
+ pass
+ try:
+ names.remove('..')
+ except:
+ pass
oldest = os.path.join(dirname, oldest)
st = os.stat(oldest)
mtime = st[ST_MTIME]
***************
*** 67,72 ****
--- 83,96 ----
print 'packtree', dirname
outfp.write('mkdir ' + unixfix(dirname) + '\n')
names = os.listdir(dirname)
+ try:
+ names.remove('.')
+ except:
+ pass
+ try:
+ names.remove('..')
+ except:
+ pass
subdirs = []
for name in names:
fullname = os.path.join(dirname, name)

--
Lance Ellinghouse                lance@fox.com