]> eyrie.org Git - kerberos/kstart.git/commitdiff
Add obsolete-strings test and fix old URLs
authorRuss Allbery <eagle@eyrie.org>
Tue, 30 Mar 2021 17:54:43 +0000 (10:54 -0700)
committerRuss Allbery <eagle@eyrie.org>
Tue, 30 Mar 2021 17:54:43 +0000 (10:54 -0700)
Makefile.am
docs/k5start.pod
docs/krenew.pod
kstart.spec
tests/TESTS
tests/style/obsolete-strings-t [new file with mode: 0755]

index b99664649740a5070ffdc77462f7f47f06263199..76322566ed5835252e7d2be51d0a49c939112a62 100644 (file)
@@ -23,8 +23,8 @@ EXTRA_DIST = .gitignore .github LICENSE bootstrap ci/README.md                    \
        tests/k5start/sigchld-t tests/kafs/basic-t tests/krenew/afs-t       \
        tests/krenew/basic-t tests/krenew/daemon-t tests/krenew/errors-t    \
        tests/krenew/keyring-t tests/krenew/non-renewable-t                 \
-       tests/libtest.pl tests/tap/libtap.sh tests/tap/perl/Test/RRA.pm     \
-       tests/tap/perl/Test/RRA/Automake.pm                                 \
+       tests/libtest.pl tests/style/obsolete-strings-t tests/tap/libtap.sh \
+       tests/tap/perl/Test/RRA.pm tests/tap/perl/Test/RRA/Automake.pm      \
        tests/tap/perl/Test/RRA/Config.pm tests/util/xmalloc-t
 
 # Enable AFS support when running distcheck.
index 96887886da993d01bcb9452caea04f862a8f172b..5107d7d8321aba4dd714a426b4992622b41029bd 100644 (file)
@@ -456,10 +456,10 @@ script are based on code contributed by Navid Golpayegani.
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2015 Russ Allbery <eagle@eyrie.org>
+Copyright 2015, 2021 Russ Allbery <eagle@eyrie.org>
 
-Copyright 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014
-The Board of Trustees of the Leland Stanford Junior University
+Copyright 2002, 2004-2012, 2014 The Board of Trustees of the Leland
+Stanford Junior University
 
 Copying and distribution of this file, with or without modification, are
 permitted in any medium without royalty provided the copyright notice and
@@ -470,7 +470,7 @@ warranty.
 
 kinit(1), krenew(1)
 
-The kstart web page at L<http://www.eyrie.org/~eagle/software/kstart/>
-will have the current version of B<k5start> and B<krenew>.
+This program is part of kstart.  The current version is available from its
+web site at L<https://www.eyrie.org/~eagle/software/kstart/>.
 
 =cut
index 4dd38da48bc569487e34f948738ca4016ddf6d96..74ad6389dcc4771c48b2890ce720940bbbab05c7 100644 (file)
@@ -324,10 +324,10 @@ k4start code written by Robert Morgan.
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2015 Russ Allbery <eagle@eyrie.org>
+Copyright 2015, 2021 Russ Allbery <eagle@eyrie.org>
 
-Copyright 2006, 2008, 2009, 2010, 2011, 2012, 2014 The Board of Trustees
-of the Leland Stanford Junior University
+Copyright 2006, 2008-2012, 2014 The Board of Trustees of the Leland
+Stanford Junior University
 
 Copying and distribution of this file, with or without modification, are
 permitted in any medium without royalty provided the copyright notice and
@@ -338,7 +338,7 @@ warranty.
 
 k5start(1), kinit(1)
 
-The kstart web page at L<http://www.eyrie.org/~eagle/software/kstart/>
-will have the current version of B<krenew>.
+This program is part of kstart.  The current version is available from its
+web site at L<https://www.eyrie.org/~eagle/software/kstart/>.
 
 =cut
index 5b7f118694dc8d066ddf35f6854cce5103f6e15f..fc7e02bf97c3838b9c7ff0e7f22954bbb69abf48 100644 (file)
@@ -1,8 +1,8 @@
 # RPM spec file for kstart.
 #
 # Written by Russ Allbery <eagle@eyrie.org>
-# Copyright 2015 Russ Allbery <eagle@eyrie.org>
-# Copyright 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+# Copyright 2015, 2021 Russ Allbery <eagle@eyrie.org>
+# Copyright 2005-2012
 #     The Board of Trustees of the Leland Stanford Junior University
 #
 # See LICENSE for licensing terms.
 Name: kstart
 Summary: Kerberos kinit variants supporting ticket refreshing
 Version: 4.2
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: MIT
 Group: System Environment/Base
