[GRASS-dev] Re: [GRASS GIS] #39: r.in.srtm fails to validate zip files

GRASS GIS trac at osgeo.org
Sat Feb 9 22:34:23 EST 2008


#39: r.in.srtm fails to validate zip files
------------------------+---------------------------------------------------
  Reporter:  kyngchaos  |       Owner:  hamish     
      Type:  defect     |      Status:  assigned   
  Priority:  major      |   Milestone:  6.3.0      
 Component:  default    |     Version:  unspecified
Resolution:             |    Keywords:             
------------------------+---------------------------------------------------
Changes (by hamish):

  * status:  new => assigned
  * owner:  grass-dev at lists.osgeo.org => hamish
 * cc: grass-dev at lists.osgeo.org (added)

Comment:

 SUS says:
   http://www.opengroup.org/onlinepubs/009695399/utilities/file.html

 --mime is not mentioned.



 re "why was it changed" in r19303: it never used `zip` to test, it was
 using `ls` to look for a file with a .zip extension. (input= refers to the
 tile name not the file name)

 {{{
 -ls -1 "$FILE.hgt.zip" | grep zip > /dev/null
 -if [ $? -ne 0 ] ; then
 +# really a ZIP file?
 +if [ "`file -ib $FILE.hgt.zip`" != "application/x-zip" ] ; then
    echo "$FILE.hgt.zip is no zip file."
    exit 1
  fi
 }}}

 for one thing "echo $foo.zip | grep zip" was always true.

 Perhaps the reason for the test had to do with downloaders creating
 incomplete or 0 byte files, or having wrongly named files?


 I've removed `file` and added a call to `unzip -t` in 6.3 trunk.

 waiting to backport to 6.3.0's branch and close the bug until someone
 tests the change please.


 Hamish

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/39#comment:5>
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/


More information about the grass-dev mailing list