Commit 215b8a88 authored by Vitaly Lipatov's avatar Vitaly Lipatov

grf: small optimize

parent 672d0b47
......@@ -87,6 +87,10 @@ if [ "$1" = "--list" ] ; then
uselist="$1"
# hack for detect
sfile=$(cat "$uselist" | grep ^/ | head -n1)
if [ -z "$sfile" ] ; then
echo "Skip empty file $uselist"
exit 0
fi
fi
......@@ -277,6 +281,8 @@ fi
OLDFILE=
SELFILE=
SELHOST=
SELPATH=
if [ "$restore" = "--restore" ] ; then
COUNT=1
FILNUM=0
......@@ -293,8 +299,8 @@ if [ "$restore" = "--restore" ] ; then
if opbrick "test -s" "$file" ; then
OLDFILE="$WORKDIR/$host-$COUNT"
SELFILE="$file"
# FIXME: overhead, but we need host and path vars
GENGFID=$(get_gfid "$SELFILE")
SELHOST=$host
SELPATH=$path
echo "Select OLDFILE:$OLDFILE ($file)"
fi
fi
......@@ -322,6 +328,12 @@ if [ "$restore" = "--restore" ] ; then
if [ -n "$OLDFILE" ] ; then
# get best gfid
# we need host and path vars for get_gfid
host=$SELHOST
path=$SELPATH
GENGFID=$(get_gfid "$SELFILE")
COUNT=1
for i in $LISTBRICKS ; do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment