pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/checksum Avoid using # and % to strip prefix/suffix...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2152fd010cb7
branches:  trunk
changeset: 516117:2152fd010cb7
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Fri Jul 14 16:17:08 2006 +0000

description:
Avoid using # and % to strip prefix/suffix from variable values -- not
enough agreement on how that should work amongst Bourne shell variants.

diffstat:

 mk/checksum/checksum |  5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diffs (22 lines):

diff -r 743be0703a38 -r 2152fd010cb7 mk/checksum/checksum
--- a/mk/checksum/checksum      Fri Jul 14 15:58:43 2006 +0000
+++ b/mk/checksum/checksum      Fri Jul 14 16:17:08 2006 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: checksum,v 1.6 2006/07/13 16:44:14 jlam Exp $
+# $NetBSD: checksum,v 1.7 2006/07/14 16:17:08 jlam Exp $
 #
 # Copyright (c) 2006 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -131,9 +131,8 @@
        eval "tmp=\"\$_alg_${d_alg}\""
        ${TEST} -n "$tmp" || eval "_alg_${d_alg}=\"$files\""
 
-       d_file="${d_file#\(}"; d_file="${d_file%\)}"
        for file in $files; do
-               ${TEST} "$d_file" = "$file" || continue
+               ${TEST} "$d_file" = "($file)" || continue
                
                eval "tmp=\"\$_alg_${d_alg}\""
                case "$tmp" in



Home | Main Index | Thread Index | Old Index