common/bin/compareimage.sh
changeset 13132 bd88bb8dd3af
parent 12801 948f8ad66ee7
equal deleted inserted replaced
13082:9b19b2302c28 13132:bd88bb8dd3af
   175         echo Only in $NEW
   175         echo Only in $NEW
   176         echo "$ONLY_NEW" | sed 's|> ./|    |g'
   176         echo "$ONLY_NEW" | sed 's|> ./|    |g'
   177     fi
   177     fi
   178 fi
   178 fi
   179 
   179 
   180 if [ "`uname`" == "SunOS" ]; then
   180 echo -n Permissions...
   181     PERM="gstat -c%a"
   181 found=""
   182 elif [ $OSTYPE == "cygwin" ]; then
   182 for f in `cd $OLD && find . -type f`
   183     PERM=
   183 do
   184 elif [ "`uname`" == "Darwin" ]; then
   184     if [ ! -f ${OLD}/$f ]; then continue; fi
   185     PERM="stat -f%p"
   185     if [ ! -f ${NEW}/$f ]; then continue; fi
   186 elif [ "`uname`" == "Linux" ]; then
   186     OP=`ls -l ${OLD}/$f | awk '{printf("%.10s\n", $1);}'`
   187     PERM="stat -c%A"
   187     NP=`ls -l ${NEW}/$f | awk '{printf("%.10s\n", $1);}'`
   188 else
   188     if [ "$OP" != "$NP" ]
   189     PERM="stat -c%a"
   189     then
   190 fi
   190 	if [ -z "$found" ]; then echo ; found="yes"; fi
   191 
   191 	printf "\told: ${OP} new: ${NP}\t$f\n"
   192 if [ "${PERM}" ]
   192     fi
   193 then
   193 
   194     echo -n Permissions...
   194     OF=`cd ${OLD} && file $f`
   195     found=""
   195     NF=`cd ${NEW} && file $f`
   196     for f in `cd $OLD && find . -type f`
   196     if [ "$f" = "./src.zip" ]
   197     do
   197     then
   198 	if [ ! -f ${OLD}/$f ]; then continue; fi
   198 	if [ "`echo $OF | grep -ic zip`" -gt 0 -a "`echo $NF | grep -ic zip`" -gt 0 ]
   199 	if [ ! -f ${NEW}/$f ]; then continue; fi
       
   200 	OP=`${PERM} ${OLD}/$f`
       
   201 	NP=`${PERM} ${NEW}/$f`
       
   202 	if [ "$OP" != "$NP" ]
       
   203 	then
   199 	then
   204 	    if [ -z "$found" ]; then echo ; found="yes"; fi
   200 	    # the way we produces zip-files make it so that directories are stored in old file
   205 	    printf "\told: ${OP} new: ${NP}\t$f\n"
   201 	    # but not in new (only files with full-path)
       
   202 	    # this makes file-5.09 report them as different
       
   203 	    continue;
   206 	fi
   204 	fi
   207     done
   205     fi
   208     if [ -z "$found" ]; then echo ; found="yes"; fi
   206 
   209 fi
   207     if [ "$OF" != "$NF" ]
       
   208     then
       
   209 	if [ -z "$found" ]; then echo ; found="yes"; fi
       
   210 	printf "\tFILE: old: ${OF} new: ${NF}\t$f\n"
       
   211     fi
       
   212 done
       
   213 if [ -z "$found" ]; then echo ; found="yes"; fi
   210 
   214 
   211 GENERAL_FILES=$(cd $OLD && find . -type f ! -name "*.so" ! -name "*.jar" ! -name "*.zip" \
   215 GENERAL_FILES=$(cd $OLD && find . -type f ! -name "*.so" ! -name "*.jar" ! -name "*.zip" \
   212                                   ! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \
   216                                   ! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \
   213                                   ! -name "ct.sym" \
   217                                   ! -name "ct.sym" ! -name "*.diz" \
   214                               | grep -v "./bin/"  | sort | $FILTER)
   218                               | grep -v "./bin/"  | sort | $FILTER)
   215 echo General files...
   219 echo General files...
   216 for f in $GENERAL_FILES
   220 for f in $GENERAL_FILES
   217 do
   221 do
   218     if [ -e $NEW/$f ]; then
   222     if [ -e $NEW/$f ]; then