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";
|
||||||
|
|
||||||
|
$layout_master = shift( @ARGV );
|
||||||
|
$dest = shift( @ARGV );
|
||||||
|
|
||||||
|
if ( $layout_master eq "" ) {
|
||||||
|
$layout_master = "./layout-disks-0.9.2";
|
||||||
|
}
|
||||||
|
if ( $dest eq "" ) {
|
||||||
$dest = "./Images";
|
$dest = "./Images";
|
||||||
|
}
|
||||||
|
|
||||||
@rawfiles = `ls $source/*`;
|
@rawfiles = `ls $source/*`;
|
||||||
|
|
||||||
|
@ -14,7 +22,14 @@ while ( <LAYOUT> ) {
|
||||||
push( @layout, $_ );
|
push( @layout, $_ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print "Delete current $dest (y/N): ";
|
||||||
|
$response = <STDIN>;
|
||||||
|
chomp($response);
|
||||||
|
if ( $response eq "y" || $response eq "Y" ) {
|
||||||
system( "/bin/rm -rf $dest" );
|
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,16 +53,25 @@ $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);
|
||||||
|
@ -78,6 +90,7 @@ foreach $file ( @files ) {
|
||||||
|
|
||||||
$age = (time() - $mtime) / $daysecs;
|
$age = (time() - $mtime) / $daysecs;
|
||||||
|
|
||||||
|
if ( !$toggle ) {
|
||||||
if ( $age < 7 ) {
|
if ( $age < 7 ) {
|
||||||
$color1 = $green1;
|
$color1 = $green1;
|
||||||
$color2 = $green2;
|
$color2 = $green2;
|
||||||
|
@ -88,6 +101,18 @@ foreach $file ( @files ) {
|
||||||
$color1 = $orange1;
|
$color1 = $orange1;
|
||||||
$color2 = $orange2;
|
$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/.*\///g;
|
||||||
$file =~ s/.tar.gz//;
|
$file =~ s/.tar.gz//;
|
||||||
|
@ -120,16 +145,19 @@ foreach $file ( @files ) {
|
||||||
# $y1 = $height - $y1;
|
# $y1 = $height - $y1;
|
||||||
# $y2 = $height - $y2;
|
# $y2 = $height - $y2;
|
||||||
print HTML "<AREA SHAPE=rect COORDS=$x1,$y2,$x2,$y1 ";
|
print HTML "<AREA SHAPE=rect COORDS=$x1,$y2,$x2,$y1 ";
|
||||||
print HTML "HREF=ftp://ftp.flightgear.org/pub/fgfs/Scenery/$file.tar.gz ";
|
print HTML "HREF=$ftpurl/$file.tar.gz ";
|
||||||
printf(HTML "ALT=\"%s %.2f Mb $date\">\n", $file, $mb);
|
printf(HTML "ALT=\"%s %.2f Mb $date\">\n", $file, $mb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$toggle = !$toggle;
|
||||||
|
}
|
||||||
|
|
||||||
# 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