]> git.lizzy.rs Git - plan9front.git/blob - rc/bin/gbatype
pc64: fix kmap() and invlpg()
[plan9front.git] / rc / bin / gbatype
1 #!/bin/rc
2 file=$1
3 if(~ $#file 0)
4         file=/fd/0
5 if(! crc=`{crc32 <$file})
6         exit $status
7 url=`{hget 'http://releases.pocketheaven.com/advsearching.php?CRC32='^$crc | sed -n 's/[^"]*"([^"]*)"[^"]*/\1\n/gp' | sed -n '/index\.php\?.*rel=[0-9]*/ { s/^/http:\/\/releases.pocketheaven.com\//; p; q;}'}
8 if(~ $#url 0){
9         echo $file: $crc not found >[1=2]
10         exit 'not found'
11 }
12 hget $url | sed -n 's/.*<td>Save Type<\/td><td>(.*)<\/td>.*/\1/p' | sed '
13         s/^SRAM_.*\(([0-9]*)Kbit\)/sram\1/g
14         s/^FLASH_.*\(([0-9]*)Kbit\)/flash\1/g
15         s/^EEPROM_.*\(([0-9]*)Kbit\)/eeprom\1/g
16         t
17         s/.*/unknown type \1/g
18 '