SPECS: spec_utf8 usage: spec_utf8 <spec file>

arekm arekm at pld-linux.org
Sun Feb 11 16:09:11 CET 2007


Author: arekm                        Date: Sun Feb 11 15:09:10 2007 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
usage: spec_utf8 <spec file>

---- Files affected:
SPECS:
   spec_utf8 (1.5 -> 1.6) 

---- Diffs:

================================================================
Index: SPECS/spec_utf8
diff -u SPECS/spec_utf8:1.5 SPECS/spec_utf8:1.6
--- SPECS/spec_utf8:1.5	Sun Feb 11 15:34:44 2007
+++ SPECS/spec_utf8	Sun Feb 11 16:09:05 2007
@@ -2,7 +2,7 @@
 
 debug = False
 
-import os, os.path, re, sys, locale
+import os, os.path, re, sys, locale, StringIO
 
 langs={
     'bg':'windows-1251',
@@ -117,9 +117,20 @@
     if debug: outfile.write("%s, %s\n"% (in_desc, in_changelog))
     outfile.write("%s"% (outline, ))
 
-def main():
-  parse_spec(sys.stdin, sys.stdout)
+def main(argv):
+  f = open(argv[1], 'r')
+  sio = StringIO.StringIO()
+  sio.write(f.read())
+  f.close()
+  sio.seek(0)
+  f = open(argv[1] + '.tmp', 'w')
+  parse_spec(sio, f)
+  f.close()
+  os.rename(argv[1] + '.tmp', argv[1])
 
 if __name__ == "__main__":
-  main()
+  if len(sys.argv) != 2:
+	  sys.stderr.write("Usage: %s <spec file>\n" % sys.argv[0])
+	  sys.exit(1)
+  main(sys.argv)
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/spec_utf8?r1=1.5&r2=1.6&f=u



More information about the pld-cvs-commit mailing list