From: Jim Meyering Date: Tue, 8 Jun 2004 15:25:45 +0000 (+0000) Subject: Use chown --from to discover whether the X-Git-Tag: v5.3.0~1370 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8dbd36d92511faf7630310f5437586e231cb4fc5;p=thirdparty%2Fcoreutils.git Use chown --from to discover whether the group changed, since chgrp now changes unconditionally. This complicates the sed script a bit. Do not specify --dereference, since it's the default (and we want to test this). Adjust output to match the fact that chgrp no longer optimizes the case of changing a file's group to the same value as before. --- diff --git a/tests/chgrp/basic b/tests/chgrp/basic index aaa0f9478e..d5f8c76dcf 100755 --- a/tests/chgrp/basic +++ b/tests/chgrp/basic @@ -60,32 +60,36 @@ test "$VERBOSE" = yes && set +x # This should not change the group of f. chgrp -h -c $g2 symlink 2> /dev/null - chgrp -c $g2 f + chown --from=:$g1 -c :$g2 f # This *should* change the group of f. # Though note that the diagnostic is misleading in that # it says the `group of `symlink'' has been changed. - chgrp --dereference -c $g1 symlink + chgrp -c $g1 symlink + chown --from=:$g1 -c :$g2 f -) 2>&1 | sed "s/ $g1$/ G1/;s/ $g2$/ G2/" > actual +) 2>&1 | sed "s/\([ :]\)$g1$/\1G1/;s/\([ :]\)$g2$/\1G2/" > actual cat <<\EOF > expected changed group of `f' to G1 changed group of `f' to G2 +changed group of `f' to G2 +changed group of `f' to G1 changed group of `f' to G1 -group of `f' retained as G1 changed group of `f' to G2 -changed group of `d' to G2 changed group of `d/f3' to G2 -changed group of `d' to G1 -changed group of `d/f3' to G1 changed group of `d' to G2 -changed group of `d/f3' to G2 +changed group of `d/f3' to G1 changed group of `d' to G1 +changed group of `d/f3' to G2 +changed group of `d' to G2 changed group of `d/f3' to G1 +changed group of `d' to G1 changed group of `d' to G2 -changed group of `f' to G2 +changed group of `symlink' to G2 +changed ownership of `f' to :G2 changed group of `symlink' to G1 +changed ownership of `f' to :G2 EOF cmp expected actual \