Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated so that a checkout/tag is not needed for release

  • Loading branch information...
commit 2668184b032ef2068da1a5fc26bfe7fc9419f9cb 1 parent bb7c1d7
@bcarrier bcarrier authored
Showing with 88 additions and 63 deletions.
  1. +88 −63 release/release-win.pl
View
151 release/release-win.pl
@@ -2,9 +2,8 @@
# Release script for Windows Executables. Note that this is run
# after release-unix.pl, which will create the needed tag directories
-# and update the version variables accordingly. This assumes that you
-# have been building TSK with libewf on your system in one of the trunk
-# or branch directories and it will copy libewf from there.
+# and update the version variables accordingly. This assumes that
+# libewf has been compiled in LIBEWF_HOME
#
#
# This requires Cygwin with:
@@ -21,6 +20,43 @@
print "TESTING MODE (no commits)\n" if ($TESTING);
+
+unless (@ARGV == 1) {
+ print stderr "Missing arguments: tag_version\n";
+ print stderr " for example: release-win.pl sleuthkit-3.1.0\n";
+ print stderr " or to use current working code: release-win.pl no-tag\n";
+ die "stopping";
+
+}
+
+
+
+my $RELDIR = `pwd`; # The release directory
+chomp $RELDIR;
+my $SVNDIR = "$RELDIR/../";
+my $TSKDIR = "${SVNDIR}";
+
+my $TAGNAME = $ARGV[0];
+my $VER = "";
+
+
+my $BUILD_LOC = `which vcbuild`;
+chomp $BUILD_LOC;
+die "Unsupported build system. Verify redist location"
+ unless ($BUILD_LOC =~ /Visual Studio 9\.0/);
+
+my $REDIST_LOC = $BUILD_LOC . "/../../redist/x86/Microsoft.VC90.CRT";
+die "Missing redist dir $REDIST_LOC" unless (-d "$REDIST_LOC");
+
+
+# Verify LIBEWF is built
+die "LIBEWF missing" unless (-d "$ENV{'LIBEWF_HOME'}");
+die "libewf dll missing"
+ unless (-e "$ENV{'LIBEWF_HOME'}/msvscpp/release/libewf.dll" );
+
+
+#######################
+
# Function to execute a command and send output to pipe
# returns handle
# exec_pipe(HANDLE, CMD);
@@ -56,80 +92,66 @@ sub read_pipe_line {
+############## CODE SPECIFIC STUFF ##########
-unless (@ARGV == 1) {
- print stderr "Missing arguments: tag_version\n";
- print stderr " for example: release-win.pl sleuthkit-3.1.0\n";
- die "stopping";
-}
-
-
-my $RELDIR = `pwd`; # The release directory
-chomp $RELDIR;
-my $SVNDIR = "$RELDIR/../";
-my $TAGNAME = $ARGV[0];
-my $TSKDIR = "${SVNDIR}";
+# Checkout a specific tag
+# Starts and ends in sleuthkit
+sub update_code {
+ my $no_tag = 0;
+ $no_tag = 1 if ($TAGNAME eq "no-tag");
-my $BUILD_LOC = `which vcbuild`;
-chomp $BUILD_LOC;
-die "Unsupported build system. Verify redist location"
- unless ($BUILD_LOC =~ /Visual Studio 9\.0/);
-my $REDIST_LOC = $BUILD_LOC . "/../../redist/x86/Microsoft.VC90.CRT";
-die "Missing redist dir $REDIST_LOC" unless (-d "$REDIST_LOC");
+ if ($no_tag == 0) {
+ # Make sure we have no changes in the current tree
+ exec_pipe(*OUT, "git status -s | grep \"^ M\"");
+ my $foo = read_pipe_line(*OUT);
+ if ($foo ne "") {
+ print "Changes stil exist in current repository -- commit them\n";
+ die "stopping";
+ }
+ # Make sure src dir is up to date
+ print "Updating source directory\n";
+ `git pull`;
+ `git submodule update`;
+ `git submodule foreach git checkout master`;
+
+ # Verify the tag exists
+ exec_pipe(*OUT, "git tag | grep \"${TAGNAME}\"");
+ my $foo = read_pipe_line(*OUT);
+ if ($foo eq "") {
+ print "Tag ${TAGNAME} doesn't exist\n";
+ die "stopping";
+ }
+ close(OUT);
-#######################
-# Build the execs
-
-# Make sure we have no changes in the current tree
-exec_pipe(*OUT, "git status -s | grep \"^ M\"");
-my $foo = read_pipe_line(*OUT);
-if ($foo ne "") {
- print "Changes stil exist in current repository -- commit them\n";
- die "stopping";
-}
+ `git checkout -q ${TAGNAME}`;
+ }
-# Make sure src dir is up to date
-print "Updating source directory\n";
-chdir ("$TSKDIR") or die "Error changing to TSK dir $TSKDIR";
-`git pull`;
-`git submodule update`;
-`git submodule foreach git checkout master`;
-
-# Verify the tag exists
-exec_pipe(*OUT, "git tag | grep \"${TAGNAME}\"");
-my $foo = read_pipe_line(*OUT);
-if ($foo eq "") {
- print "Tag ${TAGNAME} doesn't exist\n";
- die "stopping";
-}
-close(OUT);
-`git checkout -q ${TAGNAME}`;
+ # Parse the config file to get the version number
+ open (IN, "<configure.ac") or die "error opening configure.ac to get version";
+ $VER = "";
+ while (<IN>) {
+ if (/^AC_INIT\(sleuthkit, ([\d\w\.]+)\)/) {
+ $VER = $1;
+ last;
+ }
+ }
+ die "Error finding version in configure.ac" if ($VER eq "");
+ print "Version found in configure.ac: $VER\n";
-# Parse the config file to get the version number
-open (IN, "<configure.ac") or die "error opening configure.ac to get version";
-my $VER = "";
-while (<IN>) {
- if (/^AC_INIT\(sleuthkit, ([\d\w\.]+)\)/) {
- $VER = $1;
- last;
+ if ($no_tag == 0) {
+ die "tag name and configure.ac have different versions ($TAGNAME vs $VER)"
+ if ("sleuthkit-".$VER != $TAGNAME);
}
+
}
-die "Error finding version in configure.ac" if ($VER eq "");
-print "Version found in configure.ac: $VER\n";
-die "tag name and configure.ac have different versions ($TAGNAME vs $VER)"
- if ("sleuthkit-".$VER != $TAGNAME);
-# Verify LIBEWF is built
-die "LIBEWF missing" unless (-d "$ENV{'LIBEWF_HOME'}");
-die "libewf dll missing"
- unless (-e "$ENV{'LIBEWF_HOME'}/msvscpp/release/libewf.dll" );
-
+# Compile Core TSK
# Starts and ends in sleuthkit
sub build_core {
print "Building TSK source\n";
@@ -322,6 +344,9 @@ sub package_framework {
chdir "..";
}
+chdir ("$TSKDIR") or die "Error changing to TSK dir $TSKDIR";
+
+update_code();
build_core();
package_core();
build_framework();
Please sign in to comment.
Something went wrong with that request. Please try again.