Various changes and updates.
This commit is contained in:
parent
d64f5bdf87
commit
f2382f77a1
3 changed files with 146 additions and 70 deletions
33
src/Utils/cdrom/make-cd-image
Executable file
33
src/Utils/cdrom/make-cd-image
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/sh
|
||||
|
||||
VERSION=0.9.2
|
||||
SOURCE=$1
|
||||
VOLUME_ID=FG_Scenery_${SOURCE}_v${VERSION}
|
||||
PUBLISHER=curt@flightgear.org
|
||||
PREPAIRER=curt@flightgear.org
|
||||
# COPYRIGHT="Copyright (C) 2002 Curtis L. Olson"
|
||||
OUTPUT_IMG=/data1/images/${SOURCE}-${VERSION}.img
|
||||
|
||||
# -f = follow symbolic links (the image directories are link trees)
|
||||
# -r = Rock Ridge protocol
|
||||
# -J -jcharset default = Joliet extensions
|
||||
# -l = allow full 31 character filenames
|
||||
# -D = do not use deep directory relocation
|
||||
# -L = allow IOS9660 filenames to begin with a period
|
||||
# -apple = Add Apple extensions.
|
||||
# -probe = Test each file for it's Mac creator/type
|
||||
|
||||
OPTIONS="-f -r -J -jcharset default -l -D -L"
|
||||
|
||||
COMMAND="mkisofs $OPTIONS -V $VOLUME_ID -P $PUBLISHER -p $PREPAIRER \
|
||||
-apple -probe \
|
||||
-o $OUTPUT_IMG $SOURCE"
|
||||
|
||||
echo running:
|
||||
echo $COMMAND
|
||||
$COMMAND
|
||||
|
||||
echo
|
||||
echo "To examine the image before burning a cd:"
|
||||
echo
|
||||
echo "mount $OUTPUT_IMG /mnt -t iso9660 -o loop=/dev/loop3,blocksize=1024"
|
|
@ -1,8 +1,16 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
$layout_master = "./layout-0.9.2";
|
||||
$source = "/stage/fgfs03/curt/Scenery-0.9.2";
|
||||
$dest = "./Images";
|
||||
|
||||
$layout_master = shift( @ARGV );
|
||||
$dest = shift( @ARGV );
|
||||
|
||||
if ( $layout_master eq "" ) {
|
||||
$layout_master = "./layout-disks-0.9.2";
|
||||
}
|
||||
if ( $dest eq "" ) {
|
||||
$dest = "./Images";
|
||||
}
|
||||
|
||||
@rawfiles = `ls $source/*`;
|
||||
|
||||
|
@ -14,7 +22,14 @@ while ( <LAYOUT> ) {
|
|||
push( @layout, $_ );
|
||||
}
|
||||
|
||||
system( "/bin/rm -rf $dest" );
|
||||
print "Delete current $dest (y/N): ";
|
||||
$response = <STDIN>;
|
||||
chomp($response);
|
||||
if ( $response eq "y" || $response eq "Y" ) {
|
||||
system( "/bin/rm -rf $dest" );
|
||||
} else {
|
||||
die "Stopped with no action.\n";
|
||||
}
|
||||
|
||||
foreach $file ( @layout ) {
|
||||
$base = $file;
|
||||
|
|
|
@ -2,18 +2,21 @@
|
|||
|
||||
use GD;
|
||||
|
||||
$version = "0.9.2";
|
||||
if ( $#ARGV < 0 ) {
|
||||
$scenerydir = "/stage/fgfs01/ftp/pub/fgfs/Scenery";
|
||||
} else {
|
||||
$scenerydir = shift(@ARGV);
|
||||
push( @ARGV, "/stage/fgfs01/ftp/pub/fgfs/Scenery-" . $version );
|
||||
}
|
||||
|
||||
$ftpurl = "ftp://ftp.flightgear.org/pub/fgfs/Scenery-" . $version;
|
||||
$htmlout = "scenery-" . $version . ".html";
|
||||
$mapout = "map-" . $version . ".png";
|
||||
$outputdir = "mapresult/";
|
||||
|
||||
$daysecs = 3600*24;
|
||||
|
||||
# load raw image
|
||||
open( INPUT, "rawmap.gif" ) || die "cannot open raw image\n";
|
||||
$im = newFromGif GD::Image( INPUT );
|
||||
open( INPUT, "rawmap.png" ) || die "cannot open raw image\n";
|
||||
$im = newFromPng GD::Image( INPUT );
|
||||
($width, $height) = $im->getBounds();
|
||||
close( INPUT );
|
||||
|
||||
|
@ -50,86 +53,111 @@ $im->line( $width / 2, 0, $width / 2, $height, $red3 );
|
|||
$im->line( 0, $height / 2, $width, $height / 2, $red3 );
|
||||
|
||||
# create html file
|
||||
open ( HTML, ">$outputdir/world-scenery.html" ) ||
|
||||
die "cannot open $outputdir/world-scenery.html\n";
|
||||
open ( HTML, ">$outputdir/$htmlout" ) ||
|
||||
die "cannot open $outputdir/$htmlout\n";
|
||||
print HTML "<HTML>\n";
|
||||
print HTML "<TITLE>FGFS Scenery Downloads</TITLE>\n";
|
||||
print HTML "<TITLE>FGFS Scenery Downloads Version $version</TITLE>\n";
|
||||
print HTML "<BODY>\n";
|
||||
print HTML "<IMG SRC=\"download-map.gif\" WIDTH=\"$width\" HEIGHT=\"$height\" ";
|
||||
print HTML "<H2>FGFS Scenery Downloads Version $version</H2>\n";
|
||||
print HTML "Click on any of the 10x10 degree chunks in the image below to\n";
|
||||
print HTML "download that area.<BR>\n";
|
||||
print HTML "An area with no corresponding link means that area is all ocean\n";
|
||||
print HTML "so there is nothing to download. (Or if a rebuild is in\n";
|
||||
print HTML "progress, that chunk may not yet be generated.)\n";
|
||||
print HTML "<P>\n";
|
||||
print HTML "<IMG SRC=\"$mapout\" WIDTH=\"$width\" HEIGHT=\"$height\" ";
|
||||
print HTML "USEMAP=\"#map\">\n";
|
||||
print HTML "<MAP NAME=\"map\">\n";
|
||||
|
||||
@files = `ls $scenerydir/*.tar.gz`;
|
||||
$toggle = 0;
|
||||
foreach $dir ( @ARGV ) {
|
||||
@files = `ls $dir/*.tar.gz`;
|
||||
|
||||
foreach $file ( @files ) {
|
||||
chop($file);
|
||||
foreach $file ( @files ) {
|
||||
chop($file);
|
||||
|
||||
($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime,
|
||||
$mtime, $ctime, $blksize, $blocks) = stat($file);
|
||||
($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime,
|
||||
$mtime, $ctime, $blksize, $blocks) = stat($file);
|
||||
|
||||
$mb = $size / (1024*1024);
|
||||
# print "$file size = $mb\n";
|
||||
$mb = $size / (1024*1024);
|
||||
# print "$file size = $mb\n";
|
||||
|
||||
# recover the modification date from the stat
|
||||
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
|
||||
localtime($mtime);
|
||||
# recover the modification date from the stat
|
||||
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
|
||||
localtime($mtime);
|
||||
|
||||
$date = sprintf("%2d/%02d/%02d", $mon + 1, $mday, 1900 + $year);
|
||||
$date = sprintf("%2d/%02d/%02d", $mon + 1, $mday, 1900 + $year);
|
||||
|
||||
$age = (time() - $mtime) / $daysecs;
|
||||
$age = (time() - $mtime) / $daysecs;
|
||||
|
||||
if ( $age < 7 ) {
|
||||
$color1 = $green1;
|
||||
$color2 = $green2;
|
||||
} elsif ( $age < 14 ) {
|
||||
$color1 = $yellow1;
|
||||
$color2 = $yellow2;
|
||||
} else {
|
||||
$color1 = $orange1;
|
||||
$color2 = $orange2;
|
||||
if ( !$toggle ) {
|
||||
if ( $age < 7 ) {
|
||||
$color1 = $green1;
|
||||
$color2 = $green2;
|
||||
} elsif ( $age < 14 ) {
|
||||
$color1 = $yellow1;
|
||||
$color2 = $yellow2;
|
||||
} else {
|
||||
$color1 = $orange1;
|
||||
$color2 = $orange2;
|
||||
}
|
||||
} else {
|
||||
if ( $age < 7 ) {
|
||||
$color1 = $orange1;
|
||||
$color2 = $orange2;
|
||||
} elsif ( $age < 14 ) {
|
||||
$color1 = $yellow1;
|
||||
$color2 = $yellow2;
|
||||
} else {
|
||||
$color1 = $orange1;
|
||||
$color2 = $orange2;
|
||||
}
|
||||
}
|
||||
|
||||
$file =~ s/.*\///g;
|
||||
$file =~ s/.tar.gz//;
|
||||
# print "$file\n";
|
||||
($ew, $lon, $ns, $lat) = $file =~ m/(\w)(\d\d\d)(\w)(\d\d)/;
|
||||
# print "$ew $lon, $ns, $lat\n";
|
||||
|
||||
if ( $ew eq "w" ) {
|
||||
$lon = $lon * -1;
|
||||
} else {
|
||||
$lon = $lon * 1;
|
||||
}
|
||||
|
||||
if ( $ns eq "s" ) {
|
||||
$lat = $lat * -1;
|
||||
} else {
|
||||
$lat = $lat * 1;
|
||||
}
|
||||
|
||||
# print "$lon $lat\n";
|
||||
$x1 = ($lon + 180) * $xstep / 10.0;
|
||||
$y1 = $height - ($lat + 90) * $ystep / 10.0;
|
||||
$x2 = ($lon + 10 + 180) * $xstep / 10.0;
|
||||
$y2 = $height - ($lat + 10 + 90) * $ystep / 10.0;
|
||||
|
||||
$im->line($x1, $y1, $x2, $y2, $color1);
|
||||
$im->line($x1, $y2, $x2, $y1, $color1);
|
||||
$im->rectangle($x1, $y1, $x2, $y2, $color2);
|
||||
|
||||
# $y1 = $height - $y1;
|
||||
# $y2 = $height - $y2;
|
||||
print HTML "<AREA SHAPE=rect COORDS=$x1,$y2,$x2,$y1 ";
|
||||
print HTML "HREF=$ftpurl/$file.tar.gz ";
|
||||
printf(HTML "ALT=\"%s %.2f Mb $date\">\n", $file, $mb);
|
||||
}
|
||||
|
||||
$file =~ s/.*\///g;
|
||||
$file =~ s/.tar.gz//;
|
||||
# print "$file\n";
|
||||
($ew, $lon, $ns, $lat) = $file =~ m/(\w)(\d\d\d)(\w)(\d\d)/;
|
||||
# print "$ew $lon, $ns, $lat\n";
|
||||
|
||||
if ( $ew eq "w" ) {
|
||||
$lon = $lon * -1;
|
||||
} else {
|
||||
$lon = $lon * 1;
|
||||
}
|
||||
|
||||
if ( $ns eq "s" ) {
|
||||
$lat = $lat * -1;
|
||||
} else {
|
||||
$lat = $lat * 1;
|
||||
}
|
||||
|
||||
# print "$lon $lat\n";
|
||||
$x1 = ($lon + 180) * $xstep / 10.0;
|
||||
$y1 = $height - ($lat + 90) * $ystep / 10.0;
|
||||
$x2 = ($lon + 10 + 180) * $xstep / 10.0;
|
||||
$y2 = $height - ($lat + 10 + 90) * $ystep / 10.0;
|
||||
|
||||
$im->line($x1, $y1, $x2, $y2, $color1);
|
||||
$im->line($x1, $y2, $x2, $y1, $color1);
|
||||
$im->rectangle($x1, $y1, $x2, $y2, $color2);
|
||||
|
||||
# $y1 = $height - $y1;
|
||||
# $y2 = $height - $y2;
|
||||
print HTML "<AREA SHAPE=rect COORDS=$x1,$y2,$x2,$y1 ";
|
||||
print HTML "HREF=ftp://ftp.flightgear.org/pub/fgfs/Scenery/$file.tar.gz ";
|
||||
printf(HTML "ALT=\"%s %.2f Mb $date\">\n", $file, $mb);
|
||||
$toggle = !$toggle;
|
||||
}
|
||||
|
||||
# write out gif
|
||||
$gif_data = $im->gif;
|
||||
open( OUTPUT, ">$outputdir/download-map.gif" ) ||
|
||||
die "cannot open output $outputdir/download-map.gif\n";
|
||||
$png_data = $im->png;
|
||||
open( OUTPUT, ">$outputdir/$mapout" ) ||
|
||||
die "cannot open output $outputdir/$mapout\n";
|
||||
binmode OUTPUT;
|
||||
print OUTPUT $gif_data;
|
||||
print OUTPUT $png_data;
|
||||
close OUTPUT;
|
||||
|
||||
# finish off html file
|
||||
|
|
Loading…
Reference in a new issue