X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=bootstrap;h=b286beb53fb16d9bd35cc5dda50cdc76b6366083;hb=3acc9d6f25e716af0edee5721ba33e87da802bf7;hp=7cbb5dc4337ac14bd8540a4152d0278f7ba31a73;hpb=4c779b19551bea70e9f3152566414fe810e40e60;p=debian%2Fgzip diff --git a/bootstrap b/bootstrap index 7cbb5dc..b286beb 100755 --- a/bootstrap +++ b/bootstrap @@ -1,6 +1,6 @@ #! /bin/sh # Print a version string. -scriptversion=2011-04-05.18; # UTC +scriptversion=2011-06-22.06; # UTC # Bootstrap this package from checked-out sources. @@ -290,7 +290,7 @@ sort_patterns() { P x s/^\n// - }' + }' | sed '/^$/d' } # If $STR is not already on a line by itself in $FILE, insert it, @@ -421,17 +421,31 @@ check_versions() { # Honor $APP variables ($TAR, $AUTOCONF, etc.) appvar=`echo $app | tr '[a-z]-' '[A-Z]_'` test "$appvar" = TAR && appvar=AMTAR - eval "app=\${$appvar-$app}" - inst_ver=$(get_version $app) - if [ ! "$inst_ver" ]; then - echo "$me: Error: '$app' not found" >&2 - ret=1 - elif [ ! "$req_ver" = "-" ]; then - latest_ver=$(sort_ver $req_ver $inst_ver | cut -d' ' -f2) - if [ ! "$latest_ver" = "$inst_ver" ]; then - echo "$me: Error: '$app' version == $inst_ver is too old" >&2 - echo " '$app' version >= $req_ver is required" >&2 + case $appvar in + GZIP) ;; # Do not use $GZIP: it contains gzip options. + *) eval "app=\${$appvar-$app}" ;; + esac + if [ "$req_ver" = "-" ]; then + # Merely require app to exist; not all prereq apps are well-behaved + # so we have to rely on $? rather than get_version. + $app --version >/dev/null 2>&1 + if [ 126 -le $? ]; then + echo "$me: Error: '$app' not found" >&2 + ret=1 + fi + else + # Require app to produce a new enough version string. + inst_ver=$(get_version $app) + if [ ! "$inst_ver" ]; then + echo "$me: Error: '$app' not found" >&2 ret=1 + else + latest_ver=$(sort_ver $req_ver $inst_ver | cut -d' ' -f2) + if [ ! "$latest_ver" = "$inst_ver" ]; then + echo "$me: Error: '$app' version == $inst_ver is too old" >&2 + echo " '$app' version >= $req_ver is required" >&2 + ret=1 + fi fi fi done @@ -656,10 +670,18 @@ symlink_to_dir() cp -fp "$src" "$dst" } else + # Leave any existing symlink alone, if it already points to the source, + # so that broken build tools that care about symlink times + # aren't confused into doing unnecessary builds. Conversely, if the + # existing symlink's time stamp is older than the source, make it afresh, + # so that broken tools aren't confused into skipping needed builds. See + # . test -h "$dst" && src_ls=`ls -diL "$src" 2>/dev/null` && set $src_ls && src_i=$1 && dst_ls=`ls -diL "$dst" 2>/dev/null` && set $dst_ls && dst_i=$1 && - test "$src_i" = "$dst_i" || { + test "$src_i" = "$dst_i" && + both_ls=`ls -dt "$src" "$dst"` && + test "X$both_ls" = "X$dst$nl$src" || { dot_dots= case $src in /*) ;;