]> git.pld-linux.org Git - packages/rpm-build-tools.git/commitdiff
- cosmetic
authorArtur Frysiak <artur@frysiak.net>
Sun, 11 Feb 2007 15:34:00 +0000 (15:34 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    spec_utf8 -> 1.10

spec_utf8

index b1564eec6c13e43c666fd92a2fb94a5d422761b1..77a760d5ad1f8ec011edf5b54c6d2d537fb43a12 100644 (file)
--- a/spec_utf8
+++ b/spec_utf8
@@ -73,9 +73,10 @@ def parse_spec(infile, outfile):
     # %description start
     r = re_desc.match(l)
     if r:
-      (enc, pure_lang) = find_encoding(r.group(2))
+      lang = r.group(2)
+      (enc, pure_lang) = find_encoding(lang)
       if enc == None:
-        outfile.write("#spec_utf8: unknown lang code in %%description -l %s\n" % (r.group(2)))
+        outfile.write("#spec_utf8: unknown lang code in %%description -l %s\n" % (lang))
        success = False
       elif not re_utf.search(enc):
         in_desc = True
@@ -89,7 +90,7 @@ def parse_spec(infile, outfile):
           try:
             outline = unicode(l, enc).encode("UTF-8")
           except UnicodeDecodeError:
-            outfile.write("#spec_utf8: transcoding error %%description -l %s\n" % (r.group(2)))
+            outfile.write("#spec_utf8: transcoding error %%description -l %s\n" % (pure_lang))
            success = False
     elif in_changelog:
       try:
@@ -104,16 +105,17 @@ def parse_spec(infile, outfile):
       # Summary
       r = re_summary.match(l)
       if r:
-        (enc, pure_lang) = find_encoding(r.group(1))
+        lang = r.group(1)
+        (enc, pure_lang) = find_encoding(lang)
         if enc == None:
-          outfile.write("#spec_utf8: unknow lang code Summary(%s)\n" % (r.group(1)))
+          outfile.write("#spec_utf8: unknow lang code Summary(%s)\n" % (lang))
          success = False
         elif not re_utf.search(enc):
           try:
             desc = unicode(r.group(2), enc).encode("UTF-8")
             outline = "Summary(%s.UTF-8):   %s\n" % (pure_lang, desc)
           except UnicodeDecodeError:
-            outfile.write("#spec_utf8: ranscoding error Summary(%s)\n" % (r.group(1)))
+            outfile.write("#spec_utf8: transcoding error Summary(%s)\n" % (lang))
            success = False
       elif re_changelog.match(l):
         # %changelog start
This page took 0.035628 seconds and 4 git commands to generate.