summaryrefslogtreecommitdiff
path: root/tests/cp/perm
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-08-22 18:56:06 +0200
committerJim Meyering <meyering@redhat.com>2009-08-25 09:21:00 +0200
commit5e778f7c8d1ecf3d8f11385db013af2ba026e2a5 (patch)
treee460d471f37f0dce1ba06f60f88114d1a65326c4 /tests/cp/perm
parent2bc0f3caaafeb240cdcfd050b7ad1fe0ad14addf (diff)
downloadcoreutils-5e778f7c8d1ecf3d8f11385db013af2ba026e2a5.tar.xz
global: convert indentation-TABs to spaces
Transformed via this shell code: t=$'\t' git ls-files \ | grep -vE '(^|/)((GNU)?[Mm]akefile|ChangeLog)|\.(am|mk)$' \ | grep -vE 'tests/pr/|help2man' \ | xargs grep -lE "^ *$t" \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
Diffstat (limited to 'tests/cp/perm')
-rwxr-xr-xtests/cp/perm64
1 files changed, 32 insertions, 32 deletions
diff --git a/tests/cp/perm b/tests/cp/perm
index 11c4b3ba1..7cc6f419e 100755
--- a/tests/cp/perm
+++ b/tests/cp/perm
@@ -37,39 +37,39 @@ for u in 31 37 2; do
for cmd in mv 'cp -p' cp; do
for force in '' -f; do
for existing_dest in yes no; do
- for g_perm in r w x rw wx xr rwx; do
- for o_perm in r w x rw wx xr rwx; do
- touch src || exit 1
- chmod u=r,g=rx,o= src || exit 1
- expected_perms=$(stat --format=%A src)
- rm -f dest
- test $existing_dest = yes && {
- touch dest || exit 1
- chmod u=rw,g=$g_perm,o=$o_perm dest || exit 1
- }
- $cmd $force src dest || exit 1
- test "$cmd" = mv && test -f src && exit 1
- test "$cmd" = cp && { test -f src || exit 1; }
- actual_perms=$(stat --format=%A dest)
+ for g_perm in r w x rw wx xr rwx; do
+ for o_perm in r w x rw wx xr rwx; do
+ touch src || exit 1
+ chmod u=r,g=rx,o= src || exit 1
+ expected_perms=$(stat --format=%A src)
+ rm -f dest
+ test $existing_dest = yes && {
+ touch dest || exit 1
+ chmod u=rw,g=$g_perm,o=$o_perm dest || exit 1
+ }
+ $cmd $force src dest || exit 1
+ test "$cmd" = mv && test -f src && exit 1
+ test "$cmd" = cp && { test -f src || exit 1; }
+ actual_perms=$(stat --format=%A dest)
- case "$cmd:$force:$existing_dest" in
- cp:*:yes)
- _g_perm=`echo rwx|sed 's/[^'$g_perm']/-/g'`
- _o_perm=`echo rwx|sed 's/[^'$o_perm']/-/g'`
- expected_perms=-rw-$_g_perm$_o_perm
- ;;
- cp:*:no)
- test $u = 37 &&
- expected_perms=`echo $expected_perms|sed 's/.....$/-----/'`
- test $u = 31 &&
- expected_perms=`echo $expected_perms|sed 's/..\(..\).$/--\1-/'`
- ;;
- esac
- test _$actual_perms = _$expected_perms || exit 1
- # Perform only one iteration when there's no existing destination.
- test $existing_dest = no && break 3
- done
- done
+ case "$cmd:$force:$existing_dest" in
+ cp:*:yes)
+ _g_perm=`echo rwx|sed 's/[^'$g_perm']/-/g'`
+ _o_perm=`echo rwx|sed 's/[^'$o_perm']/-/g'`
+ expected_perms=-rw-$_g_perm$_o_perm
+ ;;
+ cp:*:no)
+ test $u = 37 &&
+ expected_perms=`echo $expected_perms|sed 's/.....$/-----/'`
+ test $u = 31 &&
+ expected_perms=`echo $expected_perms|sed 's/..\(..\).$/--\1-/'`
+ ;;
+ esac
+ test _$actual_perms = _$expected_perms || exit 1
+ # Perform only one iteration when there's no existing destination.
+ test $existing_dest = no && break 3
+ done
+ done
done
done
done