From ee5d0cbfe8a92f044636bb47b888aec49888c42e Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Fri, 18 May 2007 14:17:24 +0200 Subject: [PATCH 01/13] - Reverted a patch for the fonts. --- gui/Gui/Scytherthread.py | 48 ++++++++++++++++------------------------ 1 file changed, 19 insertions(+), 29 deletions(-) diff --git a/gui/Gui/Scytherthread.py b/gui/Gui/Scytherthread.py index f976c90..938a19e 100644 --- a/gui/Gui/Scytherthread.py +++ b/gui/Gui/Scytherthread.py @@ -153,13 +153,6 @@ class AttackThread(threading.Thread): return graphLine("%s [%s]" % (edge,atxt)) - # Precompute font name - # Set a font with sans - # We only retrieve the name, so the size '9' here is - # irrelevant. - font = wx.Font(9,wx.SWISS,wx.NORMAL,wx.NORMAL) - self.fontname = font.GetFaceName() - # write all graph lines but add layout modifiers for l in txt.splitlines(): fp.write(l) @@ -172,22 +165,23 @@ class AttackThread(threading.Thread): #graphLine("nodesep=0.1") #graphLine("ranksep=0.001") #graphLine("mindist=0.1") - - # Set fontname - fontstring = "fontname=%s" % (self.fontname) - setAttr(fontstring,EDGE) - - # Stupid Mac <> Graphviz bug fix - if (sys.platform.startswith("mac")) or (sys.platform.startswith("darwin")): - # Note that dot on Mac cannot find the fonts by default, - # and we have to set them accordingly. - os.environ["DOTFONTPATH"]="~/Library/Fonts:/Library/Fonts:/System/Library/Fonts" - - # Select font size + if sys.platform.startswith("lin"): + # For Linux, choose Helvetica + # TODO + # This is really a Mac font so it might not be + # available. Still, it works better on my Ubuntu + # than Verdana, and finding a good sans default for + # linux seems problematic. + setAttr("fontname=\"Helvetica\"") + if sys.platform.startswith("mac"): + # For Mac choose Helvetica + setAttr("fontname=\"Helvetica\"") + if sys.platform.startswith("win"): + # For Windows choose Verdana + setAttr("fontname=\"Verdana\"") if self.parent and self.parent.mainwin: fontsize = self.parent.mainwin.settings.fontsize setAttr("fontsize=%s" % fontsize) - #setAttr("height=\"0.1\"",NODE) #setAttr("width=\"1.0\"",NODE) #setAttr("margin=\"0.3,0.03\"",NODE) @@ -208,29 +202,25 @@ class AttackThread(threading.Thread): (fd2,fpname2) = Tempfile.tempcleaned(ext) f = os.fdopen(fd2,'w') - cmd = "dot -T%s >%s" % (type,fpname2) + cmd = "dot -T%s" % (type) # execute command cin,cout = os.popen2(cmd,'b') self.writeGraph(attack.scytherDot,cin) - cin.flush() cin.close() - cout.close() + for l in cout.read(): + f.write(l) + + cout.close() f.flush() f.close() - # Print - print fpname2 - raw_input() - # if this is done, store and report attack.filetype = type attack.file = fpname2 # this is where the file name is stored - # Maybe we should remove the temporary file... TODO - #--------------------------------------------------------------------------- class VerificationWindow(wx.Dialog): From 56f1f698e965b98a73423318c87b36ee5465f549 Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Sun, 20 May 2007 13:15:27 +0200 Subject: [PATCH 02/13] - Improved the build script. Should work for windows and linux now. --- dist/gitdist.sh | 67 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 57 insertions(+), 10 deletions(-) diff --git a/dist/gitdist.sh b/dist/gitdist.sh index a5ae60b..e903c51 100755 --- a/dist/gitdist.sh +++ b/dist/gitdist.sh @@ -8,8 +8,21 @@ # # gitdist ARCH TAG # -ARCH=w32 -TAG="v1.0-beta7.1" +# ARCH is any of +# +# linux +# w32 +# mac +# +# The tag is checked out of the current repository (so it should exist) +# and this is used to construct a archive with the binary of the +# selected architecture. + +CURDIR=`pwd` +echo $CURDIR + +ARCH="w32" +TAG="test" DOCDIR=doc/manual MANUAL=scyther-manual.pdf @@ -19,10 +32,12 @@ TMPDIR="/tmp" RESDIR="$TMPDIR/$DNAM" rm -rf $RESDIR -ZIPDIR=$TMPDIR -ZIPNAME=scyther-$ARCH-$TAG.zip +DESTDIR=$CURDIR + +# Where is it going to? Note without extension, this will added later +ARCHNAME=scyther-$ARCH-$TAG +DESTFILE=$DESTDIR/$ARCHNAME -rm -f $ZIPDIR/$ZIPNAME cd .. && git-archive --format=tar --prefix=$DNAM/ $TAG | (cd $TMPDIR && tar xf -) @@ -44,13 +59,31 @@ cp $RESDIR/$DOCDIR/$MANUAL $DESTDIR # Default flags CMFLAGS="-D CMAKE_BUILD_TYPE:STRING=Release" -# Make for windows and linux -cmake $CMFLAGS -D TARGETOS=Win32 . && make -#cmake $CMFLAGS . && make +if [ $ARCH = "w32" ] +then + BIN="scyther-w32.exe" + cmake $CMFLAGS -D TARGETOS=Win32 . && make + +elif [ $ARCH = "linux" ] +then + BIN="scyther-linux" + cmake $CMFLAGS . && make + +elif [ $ARCH = "mac" ] +then + # Make for ppc and intel, and combine into universal binary + BIN="scyther-mac" + cmake $CMFLAGS -D TARGETOS=MacPPC . && make + cmake $CMFLAGS -D TARGETOS=MacIntel . && make + cmake $CMFLAGS . && make scyther-mac +else + echo "Don't know this architecture $ARCH" + exit +fi BINDIR=$RESDIR/gui/Scyther/Bin mkdir $BINDIR -cp scyther-w32.exe $BINDIR +cp $BIN $BINDIR # Prepare tag for gui version echo "SCYTHER_GUI_VERSION = \"$TAG\"" >$DESTDIR/Gui/Version.py @@ -60,7 +93,21 @@ WORKNAME="scyther-$TAG" cd $RESDIR mv gui $WORKNAME -zip -r $ZIPDIR/$ZIPNAME $WORKNAME +# Compress the result into an archive +if [ $ARCH = "w32" ] +then + DESTARCH=$DESTFILE.zip + rm -f $DESTARCH + zip -r $DESTARCH $WORKNAME + +elif [ $ARCH = "linux" || $ARCH = "mac" ] +then + DESTARCH=$DESTFILE.tgz + rm -f $DESTARCH + tar zcvf $DESTARCH $WORKNAME +fi + +# Remove the temporary working directory rm -rf $RESDIR From c90ac432a584fbb0bb09a8292935d86dacc83ed2 Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Sun, 20 May 2007 13:17:17 +0200 Subject: [PATCH 03/13] - Added some patterns to ignore. --- dist/.gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 dist/.gitignore diff --git a/dist/.gitignore b/dist/.gitignore new file mode 100644 index 0000000..83a4895 --- /dev/null +++ b/dist/.gitignore @@ -0,0 +1,3 @@ +scyther*.zip +scyther*.tgz +*.swp From e1d0e0f2731b4ccaf79bb124b5f14402693c4688 Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Sun, 20 May 2007 13:43:11 +0200 Subject: [PATCH 04/13] - Rewrote script to be more clear about the used locations. --- dist/gitdist.sh | 75 +++++++++++++++++++++++++------------------------ 1 file changed, 39 insertions(+), 36 deletions(-) diff --git a/dist/gitdist.sh b/dist/gitdist.sh index e903c51..686d20e 100755 --- a/dist/gitdist.sh +++ b/dist/gitdist.sh @@ -24,38 +24,45 @@ echo $CURDIR ARCH="w32" TAG="test" -DOCDIR=doc/manual -MANUAL=scyther-manual.pdf - -DNAM="scyther-$TAG" -TMPDIR="/tmp" -RESDIR="$TMPDIR/$DNAM" -rm -rf $RESDIR - -DESTDIR=$CURDIR - -# Where is it going to? Note without extension, this will added later +# Note without extension, this will added later ARCHNAME=scyther-$ARCH-$TAG + +# Directory locations +DESTDIR=$CURDIR +TMPDIR="/tmp" +SRCNAME=$ARCHNAME-src + +# Hard coded connections, do not change this (hardcoded in git-archive +# usage and archive creation) +SRCDIR=$TMPDIR/$SRCNAME +BUILDDIR=$TMPDIR/$ARCHNAME + +# Archive destination file without extension DESTFILE=$DESTDIR/$ARCHNAME +# Internal locations +DOCDIR=$SRCDIR/doc/manual +MANUAL=scyther-manual.pdf -cd .. && git-archive --format=tar --prefix=$DNAM/ $TAG | (cd $TMPDIR && tar xf -) +rm -rf $SRCDIR +rm -rf $BUILDDIR -ls $RESDIR +# Change into the lower directory (main archive dir) +cd .. && git-archive --format=tar --prefix=$SRCNAME/ $TAG | (cd $TMPDIR && tar xf -) -# Windows binary -cd $RESDIR/src - -# Where is stuff going to -DESTDIR=$RESDIR/gui +# Base of the package is the gui directory +mv $SRCDIR/gui $BUILDDIR # Prepare version.h with the correct flag (tag) -echo "#define SVNVERSION \"Unknown\"" >$RESDIR/src/version.h -echo "#define TAGVERSION \"$TAG\"" >>$RESDIR/src/version.h -echo "" >>$RESDIR/src/version.h +echo "#define SVNVERSION \"Unknown\"" >$SRCDIR/src/version.h +echo "#define TAGVERSION \"$TAG\"" >>$SRCDIR/src/version.h +echo "" >>$SRCDIR/src/version.h # Manual -cp $RESDIR/$DOCDIR/$MANUAL $DESTDIR +cp $DOCDIR/$MANUAL $BUILDDIR + +# Change into sources directory +cd $SRCDIR/src # Default flags CMFLAGS="-D CMAKE_BUILD_TYPE:STRING=Release" @@ -81,33 +88,29 @@ else exit fi -BINDIR=$RESDIR/gui/Scyther/Bin +# Copy the resulting binary to the correct location +BINDIR=$BUILDDIR/Scyther/Bin mkdir $BINDIR cp $BIN $BINDIR # Prepare tag for gui version -echo "SCYTHER_GUI_VERSION = \"$TAG\"" >$DESTDIR/Gui/Version.py +echo "SCYTHER_GUI_VERSION = \"$TAG\"" >$BUILDDIR/Gui/Version.py -# Make archive out of the result -WORKNAME="scyther-$TAG" -cd $RESDIR -mv gui $WORKNAME - -# Compress the result into an archive +# Compress the whole thing into an archive +cd $TMPDIR if [ $ARCH = "w32" ] then DESTARCH=$DESTFILE.zip rm -f $DESTARCH - zip -r $DESTARCH $WORKNAME - -elif [ $ARCH = "linux" || $ARCH = "mac" ] -then + zip -r $DESTARCH $ARCHNAME +else DESTARCH=$DESTFILE.tgz rm -f $DESTARCH - tar zcvf $DESTARCH $WORKNAME + tar zcvf $DESTARCH $ARCHNAME fi # Remove the temporary working directory -rm -rf $RESDIR +rm -rf $BUILDDIR +rm -rf $SRCDIR From 2279190b18ab21c93c494bb8cf3d87eeedbab2fa Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Sun, 20 May 2007 14:13:38 +0200 Subject: [PATCH 05/13] - Fixed usage explanation, and added tests for valid tag/arch --- dist/gitdist.sh | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/dist/gitdist.sh b/dist/gitdist.sh index 686d20e..0ba1a48 100755 --- a/dist/gitdist.sh +++ b/dist/gitdist.sh @@ -18,16 +18,43 @@ # and this is used to construct a archive with the binary of the # selected architecture. -CURDIR=`pwd` -echo $CURDIR +if [ "x$1" = "x" -o "x$2" = "x" ] +then + echo + echo "Scyther binary distribution generator." + echo + echo " Usage: $0 " + echo + echo "where is one of linux,w32,mac" + echo "and is any tag in the current git repository." + echo + exit +fi -ARCH="w32" -TAG="test" +ARCH=$1 +if [ "x$ARCH" = "xlinux" -o "x$ARCH" = "xw32" -o "x$ARCH" = "xmac" ] +then + echo "Architecture $ARCH detected." +else + echo "Don't know architecture $ARCH" + exit +fi + +TAG=$2 +FOUND=`git-tag -l $TAG` +if [ "x$TAG" = "x$FOUND" ] +then + echo "Tag $TAG found." +else + echo "Don't know tag $TAG" + exit +fi # Note without extension, this will added later ARCHNAME=scyther-$ARCH-$TAG # Directory locations +CURDIR=`pwd` DESTDIR=$CURDIR TMPDIR="/tmp" SRCNAME=$ARCHNAME-src @@ -83,9 +110,6 @@ then cmake $CMFLAGS -D TARGETOS=MacPPC . && make cmake $CMFLAGS -D TARGETOS=MacIntel . && make cmake $CMFLAGS . && make scyther-mac -else - echo "Don't know this architecture $ARCH" - exit fi # Copy the resulting binary to the correct location From d0ee59521aab8cbc3b55996d95fd3b71f37c4b5b Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Sun, 20 May 2007 16:00:14 +0200 Subject: [PATCH 06/13] - Removed obsolete files for new versions. --- dist/NewVersion.txt | 7 ---- dist/makedist.sh | 82 --------------------------------------------- 2 files changed, 89 deletions(-) delete mode 100644 dist/NewVersion.txt delete mode 100755 dist/makedist.sh diff --git a/dist/NewVersion.txt b/dist/NewVersion.txt deleted file mode 100644 index ccec53b..0000000 --- a/dist/NewVersion.txt +++ /dev/null @@ -1,7 +0,0 @@ -Where are the version numbers? (way too distributed) - -- Gui has a version number in Version.py. This is propagated into the - binary and into the archive name as well. -- ChangeLog -- Readme.txt - diff --git a/dist/makedist.sh b/dist/makedist.sh deleted file mode 100755 index d86e3bb..0000000 --- a/dist/makedist.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/sh -#------------------------------------------------------------------------------ -# -# makedist.sh -# -# Make a Scyther distribution of the most recent revision. -# -# -# A distribution is a directory -# -# scyther/ -# - everything from ../gui -# SPORE/ -# - spore files -# - -#------------------------------------------------------------------------------ -# -# Parameters - -# Creates a temporary subdirectory here. -TMPDIR=/tmp/scytherdist -WORKNAME=scyther - -# Repository -PROTROOT=https://svn.win.tue.nl/repos/scyther/trunk/spdl -SVNROOT=https://svn.win.tue.nl/repos/scyther/trunk -DOCROOT=https://svn.win.tue.nl/repos/scyther/trunk/manual - -MANUAL=scyther-manual.pdf - -#------------------------------------------------------------------------------ -# -# Derived things - -WORKDIR=$TMPDIR/$WORKNAME -CURDIR=$PWD -DOCDEST=$WORKDIR/doc - -#------------------------------------------------------------------------------ -# -# Init - -# Remove old remnants and create a new directory -rm -f $DEST -rm -f $ZIPDEST -rm -rf $TMPDIR -mkdir $TMPDIR - -#------------------------------------------------------------------------------ -# -# Collect required data and set up - - -# Fill -svn export $SVNROOT/gui $WORKDIR -svn export $PROTROOT/SPORE $WORKDIR/SPORE - -svn cat $DOCROOT/$MANUAL >$WORKDIR/$MANUAL - -#------------------------------------------------------------------------------ -# -# Collected all needed data, finish up - -TAGVERSION=`awk 'BEGIN { FS="\""; } { print $2; }' ../gui/Gui/Version.py` -RELEASE="scyther-$TAGVERSION" - -ARCHIVE="$RELEASE.tgz" -ZIPPED="$RELEASE.zip" -DEST=$PWD/$ARCHIVE -ZIPDEST=$PWD/$ZIPPED - -# Compress -cd $TMPDIR -tar zcvf $DEST $WORKNAME -zip -r $ZIPDEST $WORKNAME - -# Remove garbage -rm -rf $TMPDIR - -#------------------------------------------------------------------------------ -# Done. From db78b7f941a2d3399ec9f8910c7eebe958d9838e Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Sun, 20 May 2007 16:00:41 +0200 Subject: [PATCH 07/13] - Added some further explanations for users of the dist script if the tag/arch is not found. --- dist/gitdist.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dist/gitdist.sh b/dist/gitdist.sh index 0ba1a48..153e0d4 100755 --- a/dist/gitdist.sh +++ b/dist/gitdist.sh @@ -36,7 +36,8 @@ if [ "x$ARCH" = "xlinux" -o "x$ARCH" = "xw32" -o "x$ARCH" = "xmac" ] then echo "Architecture $ARCH detected." else - echo "Don't know architecture $ARCH" + echo "Don't know architecture $ARCH." + echo "Please use one of linux,w32,mac" exit fi @@ -46,7 +47,8 @@ if [ "x$TAG" = "x$FOUND" ] then echo "Tag $TAG found." else - echo "Don't know tag $TAG" + echo "Don't know tag $TAG, please select one from below:" + git-tag -l exit fi From f56a10646fdb2727e842d36514347fb71b6fde6d Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Sun, 20 May 2007 16:08:56 +0200 Subject: [PATCH 08/13] Got rid of obsolete version number encoding. The old version numbers were retrieved from SVN; of course this no longer works. Now no versions are retrieved on normal building. Instead, this is covered by the dist building script. --- src/CMakeLists.txt | 3 - src/SVNVersion.cmake | 58 -- src/Scyther.dev | 789 ---------------------------- src/subbuild-version-information.sh | 19 - src/switches.c | 5 +- src/version.h | 1 + 6 files changed, 2 insertions(+), 873 deletions(-) delete mode 100644 src/SVNVersion.cmake delete mode 100644 src/Scyther.dev delete mode 100755 src/subbuild-version-information.sh create mode 100644 src/version.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index aaf8a91..5b66766 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -24,9 +24,6 @@ set (Scyther_sources # If we are in a debug mode we want to be strict set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -DDEBUG") -# Determine version number -include (SVNVersion.cmake) - # Make scanner and parser include (ScannerParser.cmake) diff --git a/src/SVNVersion.cmake b/src/SVNVersion.cmake deleted file mode 100644 index a8350af..0000000 --- a/src/SVNVersion.cmake +++ /dev/null @@ -1,58 +0,0 @@ -################################################################ -# Name: SVNVersion.cmake -# Purpose: Determine subversion revision id for Scyther -# and write it into a macro in version.h -# Author: Cas Cremers -################################################################ - -# Technically, this only needs to be redone each time a file -# changes, so this is a target with dependencies on all files. - -# Checkout version info -find_program (SVNVERSION_EXECUTABLE NAMES svnversion) -mark_as_advanced (SVNVERSION_EXECUTABLE) -mark_as_advanced (SVNVERSION_DYNAMIC) -set (SVNVERSION_DYNAMIC false) -if (SVNVERSION_EXECUTABLE) - # test whether svnversion gives useful info - execute_process ( - COMMAND ${SVNVERSION_EXECUTABLE} --no-newline - OUTPUT_VARIABLE SVN_Result - ) - mark_as_advanced (SVN_Result) - if (NOT ${SVN_Result} STREQUAL "exported") - # svnversion gives useful stuff - ## write to file - #file (WRITE version.h "#define SVNVERSION \"${SVN_Result}\"\n") - set (SVNVERSION_DYNAMIC true) - endif (NOT ${SVN_Result} STREQUAL "exported") - mark_as_advanced (SVNDIR) -endif (SVNVERSION_EXECUTABLE) - -# If dynamic generation is required, this means another target in the -# makefile -if (SVNVERSION_DYNAMIC) - # add a command to generate version.h - message (STATUS "Generating version.h dynamically using svnversion command") - add_custom_command ( - OUTPUT version.h - # The version number depends on all the files; if they - # don't change, neither should the version number - # (although this might be incorrect when updating the - # current directory) - DEPENDS ${Scyther_sources} - DEPENDS .svn - COMMAND ./subbuild-version-information.sh - COMMENT "Generating subversion and tag version information in version.h using svnversion command" - ) -else (SVNVERSION_DYNAMIC) - # Don't dynamically generate, simply empty every time - file (WRITE version.h "#define SVNVERSION \"Unknown\"\n#define TAGVERSION \"Unknown\"") -endif (SVNVERSION_DYNAMIC) - -# add the version number to the sources -set_source_files_properties(version.h - PROPERTIES - GENERATED true) -set (Scyther_sources ${Scyther_sources} version.h) - diff --git a/src/Scyther.dev b/src/Scyther.dev deleted file mode 100644 index c50735f..0000000 --- a/src/Scyther.dev +++ /dev/null @@ -1,789 +0,0 @@ -[Project] -FileName=Scyther.dev -Name=Scyther -UnitCount=72 -Type=1 -Ver=1 -ObjFiles= -Includes= -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler= -CppCompiler= -Linker= -IsCpp=0 -Icon= -ExeOutput=..\gui\Scyther -ObjectOutput= -OverrideOutput=0 -OverrideOutputName=Scyther.exe -HostApplication= -Folders= -CommandLine= -UseCustomMakefile=0 -CustomMakefile= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000000 - -[Unit1] -FileName=xmlout.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit2] -FileName=arachne.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit3] -FileName=arachne.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit4] -FileName=binding.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit5] -FileName=binding.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit6] -FileName=claim.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit7] -FileName=claim.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit8] -FileName=color.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit9] -FileName=color.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit10] -FileName=compiler.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit11] -FileName=compiler.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit12] -FileName=cost.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit13] -FileName=cost.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit14] -FileName=debug.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit15] -FileName=debug.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit16] -FileName=depend.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit17] -FileName=depend.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit18] -FileName=dotout.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit19] -FileName=dotout.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit20] -FileName=error.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit21] -FileName=error.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit22] -FileName=heuristic.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit23] -FileName=heuristic.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit24] -FileName=hidelevel.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit25] -FileName=hidelevel.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit26] -FileName=intruderknowledge.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit27] -FileName=intruderknowledge.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit28] -FileName=knowledge.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit29] -FileName=knowledge.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit30] -FileName=label.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit31] -FileName=label.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit32] -FileName=list.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit33] -FileName=list.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit35] -FileName=mgu.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit36] -FileName=pheading.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit37] -FileName=prune_bounds.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit38] -FileName=prune_bounds.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit39] -FileName=prune_theorems.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit40] -FileName=prune_theorems.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit41] -FileName=role.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit42] -FileName=role.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit43] -FileName=specialterm.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit44] -FileName=specialterm.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit45] -FileName=states.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit46] -FileName=states.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit48] -FileName=switches.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit49] -FileName=symbol.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit50] -FileName=symbol.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit51] -FileName=system.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit52] -FileName=system.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit53] -FileName=tac.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit54] -FileName=tac.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit55] -FileName=term.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit56] -FileName=term.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit57] -FileName=termlist.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit58] -FileName=termlist.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit59] -FileName=termmap.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit60] -FileName=termmap.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit61] -FileName=timer.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit62] -FileName=timer.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit63] -FileName=type.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit64] -FileName=type.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit65] -FileName=warshall.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit66] -FileName=warshall.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit67] -FileName=xmlout.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit68] -FileName=main.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit69] -FileName=version.h -CompileCpp=0 -Folder= -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit70] -FileName=parser.h -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit71] -FileName=scanner.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Developed using the Dev-C++ IDE -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - -[Unit34] -FileName=mgu.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit72] -FileName=parser.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit73] -FileName=scanner.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit74] -FileName=parser.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - -[Unit47] -FileName=switches.c -CompileCpp=0 -Folder=Scyther -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - diff --git a/src/subbuild-version-information.sh b/src/subbuild-version-information.sh deleted file mode 100755 index 843815e..0000000 --- a/src/subbuild-version-information.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# -# Arguments: -# -# svnversion executable path -# - -SVNVERSION=`svnversion` -TAGVERSION=`awk 'BEGIN { FS="\""; } { print $2; }' ../gui/Gui/Version.py` - -echo $SVNVERSION -echo $TAGVERSION - -# Fix svnversion information -echo "#define SVNVERSION \"$SVNVERSION\"" >version.h -# Fix version tag -echo "#define TAGVERSION \"$TAGVERSION\"" >>version.h - - diff --git a/src/switches.c b/src/switches.c index 5b4ac9f..6e0bd68 100644 --- a/src/switches.c +++ b/src/switches.c @@ -1247,10 +1247,7 @@ switcher (const int process, int index, int commandline) if (switches.expert) { #ifdef DEBUG - printf ("Revision %s, compiled with debugging support.\n", - SVNVERSION); -#else - printf ("Revision %s\n", SVNVERSION); + printf ("Compiled with debugging support.\n"); #endif } printf ("Code by Cas Cremers\n"); diff --git a/src/version.h b/src/version.h new file mode 100644 index 0000000..9eb79b0 --- /dev/null +++ b/src/version.h @@ -0,0 +1 @@ +#define TAGVERSION "unknown" From db78f91af1cbcdc0e37753773e9126a482e34ad5 Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Sun, 20 May 2007 16:14:40 +0200 Subject: [PATCH 09/13] Fixed version information updates of both the compiled code as well as the Gui. --- dist/gitdist.sh | 9 ++++----- gui/Gui/Version.py | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/dist/gitdist.sh b/dist/gitdist.sh index 153e0d4..c7b8043 100755 --- a/dist/gitdist.sh +++ b/dist/gitdist.sh @@ -82,9 +82,11 @@ cd .. && git-archive --format=tar --prefix=$SRCNAME/ $TAG | (cd $TMPDIR && tar x # Base of the package is the gui directory mv $SRCDIR/gui $BUILDDIR +# Prepare tag for gui version +echo "SCYTHER_GUI_VERSION = \"$TAG\"" >$BUILDDIR/Gui/Version.py + # Prepare version.h with the correct flag (tag) -echo "#define SVNVERSION \"Unknown\"" >$SRCDIR/src/version.h -echo "#define TAGVERSION \"$TAG\"" >>$SRCDIR/src/version.h +echo "#define TAGVERSION \"$TAG\"" >$SRCDIR/src/version.h echo "" >>$SRCDIR/src/version.h # Manual @@ -119,9 +121,6 @@ BINDIR=$BUILDDIR/Scyther/Bin mkdir $BINDIR cp $BIN $BINDIR -# Prepare tag for gui version -echo "SCYTHER_GUI_VERSION = \"$TAG\"" >$BUILDDIR/Gui/Version.py - # Compress the whole thing into an archive cd $TMPDIR if [ $ARCH = "w32" ] diff --git a/gui/Gui/Version.py b/gui/Gui/Version.py index b4a78dc..720884f 100644 --- a/gui/Gui/Version.py +++ b/gui/Gui/Version.py @@ -1 +1 @@ -SCYTHER_GUI_VERSION = "1.0-beta7" +SCYTHER_GUI_VERSION = "Unknown" From 38f1bffceff6261a2d93ab30a9650c1e807ed038 Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Mon, 21 May 2007 13:21:49 +0200 Subject: [PATCH 10/13] - Reverted version of beta7 for testing. --- gui/Gui/Scytherthread.py | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/gui/Gui/Scytherthread.py b/gui/Gui/Scytherthread.py index bc9354e..25d61f4 100644 --- a/gui/Gui/Scytherthread.py +++ b/gui/Gui/Scytherthread.py @@ -211,17 +211,28 @@ class AttackThread(threading.Thread): # command to write to temporary file (fd2,fpname2) = Tempfile.tempcleaned(ext) f = os.fdopen(fd2,'w') - (fd3,fpname3) = Tempfile.tempcleaned(ext) - dotfile = os.fdopen(fd3,'w') - self.writeGraph(attack.scytherDot,dotfile) - dotfile.flush() - dotfile.seek(0) - cmd = "dot -T%s -o%s %s" % (type,fpname2,fpname3) + cmd = "dot -T%s" % (type) + + # execute command + cin,cout = os.popen2(cmd,'b') + + self.writeGraph(attack.scytherDot,cin) + cin.close() + + for l in cout.read(): + f.write(l) + + cout.close() + f.flush() + f.close() + + + cmd = ["dot","-T %s" % type, "-o %s" % fpname2, fpname3 ] # execute command # Start the process - safeCommand(cmd) + safeCommand(cmdlist) # if this is done, store and report attack.filetype = type From 38a5d04c8c268f9cc85aa2fdd544ea5a9bc5805a Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Mon, 21 May 2007 13:32:57 +0200 Subject: [PATCH 11/13] - Fix to the reverter. --- gui/Gui/Scytherthread.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/gui/Gui/Scytherthread.py b/gui/Gui/Scytherthread.py index 25d61f4..832c8dc 100644 --- a/gui/Gui/Scytherthread.py +++ b/gui/Gui/Scytherthread.py @@ -227,13 +227,6 @@ class AttackThread(threading.Thread): f.flush() f.close() - - cmd = ["dot","-T %s" % type, "-o %s" % fpname2, fpname3 ] - - # execute command - # Start the process - safeCommand(cmdlist) - # if this is done, store and report attack.filetype = type attack.file = fpname2 # this is where the file name is stored From 461895555b53352bf7a262f68e81be05665bdaee Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Mon, 21 May 2007 13:24:19 +0200 Subject: [PATCH 12/13] - Removed Bin subdirectory and updates scripts. --- dist/gitdist.sh | 3 +-- gui/Scripts/scytherview.py | 2 +- gui/Scyther/__init__.py | 2 +- src/copy2gui.sh | 6 +++--- src/subbuild-mac-universal.sh | 2 +- src/subbuild-unix-both.sh | 4 ++-- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/dist/gitdist.sh b/dist/gitdist.sh index 0ba1a48..627ef25 100755 --- a/dist/gitdist.sh +++ b/dist/gitdist.sh @@ -113,8 +113,7 @@ then fi # Copy the resulting binary to the correct location -BINDIR=$BUILDDIR/Scyther/Bin -mkdir $BINDIR +BINDIR=$BUILDDIR/Scyther/ cp $BIN $BINDIR # Prepare tag for gui version diff --git a/gui/Scripts/scytherview.py b/gui/Scripts/scytherview.py index 5315bd4..fe235ef 100755 --- a/gui/Scripts/scytherview.py +++ b/gui/Scripts/scytherview.py @@ -34,7 +34,7 @@ def scyther_to_dotfile(): """ Run Scyther, return dotfile name """ mydir = os.path.dirname(__file__) - scythername = os.path.join(mydir, "../Scyther/Bin/scyther-linux") + scythername = os.path.join(mydir, "../Scyther/scyther-linux") args = " ".join(sys.argv[1:]) tmpdotfile = generateTemp('dot') diff --git a/gui/Scyther/__init__.py b/gui/Scyther/__init__.py index c2b35da..8b81dc6 100644 --- a/gui/Scyther/__init__.py +++ b/gui/Scyther/__init__.py @@ -7,6 +7,6 @@ import Scyther import os.path -bindir = os.path.join(__path__[0],"Bin") +bindir = __path__[0] Scyther.setBinDir(bindir) diff --git a/src/copy2gui.sh b/src/copy2gui.sh index c4ffda6..bc07119 100755 --- a/src/copy2gui.sh +++ b/src/copy2gui.sh @@ -1,8 +1,8 @@ #!/bin/sh -cp scyther-linux ../gui/Scyther/Bin -cp scyther-w32.exe ../gui/Scyther/Bin -cp scyther-mac ../gui/Scyther/Bin +cp scyther-linux ../gui/Scyther/ +cp scyther-w32.exe ../gui/Scyther/ +cp scyther-mac ../gui/Scyther/ # bonus... cp scyther-linux ~/bin diff --git a/src/subbuild-mac-universal.sh b/src/subbuild-mac-universal.sh index 96f612f..bec0289 100755 --- a/src/subbuild-mac-universal.sh +++ b/src/subbuild-mac-universal.sh @@ -14,7 +14,7 @@ echo "---------------------------------------------------------" echo "Built the Mac universal binary" # Copy to the correct locations -cp scyther-mac ../gui/Scyther/Bin +cp scyther-mac ../gui/Scyther/ echo Copied the files to their respective locations echo "---------------------------------------------------------" diff --git a/src/subbuild-unix-both.sh b/src/subbuild-unix-both.sh index 368b361..5fb0123 100755 --- a/src/subbuild-unix-both.sh +++ b/src/subbuild-unix-both.sh @@ -13,8 +13,8 @@ echo "---------------------------------------------------------" echo "Built the Linux and Windows binaries" # Copy to the correct locations -cp scyther-linux ../gui/Scyther/Bin -cp scyther-w32.exe ../gui/Scyther/Bin +cp scyther-linux ../gui/Scyther/ +cp scyther-w32.exe ../gui/Scyther/ # bonus... cp scyther-linux ~/bin From a09cf686f9e7cb47127f41c3563c8f5e279fcaf3 Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Mon, 21 May 2007 13:25:25 +0200 Subject: [PATCH 13/13] - Modified explanation too. --- gui/scyther-gui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/scyther-gui.py b/gui/scyther-gui.py index f04bd09..4a283d2 100755 --- a/gui/scyther-gui.py +++ b/gui/scyther-gui.py @@ -15,7 +15,7 @@ Please install this package in order to use the graphical user interface of Scyther. The [wxPython] packages can be found at http://www.wxpython.org/ -Note that you can still use the Scyther binaries in the 'Bin' directory. +Note that you can still use the Scyther binaries in the 'Scyther' directory. """ sys.exit(1) import os