[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#901180: release notes fails to build in a clean checkout



Hello, 

Dixit Miroslav Kure, le 04/09/2018 :

>I believe cs translation was excluded from builds quite some years ago,
>so if it got reactivated again, please disable it / mark as obsolete
>as needed. AFAIK there is noone working on the translation and I do
>not see this changing in the near future.

Thanks for your feedback.
Indeed, ca & cs translations are disabled in the Makefile.
So we just need to have a working transcount script for 1) have a
successfull build and 2) taking care of future (or reactivated) xml
translations.

As nobody disagree, I plan to push the attached change during the
week-end.

Baptiste
diff --git a/transcount b/transcount
index 2d8c9be2..f8db4ece 100755
--- a/transcount
+++ b/transcount
@@ -21,12 +21,10 @@ if __name__ == "__main__":
     total = sum(sizes.values())
     revisions = {}
     for fn in filenames:
-        for attr in os.popen("svn info %s/%s" % (origlang, fn)).readlines():
-            if attr.startswith("Last Changed Rev:"):
-                _, revision = attr.split(":", 1)
-                revisions[fn] = int(revision)
+        for attr in os.popen("git log --format=%%H -n 1 %s/%s" % (origlang, fn)).readlines():
+            revisions[fn] = attr
     # looking for marker: "^<!-- English version: 1234 -->$"
-    rev_re = re.compile("^\s*<!--\s+English version:\s+([0-9]+)\s+-->\s*$")
+    rev_re = re.compile("^\s*<!--\s+English version:\s+([0-9a-z]+)\s+-->\s*$")
     for lng in targetlangs:
         stats = 0
         for fn in filenames:
@@ -34,11 +32,11 @@ if __name__ == "__main__":
                 match = rev_re.match(line)
                 if match:
                     revision = int(rev_re.match(line).group(1))
-                    if revision >= revisions[fn]:
+                    if revision == revisions[fn]:
                         # Current! Count 100%.
                         stats += sizes[fn]
                     else:
-                        # SVN revision not current. Count 50%.
+                        # Git revision not current. Count 50%.
                         stats += sizes[fn]/2.
         value = float(stats)/(total/100.)
         print "%s: ~%d%% (~%.2f%%)." % (lng, int(round(value)), value)

Attachment: pgpoE9GvQNwo1.pgp
Description: Signature digitale OpenPGP


Reply to: