Index: trunk/locker-bin/macathenaDist.py =================================================================== --- trunk/locker-bin/macathenaDist.py (revision 46) +++ trunk/locker-bin/macathenaDist.py (revision 59) @@ -1,4 +1,5 @@ #!/usr/bin/env python +import gzip import tarfile import os @@ -8,4 +9,20 @@ mtime = 0 + +def _write_gzip_header(self): + self.fileobj.write('\037\213') # magic header + self.fileobj.write('\010') # compression method + fname = self.filename[:-3] + flags = 0 + if fname: + flags = gzip.FNAME + self.fileobj.write(chr(flags)) + gzip.write32u(self.fileobj, long(mtime)) + self.fileobj.write('\002') + self.fileobj.write('\377') + if fname: + self.fileobj.write(fname + '\000') + +gzip.GzipFile._write_gzip_header = _write_gzip_header class MyTarFile(tarfile.TarFile): @@ -21,15 +38,16 @@ return info -def packageSvn(module, svnModule, extras=[], svnroot='/afs/dev.mit.edu/source/svn-repos', revision='HEAD'): +def packageSvn(module, svnModule, extras=[], svnroot='file:///afs/dev.mit.edu/source/svn-repos', revision='HEAD'): os.system('attach macathena >/dev/null 2>/dev/null') os.chdir('/mit/macathena/build') - os.system('svn export -r %s file://%s/%s %s >/dev/null 2>&1' % (revision, svnroot, svnModule, module)) + os.system('svn export -r %s %s/%s %s >/dev/null 2>&1' % (revision, svnroot, svnModule, module)) - for extra in extras: - os.system('svn export -r %s file://%s/%s >/dev/null 2>&1' % (revision, svnroot, extra)) - os.system('mv %s %s' % (basename(extra), module)) + if extras: + for extra in extras: + os.system('svn export -r %s %s/%s >/dev/null 2>&1' % (revision, svnroot, extra)) + os.system('mv %s %s' % (basename(extra), module)) - version_info = os.popen('svn info -r %s file://%s/%s' % (revision, svnroot, svnModule)).readlines() + version_info = os.popen('svn info -r %s %s/%s' % (revision, svnroot, svnModule)).readlines() for line in version_info: if line.startswith('Last Changed Date: '): @@ -40,5 +58,5 @@ mtime = int(time.strftime("%s", time.strptime(time_string, "%Y-%m-%d %H:%M:%S"))) - tarball = "%s-%s" % (module, revision) + tarball = "%s-svn%s" % (module, revision) os.rename(module, tarball) @@ -92,5 +110,10 @@ 'libxj': ['trunk/athena/lib/Xj'], 'xcluster': ['trunk/athena/bin/xcluster', ['attic/packs/build/aclocal.m4']], - 'discuss': ['trunk/athena/bin/discuss']} + 'discuss': ['trunk/athena/bin/discuss'], +# Our packages: + 'add': ['trunk/source/add', False, 'https://macathena.mit.edu/svn'], + 'attach': ['trunk/source/attach', False, 'https://macathena.mit.edu/svn'], + 'pyhesiodfs': ['trunk/source/pyhesiodfs', False, 'https://macathena.mit.edu/svn'] +} if __name__ == '__main__':