pkgsrc-Changes archive

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

CVS commit: pkgsrc



Module Name:    pkgsrc
Committed By:   rillig
Date:           Sat May 16 12:43:10 UTC 2020

Modified Files:
        pkgsrc/games/bastet: Makefile
        pkgsrc/mk/scripts: subst-identity.awk
        pkgsrc/regress/infra-unittests: subst.sh

Log Message:
mk/subst.mk: properly detect s,a,a,1 as identity substitution

Seen in games/bastet.  The 1 is not necessary though since it only
repeats the default behavior of sed.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 pkgsrc/games/bastet/Makefile
cvs rdiff -u -r1.3 -r1.4 pkgsrc/mk/scripts/subst-identity.awk
cvs rdiff -u -r1.40 -r1.41 pkgsrc/regress/infra-unittests/subst.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/games/bastet/Makefile
diff -u pkgsrc/games/bastet/Makefile:1.23 pkgsrc/games/bastet/Makefile:1.24
--- pkgsrc/games/bastet/Makefile:1.23   Wed May  6 14:04:31 2020
+++ pkgsrc/games/bastet/Makefile        Sat May 16 12:43:10 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.23 2020/05/06 14:04:31 adam Exp $
+# $NetBSD: Makefile,v 1.24 2020/05/16 12:43:10 rillig Exp $
 
 DISTNAME=      bastet-0.43.2
 PKGREVISION=   2
@@ -22,7 +22,7 @@ SUBST_CLASSES+=               vardir
 SUBST_STAGE.vardir=    pre-configure
 SUBST_FILES.vardir=    Config.cpp
 SUBST_MESSAGE.vardir=  Fixing VARBASE.
-SUBST_SED.vardir=      -e "s|/var/games|${VARBASE}/games|1"
+SUBST_SED.vardir=      -e "s|/var/games|${VARBASE}/games|"
 
 REQD_FILES_PERMS+=     /dev/null ${VARBASE}/games/bastet.scores2 ${GAMEDATA_PERMS}
 

Index: pkgsrc/mk/scripts/subst-identity.awk
diff -u pkgsrc/mk/scripts/subst-identity.awk:1.3 pkgsrc/mk/scripts/subst-identity.awk:1.4
--- pkgsrc/mk/scripts/subst-identity.awk:1.3    Mon May 11 19:52:14 2020
+++ pkgsrc/mk/scripts/subst-identity.awk        Sat May 16 12:43:10 2020
@@ -1,5 +1,5 @@
 #! /usr/bin/awk -f
-# $NetBSD: subst-identity.awk,v 1.3 2020/05/11 19:52:14 rillig Exp $
+# $NetBSD: subst-identity.awk,v 1.4 2020/05/16 12:43:10 rillig Exp $
 #
 # Tests whether a sed(1) command line consists of only identity substitutions
 # like s,id,id,.
@@ -45,7 +45,7 @@ function is_identity_subst(s,   len, i, 
        pat_from = substr(s, 3, i - 3);
 
        subst = "s" sep pat_from sep pat_to sep;
-       return s == subst || s == subst "g";
+       return s == subst || s == subst "g" || s == subst "1";
 }
 
 function main(   i) {

Index: pkgsrc/regress/infra-unittests/subst.sh
diff -u pkgsrc/regress/infra-unittests/subst.sh:1.40 pkgsrc/regress/infra-unittests/subst.sh:1.41
--- pkgsrc/regress/infra-unittests/subst.sh:1.40        Tue May 12 05:34:04 2020
+++ pkgsrc/regress/infra-unittests/subst.sh     Sat May 16 12:43:10 2020
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: subst.sh,v 1.40 2020/05/12 05:34:04 rillig Exp $
+# $NetBSD: subst.sh,v 1.41 2020/05/16 12:43:10 rillig Exp $
 #
 # Tests for mk/subst.mk.
 #
@@ -1192,6 +1192,9 @@ if test_case_begin 'identity substitutio
        assert_identity 'no'    -e 's,^a,^a,'
        assert_identity 'no'    -e 's,\(^aaa\)aaa,\(^aaa\)aaa,'
 
+       # Seen in games/bastet before 2020-05-16.
+       assert_identity 'yes'   -e 's,a,a,1'
+
        test_case_end
 fi
 



Home | Main Index | Thread Index | Old Index