-URL: http://www.eyrie.org/~eagle/software/kstart/
-Source: http://archives.eyrie.org/software/kerberos/%{name}-%{version}.tar.gz
+URL: https://www.eyrie.org/~eagle/software/kstart/
+Source: https://archives.eyrie.org/software/kerberos/%{name}-%{version}.tar.gz
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 BuildRequires: krb5-devel
 Requires: krb5
@@ -51,6 +51,9 @@ PATH="/sbin:/bin:/usr/sbin:/usr/bin:$PATH" \
 %{_mandir}/*/*
 
 %changelog
+* Tue Mar 20 2021 Russ Allbery <eagle@eyrie.org> 4.2-2
+- Update upstream URL.
+
 * Fri Dec 25 2015 Russ Allbery <eagle@eyrie.org> 4.2-1
 - New version for 4.2 release.
 
index 876a77e986b38792e7595c183e436720ee15862c..4e3aac837648490c95466e8519525b1e2d13bbdb 100644 (file)
@@ -22,6 +22,7 @@ portable/daemon
 portable/mkstemp
 portable/reallocarray
 portable/setenv
+style/obsolete-strings
 util/messages
 util/messages-krb5
 util/xmalloc
diff --git a/tests/style/obsolete-strings-t b/tests/style/obsolete-strings-t
new file mode 100755 (executable)
index 0000000..430f072
--- /dev/null
@@ -0,0 +1,104 @@
+#!/usr/bin/perl
+#
+# Check for obsolete strings in source files.
+#
+# Examine all source files in a distribution for obsolete strings and report
+# on files that fail this check.  This catches various transitions I want to
+# do globally in all my packages, like changing my personal URLs to https.
+#
+# The canonical version of this file is maintained in the rra-c-util package,
+# which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
+#
+# Copyright 2016, 2018-2020 Russ Allbery <eagle@eyrie.org>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+#
+# SPDX-License-Identifier: MIT
+
+use 5.010;
+use strict;
+use warnings;
+
+use lib "$ENV{C_TAP_SOURCE}/tap/perl";
+
+use Test::RRA qw(skip_unless_author);
+use Test::RRA::Automake qw(all_files automake_setup);
+
+use File::Basename qw(basename);
+use Test::More;
+
+# Bad patterns to search for.
+my @BAD_REGEXES = (qr{ http:// \S+ [.]eyrie[.]org }xms);
+my @BAD_STRINGS = qw(rra@stanford.edu RRA_MAINTAINER_TESTS);
+
+# File names to exclude from this check.
+my %EXCLUDE
+  = map { $_ => 1 } qw(NEWS changelog obsolete-strings.t obsolete-strings-t);
+
+# Only run this test for the package author, since it doesn't indicate any
+# user-noticable flaw in the package itself.
+skip_unless_author('Obsolete strings tests');
+
+# Set up Automake testing.
+automake_setup();
+
+# Check a single file for one of the bad patterns.
+#
+# $path - Path to the file
+#
+# Returns: undef
+sub check_file {
+    my ($path) = @_;
+    my $filename = basename($path);
+
+    # Ignore excluded and binary files.
+    return if $EXCLUDE{$filename};
+    return if !-T $path;
+
+    # Scan the file.
+    open(my $fh, '<', $path) or BAIL_OUT("Cannot open $path");
+    while (defined(my $line = <$fh>)) {
+        for my $regex (@BAD_REGEXES) {
+            if ($line =~ $regex) {
+                ok(0, "$path contains $regex");
+                close($fh) or BAIL_OUT("Cannot close $path");
+                return;
+            }
+        }
+        for my $string (@BAD_STRINGS) {
+            if (index($line, $string) != -1) {
+                ok(0, "$path contains $string");
+                close($fh) or BAIL_OUT("Cannot close $path");
+                return;
+            }
+        }
+    }
+    close($fh) or BAIL_OUT("Cannot close $path");
+    ok(1, $path);
+    return;
+}
+
+# Scan every file for any of the bad patterns or strings.  We don't declare a
+# plan since we skip a lot of files and don't want to precalculate the file
+# list.
+my @paths = all_files();
+for my $path (@paths) {
+    check_file($path);
+}
+done_testing();