File: savemode.sh

package info (click to toggle)
fakechroot 2.9-1.1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,316 kB
  • ctags: 408
  • sloc: sh: 10,537; ansic: 2,223; perl: 126; makefile: 40
file content (12 lines) | stat: -rwxr-xr-x 473 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh
if [ "$(find ~ -maxdepth 0 -printf '%U\n')" != 0 ]; then
    echo "Use in fakechroot environment"
    exit 1
fi
test -f savemode.dat1 && mv -f savemode.dat1 savemode.dat1~
test -f savemode.dat2 && mv -f savemode.dat2 savemode.dat2~
LANG=C find . \( -type b -o -type c -o -type p -o -type s \) \
    | tar czPf savemode.dat1 -T-
find . \( -type f -o -type d -o -type l \) \
    -a \( ! -uid 0 -o ! -gid 0 \) -printf "%U %G %m %p\n" \
    | gzip -9 > savemode.dat2