Changeset 3292 in MondoRescue for branches/3.2/mindi/mindi
- Timestamp:
- May 27, 2014, 5:53:14 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi/mindi
r3281 r3292 874 874 875 875 876 # Give all symlinks recursively of a full path name877 ReadAllLink() {878 file="$1"879 880 while [ `echo $file | grep -Ec '\.\./'` -ne 0 ]; do881 # We need to normalise the path with .. in it882 file=`echo $file | perl -p -e 's|([^/]*)/([^/]+)/\.\./([^/]+)|$1/$3|g'`883 done884 echo "$file"885 if [ ! -h $file ]; then886 return 0887 fi888 889 link=`readlink $file`890 d=`dirname $file`891 # Is link a relative or full path name892 fchar=`echo $link | cut -c1`893 # If mother dir is a link print it894 if [ -h "$d" ]; then895 echo "$d"896 d2=`readlink $d`897 c2=`echo $d2 | cut -c1`898 if [ "$c2" != "/" ]; then899 if [ "$c2" != "." ]; then900 d="/$d2"901 else902 d="$d/$d2"903 fi904 fi905 echo "$d/`basename $file`"906 fi907 if [ "$fchar" != "/" ]; then908 # Relative or local link909 ReadAllLink "$d/$link"910 else911 # Absolute path912 ReadAllLink $link913 fi914 }915 916 917 876 LocateFile() { 918 877 local i j path fname_to_find location output resolved tmp stub cache_id loclist … … 2194 2153 rm -rf $bigdir 2195 2154 rm -f $needlist 2196 }2197 2198 2199 ProcessLDD() {2200 local incoming f d nd bd bnd2201 read incoming2202 while [ "$incoming" != "" ]; do2203 # We take the full path name of the dyn. lib. we want2204 incoming=`echo "$incoming" | $AWK '{if (match($1,/\//)) {print $1} else {if (match($3,/\//)) print $3} fi}'`2205 for f in $incoming ; do2206 # echo modified file name if one of the parent dir is a link2207 # by replacing the original dirname by the destination of the link2208 d="`dirname $f`"2209 found="false"2210 while [ "$d" != "/" ]; do2211 if [ -h "$d" ]; then2212 nd=`readlink -f $d`2213 bd=`basename $d`2214 bnd=`basename $nd`2215 f=`echo $f | sed "s~/$bd/~/$bnd/~"`2216 echo $d2217 fi2218 d="`dirname $d`"2219 done2220 2221 echo "$f"2222 echo "`ReadAllLink $f`"2223 done2224 read incoming2225 done2226 2155 } 2227 2156
Note:
See TracChangeset
for help on using the changeset viewer.