Update for root EA names.

This commit is contained in:
Tim Shimmin
2002-04-18 02:45:46 +00:00
parent 53a7e8cfac
commit 457e591235
2 changed files with 35 additions and 16 deletions
+12 -8
View File
@@ -50,25 +50,29 @@ xfsrestore: Restore Status: SUCCESS
Comparing dump directory with restore directory Comparing dump directory with restore directory
Looking at the extended attributes (EAs) Looking at the extended attributes (EAs)
EAs on dump EAs on dump
Attribute "attr2" had a 10 byte value for DUMP_DIR/biggg: User names
some_text2
Attribute "attr5" had a 8 byte value for DUMP_DIR/dir: Attribute "attr5" had a 8 byte value for DUMP_DIR/dir:
dir_text dir_text
Attribute "attr1" had a 9 byte value for DUMP_DIR/smalll: Attribute "attr1" had a 9 byte value for DUMP_DIR/smalll:
some_text some_text
Attribute "attr4" had a 10 byte value for DUMP_DIR/sub/biggg:
some_text4
Attribute "attr3" had a 10 byte value for DUMP_DIR/sub/smalll: Attribute "attr3" had a 10 byte value for DUMP_DIR/sub/smalll:
some_text3 some_text3
Root names
Attribute "attr2" had a 10 byte value for DUMP_DIR/biggg:
some_text2
Attribute "attr4" had a 10 byte value for DUMP_DIR/sub/biggg:
some_text4
EAs on restore EAs on restore
Attribute "attr2" had a 10 byte value for DUMP_DIR/biggg: User names
some_text2
Attribute "attr5" had a 8 byte value for DUMP_DIR/dir: Attribute "attr5" had a 8 byte value for DUMP_DIR/dir:
dir_text dir_text
Attribute "attr1" had a 9 byte value for DUMP_DIR/smalll: Attribute "attr1" had a 9 byte value for DUMP_DIR/smalll:
some_text some_text
Attribute "attr4" had a 10 byte value for DUMP_DIR/sub/biggg:
some_text4
Attribute "attr3" had a 10 byte value for DUMP_DIR/sub/smalll: Attribute "attr3" had a 10 byte value for DUMP_DIR/sub/smalll:
some_text3 some_text3
Root names
Attribute "attr2" had a 10 byte value for DUMP_DIR/biggg:
some_text2
Attribute "attr4" had a 10 byte value for DUMP_DIR/sub/biggg:
some_text4
Files 063.ea1 and 063.ea2 are identical Files 063.ea1 and 063.ea2 are identical
+22 -7
View File
@@ -424,13 +424,13 @@ End-of-File
_mk_fillconfig_ea() _mk_fillconfig_ea()
{ {
cat <<End-of-File >$tmp.config cat <<End-of-File >$tmp.config
# pathname size user group perm name value # pathname size user group perm name value namespace
# #
smalll 10 $nobody $nobody 777 attr1 some_text smalll 10 $nobody $nobody 777 attr1 some_text user
biggg 102400 $nobody $nobody 777 attr2 some_text2 biggg 102400 $nobody $nobody 777 attr2 some_text2 root
sub/smalll 10 $nobody $nobody 777 attr3 some_text3 sub/smalll 10 $nobody $nobody 777 attr3 some_text3 user
sub/biggg 102400 $nobody $nobody 777 attr4 some_text4 sub/biggg 102400 $nobody $nobody 777 attr4 some_text4 root
dir d $nobody $nobody 777 attr5 dir_text dir d $nobody $nobody 777 attr5 dir_text user
# #
# Add more files so that there are more than the number # Add more files so that there are more than the number
# of streams. # of streams.
@@ -471,7 +471,7 @@ _do_create_dumpdir_fill()
$verbose && echo -n "Setup " $verbose && echo -n "Setup "
sed -e '/^#/d' $tmp.config \ sed -e '/^#/d' $tmp.config \
| while read file nbytes owner group perms ea_name ea_value | while read file nbytes owner group perms ea_name ea_value namespace
do do
if [ $nbytes = "d" ]; then if [ $nbytes = "d" ]; then
# create a directory # create a directory
@@ -521,8 +521,12 @@ _do_create_dumpdir_fill()
chmod $perms $file chmod $perms $file
fi fi
if [ -n "$ea_name" -a -n "$ea_value" ]; then if [ -n "$ea_name" -a -n "$ea_value" ]; then
if [ "X$namespace" = "Xroot" ]; then
attr -R -s $ea_name -V $ea_value $file
else
attr -s $ea_name -V $ea_value $file attr -s $ea_name -V $ea_value $file
fi fi
fi
$verbose && echo -n "." $verbose && echo -n "."
done done
$verbose && echo $verbose && echo
@@ -1163,6 +1167,7 @@ _get_eas_on_path()
# sed 's/["]//g' |\ # sed 's/["]//g' |\
# sort |\ # sort |\
# and this is now the Linux way... # and this is now the Linux way...
echo "User names"
getfattr --absolute-names -Rh $_path |\ getfattr --absolute-names -Rh $_path |\
perl -wn -e ' perl -wn -e '
if (m/^# file: (\S+)/) { $file = $1 } if (m/^# file: (\S+)/) { $file = $1 }
@@ -1171,6 +1176,16 @@ _get_eas_on_path()
while read file ea_name; do while read file ea_name; do
attr -g $ea_name $file attr -g $ea_name $file
done done
echo "Root names"
getfattr --absolute-names -Rh -m xfsroot $_path |\
perl -wn -e '
if (m/^# file: (\S+)/) { $file = $1 }
elsif (m/^xfsroot\.(\w+)/) { print $file, " ",$1,"\n" }' |\
sort |\
while read file ea_name; do
attr -R -g $ea_name $file
done
} }
# #