@@ -26,6 +26,14 @@ import tempfile
2626
2727import cvsinfo
2828
29+ try :
30+ __file__
31+ except NameError :
32+ __file__ = sys .argv [0 ]
33+
34+ tools = os .path .dirname (os .path .abspath (__file__ ))
35+ Doc = os .path .dirname (tools )
36+ patchlevel_tex = os .path .join (Doc , "commontex" , "patchlevel.tex" )
2937
3038quiet = 0
3139rx = re .compile (r":ext:(?:[a-zA-Z0-9]+)@cvs\.([a-zA-Z0-9]+).sourceforge.net:"
@@ -102,16 +110,27 @@ def main():
102110 # remove CVS directories
103111 for p in ('*/CVS' , '*/*/CVS' , '*/*/*/CVS' ):
104112 map (shutil .rmtree , glob .glob (p ))
105- for f in ('.cvsignore' , '*/.cvsignore' ):
106- map (os .unlink , glob .glob (f ))
113+ for f in ('.cvsignore' , '*/.cvsignore' ):
114+ map (os .unlink , glob .glob (f ))
115+
116+ # Copy in the version informtation, if we're not just going to
117+ # rip it back out:
118+ if not tools :
119+ if not os .path .exists (patchlevel_tex ):
120+ run (os .path .join (here , "getversioninfo" ))
121+ dest = os .path .join ("Python-Docs-" + release , "commontex" ,
122+ "patchlevel.tex" )
123+ shutil .copyfile (patchlevel_tex , dest )
124+
125+ # Copy in the license file:
107126 LICENSE = os .path .normpath (
108127 os .path .join (mydir , os .pardir , os .pardir , "LICENSE" ))
109128 shutil .copyfile (LICENSE , "LICENSE" )
110129 if tools :
111130 archive = "doctools-" + release
112131 # we don't want the actual documents in this case:
113132 for d in ("api" , "dist" , "doc" , "ext" , "inst" ,
114- "lib" , "mac" , "ref" , "tut" ):
133+ "lib" , "mac" , "ref" , "tut" , "commontex" ):
115134 shutil .rmtree (os .path .join (pkgdir , d ))
116135 else :
117136 archive = "latex-" + release
0 commit comments