[gucharmap] build: Enforce required unicode data version



commit 3efb47b75b61d7c6db7e48d72f7aa8c4d4365011
Author: Christian Persch <chpe src gnome org>
Date:   Mon Oct 11 17:36:36 2021 +0200

    build: Enforce required unicode data version
    
    Fixes: https://gitlab.gnome.org/GNOME/gucharmap/-/issues/486

 gucharmap/gen-guch-unicode-tables.pl | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/gucharmap/gen-guch-unicode-tables.pl b/gucharmap/gen-guch-unicode-tables.pl
index 34bf6d87..7af1c63d 100755
--- a/gucharmap/gen-guch-unicode-tables.pl
+++ b/gucharmap/gen-guch-unicode-tables.pl
@@ -558,6 +558,7 @@ sub process_nameslist_txt
 
     my $nameslist_hash;
     my $in_multiline_comment = 0;
+    my $seen_v = 0;
 
     while (my $line = <$nameslist>)
     {
@@ -575,6 +576,11 @@ sub process_nameslist_txt
             $in_multiline_comment = 1;
             next;
         }
+        elsif ($line =~ /^@@@\tThe Unicode Standard ([0-9]+\.[0-9]+\.[0-9]+)$/)
+        {
+            die "$d contains unicode data for version $1 but version $v is required" unless $1 eq $v;
+            $seen_v = 1;
+        }
         elsif ($line =~ /^@/)
         {
             next;
@@ -642,6 +648,8 @@ sub process_nameslist_txt
 
     close ($nameslist);
 
+    die "Unicode version marker not found in $nameslist_txt" unless $seen_v;
+
     open (my $out, "> $outdir/unicode-nameslist.h") or die;
 
     print $out "/* unicode-nameslist.h */\n";


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