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
|
#!/usr/bin/perl
|
||||||
|
|
||||||
$layout_master = "./layout-0.9.2";
|
|
||||||
$source = "/stage/fgfs03/curt/Scenery-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/*`;
|
@rawfiles = `ls $source/*`;
|
||||||
|
|
||||||
|
@ -14,7 +22,14 @@ while ( <LAYOUT> ) {
|
||||||
push( @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 ) {
|
foreach $file ( @layout ) {
|
||||||
$base = $file;
|
$base = $file;
|
||||||
|
|
|
@ -2,18 +2,21 @@
|
||||||
|
|
||||||
use GD;
|
use GD;
|
||||||
|
|
||||||
|
$version = "0.9.2";
|
||||||
if ( $#ARGV < 0 ) {
|
if ( $#ARGV < 0 ) {
|
||||||
$scenerydir = "/stage/fgfs01/ftp/pub/fgfs/Scenery";
|
push( @ARGV, "/stage/fgfs01/ftp/pub/fgfs/Scenery-" . $version );
|
||||||
} else {
|
|
||||||
$scenerydir = shift(@ARGV);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$ftpurl = "ftp://ftp.flightgear.org/pub/fgfs/Scenery-" . $version;
|
||||||
|
$htmlout = "scenery-" . $version . ".html";
|
||||||
|
$mapout = "map-" . $version . ".png";
|
||||||
$outputdir = "mapresult/";
|
$outputdir = "mapresult/";
|
||||||
|
|
||||||
$daysecs = 3600*24;
|
$daysecs = 3600*24;
|
||||||
|
|
||||||
# load raw image
|
# load raw image
|
||||||
open( INPUT, "rawmap.gif" ) || die "cannot open raw image\n";
|
open( INPUT, "rawmap.png" ) || die "cannot open raw image\n";
|
||||||
$im = newFromGif GD::Image( INPUT );
|
$im = newFromPng GD::Image( INPUT );
|
||||||
($width, $height) = $im->getBounds();
|
($width, $height) = $im->getBounds();
|
||||||
close( INPUT );
|
close( INPUT );
|
||||||
|
|
||||||
|
@ -50,86 +53,111 @@ $im->line( $width / 2, 0, $width / 2, $height, $red3 );
|
||||||
$im->line( 0, $height / 2, $width, $height / 2, $red3 );
|
$im->line( 0, $height / 2, $width, $height / 2, $red3 );
|
||||||
|
|
||||||
# create html file
|
# create html file
|
||||||
open ( HTML, ">$outputdir/world-scenery.html" ) ||
|
open ( HTML, ">$outputdir/$htmlout" ) ||
|
||||||
die "cannot open $outputdir/world-scenery.html\n";
|
die "cannot open $outputdir/$htmlout\n";
|
||||||
print HTML "<HTML>\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 "<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 "USEMAP=\"#map\">\n";
|
||||||
print HTML "<MAP NAME=\"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 ) {
|
foreach $file ( @files ) {
|
||||||
chop($file);
|
chop($file);
|
||||||
|
|
||||||
($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime,
|
($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime,
|
||||||
$mtime, $ctime, $blksize, $blocks) = stat($file);
|
$mtime, $ctime, $blksize, $blocks) = stat($file);
|
||||||
|
|
||||||
$mb = $size / (1024*1024);
|
$mb = $size / (1024*1024);
|
||||||
# print "$file size = $mb\n";
|
# print "$file size = $mb\n";
|
||||||
|
|
||||||
# recover the modification date from the stat
|
# recover the modification date from the stat
|
||||||
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
|
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
|
||||||
localtime($mtime);
|
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 ) {
|
if ( !$toggle ) {
|
||||||
$color1 = $green1;
|
if ( $age < 7 ) {
|
||||||
$color2 = $green2;
|
$color1 = $green1;
|
||||||
} elsif ( $age < 14 ) {
|
$color2 = $green2;
|
||||||
$color1 = $yellow1;
|
} elsif ( $age < 14 ) {
|
||||||
$color2 = $yellow2;
|
$color1 = $yellow1;
|
||||||
} else {
|
$color2 = $yellow2;
|
||||||
$color1 = $orange1;
|
} else {
|
||||||
$color2 = $orange2;
|
$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;
|
$toggle = !$toggle;
|
||||||
$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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# write out gif
|
# write out gif
|
||||||
$gif_data = $im->gif;
|
$png_data = $im->png;
|
||||||
open( OUTPUT, ">$outputdir/download-map.gif" ) ||
|
open( OUTPUT, ">$outputdir/$mapout" ) ||
|
||||||
die "cannot open output $outputdir/download-map.gif\n";
|
die "cannot open output $outputdir/$mapout\n";
|
||||||
binmode OUTPUT;
|
binmode OUTPUT;
|
||||||
print OUTPUT $gif_data;
|
print OUTPUT $png_data;
|
||||||
close OUTPUT;
|
close OUTPUT;
|
||||||
|
|
||||||
# finish off html file
|
# finish off html file
|
||||||
|
|
Loading…
Reference in a new issue