diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..903aebe --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +# FreeBSD Ports Makefile For 'validate-upg' +# $Id: Makefile,v 1.100 2005/03/02 05:55:45 tundra Exp $ + +all: # Just need to create the compiled image + @python -OOOO -c"import py_compile;py_compile.compile('validate-upg.py')" + +install: + ${BSD_INSTALL_SCRIPT} validate-upg.py ${PREFIX}/bin + ${BSD_INSTALL_MAN} validate-upg.1.gz ${PREFIX}/man/man1 diff --git a/READ-1ST.txt b/READ-1ST.txt new file mode 100644 index 0000000..0342a75 --- /dev/null +++ b/READ-1ST.txt @@ -0,0 +1,2 @@ +$Id: READ-1ST.txt,v 1.100 2005/03/02 05:55:45 tundra Exp $ + diff --git a/WHATSNEW.txt b/WHATSNEW.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/WHATSNEW.txt @@ -0,0 +1 @@ + diff --git a/makefile b/makefile new file mode 100644 index 0000000..7534245 --- /dev/null +++ b/makefile @@ -0,0 +1,109 @@ +# Build a release of tconfpy using 'make' +# $Id: makefile,v 1.100 2005/03/02 05:55:45 tundra Exp $ +# Requires a modern 'make' like GNU. + + +# Uncomment One Of The Following For Early Releases + +#EARLY = Alpha +#EARLY = Beta +#EARLY = RC1 + +##### +# Definitions Relevant To This Program +##### + +PROGNAME = validate-upg + +PORTNAME = ${PROGNAME} + +PROGFILES = ${PROGNAME}.py + +SUPPFILES = ${PROGNAME}-license.txt CHANGELOG.txt Makefile READ-1ST.txt WHATSNEW.txt setup.py + +DOCFILES = ${PROGNAME}.html ${PROGNAME}.pdf ${PROGNAME}.ps ${PROGNAME}.py.ps ${PROGNAME}.txt \ + ${PROGNAME}.1.gz + + +##### +# Nothing Should Need To Change Below This Line +##### + + +DIR = ${PORTNAME}-${VERSION} +HEADER1 = "WHATSNEW For '${PROGNAME}' ${VERSION} (`date`)" +HEADER2 = "----------------------------------------------------------------------" +TARBALL = ${DIR}.tar.gz +TMPFILE = tmpfile +VERSION = $(shell rlog -v ${PROGNAME}.py | cut -f 2 -d " ")${EARLY} + + +##### +# Pattern Rules +##### + +%.html: %.1 + @manserver $< >$@ + +%.pdf: %.ps + @gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=$@ $< + +%.ps: %.1 + @groff -man -Tps $< >$@ + +%.ps: %.3 + @groff -man -Tps $< >$@ + +%.py.ps: %.py + @enscript -Epython -fCourier8 -i2 -L77 -C --mark-wrapped-lines=arrow -p$@ $< + +%.txt: %.1 + @groff -man -Tascii $< | col -xb >$@ + +%.txt: %.3 + @groff -man -Tascii $< | col -xb >$@ + +%.1.gz: %.1 + @gzip $< + +%.3.gz: %.3 + @gzip $< + + +##### +# Actual Build Rules +##### + +clean: + @rm -rf ${DIR} ${DOCFILES} ${PORTNAME} ${PROGFILES} ${SUPPFILES} ${TARBALL} ${TMPFILE} + +version: + @echo ${VERSION} + +CHANGELOG.txt: + @rlog ${PROGNAME}.py >CHANGELOG.txt + +WHATSNEW.txt: + @co -l $@ + @printf "%s\n%s\n\n" ${HEADER1} ${HEADER2} | cat - $@ >${TMPFILE} + @mv ${TMPFILE} $@ + @emacs $@ + @ci -m${HEADER1} $@ + @co $@ + +docs: ${DOCFILES} ${SUPPFILES} + @chmod 644 ${DOCFILES} ${SUPPFILES} + @chmod 644 *.gz *.txt + @flip -u *txt + +progs: ${PROGFILES} + chmod 755 ${PROGFILES} + +release: docs progs + @mkdir ${DIR} + @mv ${DOCFILES} ${PROGFILES} ${SUPPFILES} ${DIR} + @tar -czvf ${TARBALL} ${DIR} + @rm -rf ${DIR} + @mv ${DIR}.tar.gz Releases + + diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..f7e8476 --- /dev/null +++ b/setup.py @@ -0,0 +1,6 @@ +# Install validate-upg as a Python Module +# Copyright (c) 2005, TundraWare Inc., All Rights Reserved +# $Id: setup.py,v 1.100 2005/03/02 05:55:45 tundra Exp $ + +from distutils.core import setup +setup(name="validate-upg", py_modules=["validate-upg"]) diff --git a/validate-upg-license.txt b/validate-upg-license.txt new file mode 100644 index 0000000..c910467 --- /dev/null +++ b/validate-upg-license.txt @@ -0,0 +1,105 @@ +$Id: validate-upg-license.txt,v 1.100 2005/03/02 05:55:45 tundra Exp $ + +In order to use, study, modify, or copy 'validate-upg', you must read +and agree to all the licensing terms below. If you do not agree with +or do not understand *ANYTHING* you see in this document, you are NOT +granted a license to use, study, modify, or copy 'validate-upg'. By +using, studying, modifying, or copying 'validate-upg', you are agreeing +to all the terms of the 'validate-upg' LICENSE below in their entirety. + + + 'validate-upg' LICENSE AGREEMENT + + +1) DEFINITIONS + +Throughout this Agreement, the term 'validate-upg' is used to mean: + +Anything included in the 'validate-upg' software distribution package +from TundraWare Inc. This includes scripts, programs, documentation, +license text and all other files provided in that original software +distribution package. + +Throughout this Agreement the term "User" is used to mean any person +who is enagaged in any of the following activities: + + a) Uses any files found in the 'validate-upg' software distribution + in any way. + + b) Reads the 'validate-upg' documentation. + + c) Reads or studies the 'validate-upg' program source code or + supporting files. + + d) Makes use of any part of the 'validate-upg' software distribution + for any purpose. + + e) Duplicates and/or distributes the 'validate-upg' software distribution. + + +2) OWNERSHIP + +'validate-upg' Is Copyright (c) 2005 TundraWare Inc. All Rights Reserved. + + +3) TERMS + +Permission is hereby granted to the User for the duplication and use +of 'validate-upg' so long as ALL the following conditions are met: + + a) There is no license fee for NON-COMMERCIAL use of + 'validate-upg'. This means that the program may be used at no + cost in personal applications, legally recognized non-profit + organizations, legally recognized educational institutions, + and government organizations. Voluntary donations from such + users are accepted and encouraged. A donation of $5 US per + user is recommended and information on how to contribute can + be obtained by contacting validate-upg@tundraware.com. + + Use of 'validate-upg' in FOR-PROFIT organizations, including + government contractors, requires a payment of $5 US per user. + For information on how to submit payment, please contact + validate-upg@tundraware.com + + + b) The User of 'validate-upg' understands and agrees that this is + EXPERIMENTAL SOFTWARE which is provided "AS-IS" with no + warranties expressed or implied by TundraWare Inc. + + c) The User acknowledges 'validate-upg' has NOT been tested for: + + i) Correct operation + + ii) Freedom from unintended consequences + + iii) Any operation or condition which might cause damage, + compromise, or disruption to the User's or other: + hardware, software, networks, or data, or which might + cause any breach of system security of such systems, + software, and networks. + + d) By using 'validate-upg' in any way, the User does so at their + own risk and agrees to hold TundraWare Inc. harmless for any + damage, direct or indirect, that this software may or does + cause to the User's computational environment, including, but + not limited to, the User's or others' hardware, software, + network, or data. THE USER FURTHER AGREES TO HOLD TUNDRAWARE + INC. HARMLESS FOR ANY ECONOMIC DAMAGE OR ANY OTHER ADVERSE + CONSEQUENCE, DIRECT OR INDIRECT, CAUSED BY THE USE OF + 'validate-upg'. + + e) If duplicated and/or distributed, no fee beyond reasonable + duplication charges may be charged for 'validate-upg'. No + commercial use of 'validate-upg' which involves any + remuneration beyond these duplication charges is permitted. + + f) Any distributed copies of 'validate-upg' must include all the + originally provided software, documentation, and licensing + information in their original distribution format and + packaging without any modifications. + +By using any part or all of 'validate-upg', you are agreeing to be +bound by this license. + +IF YOU DO NOT UNDERSTAND, OR CANNOT ABIDE BY ANY OF THESE CONDITIONS, +DO NOT USE 'validate-upg'. diff --git a/validate-upg.1 b/validate-upg.1 new file mode 100644 index 0000000..84f2ba7 --- /dev/null +++ b/validate-upg.1 @@ -0,0 +1,45 @@ +.ds CP 2005 +.TH validate-upg 1 "TundraWare Inc." +.SH NAME +validate-upg \- Short Description + +.SH SYNOPSIS +validate-upg [-hv] + +.SH DESCRIPTION +Long description + +.SH OPTIONS +.TP +.B -h +print this help information + +.TP +.B -v +print detailed version information. + +.SH OTHER +You must have a reasonably current version of Python installed. + +.SH BUGS AND MISFEATURES +None known as of this release. + +.SH COPYRIGHT AND LICENSING +\'validate-upg\' is Copyright (c) \*(CP TundraWare Inc. For terms of use, see +the validate-upg-license.txt file in the program distribution. If you +install \'validate-upg\' on a FreeBSD system using the 'ports' mechanism, you +will also find this file in /usr/local/share/doc/validate-upg. + +.SH AUTHOR +.ft C \" Courier +.nf + Tim Daneliuk + validate-upg@tundraware.com +.fi +.ft \" revert + +.SH DOCUMENT REVISION INFORMATION +$Id: validate-upg.1,v 1.100 2005/03/02 05:55:45 tundra Exp $ + + + diff --git a/validate-upg.py b/validate-upg.py new file mode 100755 index 0000000..ac6412d --- /dev/null +++ b/validate-upg.py @@ -0,0 +1,179 @@ +#!/usr/bin/env python +# validate-upg.py +# Copyright (c) 2005 TundraWare Inc. All Rights Reserved. +# For Updates See: http://www.tundraware.com/Software/validate-upg + +# Program Information + +PROGNAME = "validate-upg" +RCSID = "$Id: validate-upg.py,v 1.100 2005/03/02 05:55:45 tundra Exp $" +VERSION = RCSID.split()[2] + +# Copyright Information + +CPRT = "(c)" +DATE = "2005" +OWNER = "TundraWare Inc." +RIGHTS = "All Rights Reserved" +COPYRIGHT = "Copyright %s %s %s %s. " % (CPRT, DATE, OWNER, RIGHTS) + + +#----------------------------------------------------------# +# Variables User Might Change # +#----------------------------------------------------------# + + + +#------------------- Nothing Below Here Should Need Changing ------------------# + + +#----------------------------------------------------------# +# Imports # +#----------------------------------------------------------# + +import getopt +import os +import sys +import tconfpy + + +#----------------------------------------------------------# +# Aliases & Redefinitions # +#----------------------------------------------------------# + + + +#----------------------------------------------------------# +# Constants & Literals # +#----------------------------------------------------------# + + + +##### +# Constants +##### + +FALSE = 0 == 1 # Booleans +TRUE = not FALSE + + + +##### +# Literals +##### + + + +#----------------------------------------------------------# +# Prompts, & Application Strings # +#----------------------------------------------------------# + + +##### +# Error Messages +##### + +eERROR = "ERROR" + + +##### +# Informational Messages +##### + + +##### +# Usage Prompts +##### + +uTable = [PROGNAME + " " + VERSION + " - %s\n" % COPYRIGHT, + "usage: " + PROGNAME + " [-hv] where,\n", + " -f file configuration file to use", + " -h print this help information", + " -v print detailed version information", + ] + + +#----------------------------------------------------------# +# Global Variables & Data Structures # +#----------------------------------------------------------# + +CFGFILE = os.path.join(os.getenv("HOME"), "." + PROGNAME) # conf file + + +#--------------------------- Code Begins Here ---------------------------------# + + +#----------------------------------------------------------# +# Object Base Class Definitions # +#----------------------------------------------------------# + + + +#----------------------------------------------------------# +# Supporting Function Definitions # +#----------------------------------------------------------# + + +##### +# Print An Error Message +##### + +def ErrorMsg(emsg): + print PROGNAME + " " + VERSION + " " + eERROR + ": " + emsg + +# End of 'ErrorMsg()' + + +##### +# Print Usage Information +##### + +def Usage(): + for line in uTable: + print line + +# End of 'Usage()' + + +#----------------------------------------------------------# +# Program Entry Point # +#----------------------------------------------------------# + +# Command line processing - Process any options set in the +# environment first, and then those given on the command line + +OPTIONS = sys.argv[1:] +envopt = os.getenv(PROGNAME.upper()) +if envopt: + OPTIONS = envopt.split() + OPTIONS + +try: + opts, args = getopt.getopt(OPTIONS, '-f:hv') +except getopt.GetoptError: + Usage() + sys.exit(1) + +for opt, val in opts: + if opt == "-f": + CFGFILE=val + if opt == "-h": + Usage() + sys.exit(0) + if opt == "-v": + print RCSID + sys.exit(0) + +# Process the configuration file + +retval = tconfpy.ParseConfig(CFGFILE) + +# Print any errors or warning generated by the parse + +for x in (retval.Errors, retval.Warnings): + for y in x: + y = "%s %s %s" % (PROGNAME, VERSION, " ".join(y.split()[2:])) + print y + +# If there were any errors, we're done +if retval.Errors: + sys.exit(0)