From cac8c6bda031882213948a09f381845ff3872932 Mon Sep 17 00:00:00 2001 From: curt Date: Thu, 11 Nov 2004 15:08:03 +0000 Subject: [PATCH] Various miscellaneous script and code tweaks. --- src/BuildTiles/Parallel/fgfs-launch-clients | 2 +- src/BuildTiles/Parallel/fgfs-launch-server | 2 +- src/Prep/Tower/telnet.pl | 84 +++++++++++++++++++++ src/Utils/cdrom/1-gen-layout-map.pl | 2 +- src/Utils/cdrom/3-make-dvd-image | 7 +- 5 files changed, 92 insertions(+), 5 deletions(-) create mode 100644 src/Prep/Tower/telnet.pl diff --git a/src/BuildTiles/Parallel/fgfs-launch-clients b/src/BuildTiles/Parallel/fgfs-launch-clients index 6d3b7158..da275045 100755 --- a/src/BuildTiles/Parallel/fgfs-launch-clients +++ b/src/BuildTiles/Parallel/fgfs-launch-clients @@ -34,7 +34,7 @@ else WORK_BASE="${BASE_DIR}/Work" CLIENT_LIST_RUDE="${WORK_BASE}/clients.rude" CLIENT_LIST_NICE="${WORK_BASE}/clients.nice" - OUTPUT_DIR="${BASE_DIR}/Scenery-0.9.5" + OUTPUT_DIR="${BASE_DIR}/Scenery-0.9.6" LOG_DIR="${WORK_BASE}/Status" SERVER_LOG_FILE=${LOG_DIR}/server.log echo "Base directory is $BASE_DIR" diff --git a/src/BuildTiles/Parallel/fgfs-launch-server b/src/BuildTiles/Parallel/fgfs-launch-server index 6e012dcb..9289da59 100755 --- a/src/BuildTiles/Parallel/fgfs-launch-server +++ b/src/BuildTiles/Parallel/fgfs-launch-server @@ -33,7 +33,7 @@ else BASE_DIR=$1 shift WORK_BASE="${BASE_DIR}/Work" - OUTPUT_DIR="${BASE_DIR}/Scenery-0.9.5" + OUTPUT_DIR="${BASE_DIR}/Scenery-0.9.6" MASTER_ON="${WORK_BASE}/Status/MASTER_ON" LOG_DIR="${WORK_BASE}/Status" LOG_FILE="${LOG_DIR}/server.log" diff --git a/src/Prep/Tower/telnet.pl b/src/Prep/Tower/telnet.pl new file mode 100644 index 00000000..a738a723 --- /dev/null +++ b/src/Prep/Tower/telnet.pl @@ -0,0 +1,84 @@ +#!/usr/bin/perl +# +# Written by Curtis L. Olson, started December 2002 +# Some code portions courtesy of Melchior FRANZ +# +# This file is in the Public Domain and comes with no warranty. +# +# $Id$ +# ---------------------------------------------------------------------------- + + +use IO::Socket; + +use strict; + + +sub my_not() { + my( $val ) = shift; + + if ( $val eq "true" ) { + return 0; + } elsif ( $val eq "false" ) { + return 1; + } elsif ( $val eq "" ) { + return 1; + } else { + return 0; + } +} + + +sub get_prop() { + my( $handle ) = shift; + + &send( $handle, "get " . shift ); + eof $handle and die "\nconnection closed by host"; + $_ = <$handle>; + s/\015?\012$//; + /^-ERR (.*)/ and die "\nfgfs error: $1\n"; + + return $_; +} + + +sub set_prop() { + my( $handle ) = shift; + my( $prop ) = shift; + my( $value ) = shift; + + &send( $handle, "set $prop $value"); + + # eof $handle and die "\nconnection closed by host"; +} + + +sub send() { + my( $handle ) = shift; + + print $handle shift, "\015\012"; +} + + +sub connect() { + my( $host ) = shift; + my( $port ) = shift; + my( $timeout ) = (shift || 120); + my( $socket ); + STDOUT->autoflush(1); + while ($timeout--) { + if ($socket = IO::Socket::INET->new( Proto => 'tcp', + PeerAddr => $host, + PeerPort => $port) ) + { + $socket->autoflush(1); + return $socket; + } + print "Attempting to connect to $host ... " . $timeout . "\n"; + sleep(1); + } + return 0; +} + + +return 1; # make perl happy diff --git a/src/Utils/cdrom/1-gen-layout-map.pl b/src/Utils/cdrom/1-gen-layout-map.pl index 28944049..a656bcd5 100755 --- a/src/Utils/cdrom/1-gen-layout-map.pl +++ b/src/Utils/cdrom/1-gen-layout-map.pl @@ -4,7 +4,7 @@ $tgzdir = "/stage/fgfs03/curt/Scenery/Scenery-0.9.5"; $verbose = 0; if ( $#ARGV < 0 ) { - die "usage: $0 \n"; + die "usage: $0 (DVD=4500, CDROM=700)\n"; } else { $disksize = shift(@ARGV); } diff --git a/src/Utils/cdrom/3-make-dvd-image b/src/Utils/cdrom/3-make-dvd-image index ac7260ce..61a6dc57 100755 --- a/src/Utils/cdrom/3-make-dvd-image +++ b/src/Utils/cdrom/3-make-dvd-image @@ -1,18 +1,21 @@ #!/bin/sh -if [ "x${1}" == "x" ]; then +if [ "x${2}" == "x" ]; then echo "cd one level above the source directory and specify it's short name" echo "as arg $1" + echo + echo "usage: $0 " exit fi VERSION=0.9.5 SOURCE=$1 +DEST=$2 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 +OUTPUT_IMG=${2}/${SOURCE}-${VERSION}.img # -f = follow symbolic links (the image directories are link trees) # -r = Rock Ridge protocol