num-out-cmp.pl: Remove unused script.
[pspp] / src / data / sys-file-encoding.pl
index b49c654b68bf194891c800884c4cd54b434cfa53..95860d0e5bf3729fa4f55bd8c70390aa14e6ef09 100755 (executable)
@@ -1,22 +1,35 @@
 #! /usr/bin/perl
+#    Copyright (C) 2020, 2021Free Software Foundation
+
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 use strict;
 use warnings;
 
-if (-t 0 || @ARGV) {
-    print <<EOF;
+if (-t 1 || @ARGV != 1 || $ARGV[0] eq '--help') {
+    print STDERR <<EOF;
 $0: generate code page tables from ICU encoding list
-usage: $0 < convrtrs.txt > sys-file-encoding.c
+usage: $0 CONVRTRS-TXT > sys-file-encoding.c
 
-To regenerate the encoding data, get the latest ICU encoding data from:
-http://source.icu-project.org/repos/icu/icu/trunk/source/data/mappings/convrtrs.txt
-then convert it with this script using the command above.
+To update the encoding data, get the latest ICU encoding data from:
+https://raw.githubusercontent.com/unicode-org/icu/main/icu4c/source/data/mappings/convrtrs.txt
 EOF
     exit (@ARGV && $ARGV[0] eq '--help' ? 0 : 1);
 }
 
-open (CONVERTERS, '<', 'convrtrs.txt')
-  or die "convrtrs.txt: open failed ($!)\n";
+open (CONVERTERS, '<', $ARGV[0])
+  or die "$ARGV[0]: open failed ($!)\n";
 
 our $WINDOWS = 3;              # Windows code pages.
 our $IBM = 2;                  # IBM code pages.
@@ -45,6 +58,24 @@ print <<'EOF';
    Generated by sys-file-encoding.pl.  Do not modify!
 */
 
+/*
+PSPP - a program for statistical analysis.
+Copyright (C) 2017 Free Software Foundation, Inc.
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
 #include <config.h>
 
 #include "data/sys-file-private.h"