- Timestamp:
- 01/25/08 02:58:12 (17 years ago)
- Files:
-
- trunk/locker-bin/macathenaDist.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/locker-bin/macathenaDist.py
r46 r59 1 1 #!/usr/bin/env python 2 2 3 import gzip 3 4 import tarfile 4 5 import os … … 8 9 9 10 mtime = 0 11 12 def _write_gzip_header(self): 13 self.fileobj.write('\037\213') # magic header 14 self.fileobj.write('\010') # compression method 15 fname = self.filename[:-3] 16 flags = 0 17 if fname: 18 flags = gzip.FNAME 19 self.fileobj.write(chr(flags)) 20 gzip.write32u(self.fileobj, long(mtime)) 21 self.fileobj.write('\002') 22 self.fileobj.write('\377') 23 if fname: 24 self.fileobj.write(fname + '\000') 25 26 gzip.GzipFile._write_gzip_header = _write_gzip_header 10 27 11 28 class MyTarFile(tarfile.TarFile): … … 21 38 return info 22 39 23 def packageSvn(module, svnModule, extras=[], svnroot=' /afs/dev.mit.edu/source/svn-repos', revision='HEAD'):40 def packageSvn(module, svnModule, extras=[], svnroot='file:///afs/dev.mit.edu/source/svn-repos', revision='HEAD'): 24 41 os.system('attach macathena >/dev/null 2>/dev/null') 25 42 os.chdir('/mit/macathena/build') 26 43 27 os.system('svn export -r %s file://%s/%s %s >/dev/null 2>&1' % (revision, svnroot, svnModule, module))44 os.system('svn export -r %s %s/%s %s >/dev/null 2>&1' % (revision, svnroot, svnModule, module)) 28 45 29 for extra in extras: 30 os.system('svn export -r %s file://%s/%s >/dev/null 2>&1' % (revision, svnroot, extra)) 31 os.system('mv %s %s' % (basename(extra), module)) 46 if extras: 47 for extra in extras: 48 os.system('svn export -r %s %s/%s >/dev/null 2>&1' % (revision, svnroot, extra)) 49 os.system('mv %s %s' % (basename(extra), module)) 32 50 33 version_info = os.popen('svn info -r %s file://%s/%s' % (revision, svnroot, svnModule)).readlines()51 version_info = os.popen('svn info -r %s %s/%s' % (revision, svnroot, svnModule)).readlines() 34 52 for line in version_info: 35 53 if line.startswith('Last Changed Date: '): … … 40 58 mtime = int(time.strftime("%s", time.strptime(time_string, "%Y-%m-%d %H:%M:%S"))) 41 59 42 tarball = "%s- %s" % (module, revision)60 tarball = "%s-svn%s" % (module, revision) 43 61 os.rename(module, tarball) 44 62 … … 92 110 'libxj': ['trunk/athena/lib/Xj'], 93 111 'xcluster': ['trunk/athena/bin/xcluster', ['attic/packs/build/aclocal.m4']], 94 'discuss': ['trunk/athena/bin/discuss']} 112 'discuss': ['trunk/athena/bin/discuss'], 113 # Our packages: 114 'add': ['trunk/source/add', False, 'https://macathena.mit.edu/svn'], 115 'attach': ['trunk/source/attach', False, 'https://macathena.mit.edu/svn'], 116 'pyhesiodfs': ['trunk/source/pyhesiodfs', False, 'https://macathena.mit.edu/svn'] 117 } 95 118 96 119 if __name__ == '__main__':