diff options
author | Jim Meyering <jim@meyering.net> | 2004-06-08 15:25:45 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2004-06-08 15:25:45 +0000 |
commit | 8dbd36d92511faf7630310f5437586e231cb4fc5 (patch) | |
tree | 30e8fb4d62a1fd34864fa9915bee4fb51d17f989 /tests/chgrp/basic | |
parent | b50934d2a9ac2ccf4f8a8d4831d1a6c6bd96c319 (diff) | |
download | coreutils-8dbd36d92511faf7630310f5437586e231cb4fc5.tar.xz |
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.
Diffstat (limited to 'tests/chgrp/basic')
-rwxr-xr-x | tests/chgrp/basic | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/tests/chgrp/basic b/tests/chgrp/basic index aaa0f9478..d5f8c76dc 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 \ |