diff --git a/release/release-deb.pl b/release/release-deb.pl index 539f0173ff..8f582480a5 100755 --- a/release/release-deb.pl +++ b/release/release-deb.pl @@ -20,10 +20,23 @@ my $VER = $ARGV[0]; my $TAGNAME = "sleuthkit-${VER}"; -my $TARFILE = "${TSKDIR}/../sleuthkit-java_${VER}.orig.tar.xz"; + +my $TAR1FILE = "${TSKDIR}/../sleuthkit-java_${VER}.orig.tar.xz"; +my $TAR2FILE = "${TSKDIR}/../sleuthkit-java_${VER}.debian.tar.xz"; my $DEBFILE = "${TSKDIR}/../sleuthkit-java_${VER}-1_amd64.deb"; -die ("ERROR: ${TARFILE} file already exists") if (-e ${TARFILE}); +my $BUILDFILE = "${TSKDIR}/../sleuthkit-java_${VER}-1_amd64.build"; +my $BUILDINFOFILE = "${TSKDIR}/../sleuthkit-java_${VER}-1_amd64.buildinfo"; +my $CHANGESFILE = "${TSKDIR}/../sleuthkit-java_${VER}-1_amd64.changes"; +my $DSCFILE = "${TSKDIR}/../sleuthkit-java_${VER}-1.dsc"; +my $DDEBFILE = "${TSKDIR}/../sleuthkit-java-dbgsym_${VER}-1_amd64.ddeb"; + +die ("ERROR: ${TAR1FILE} file already exists") if (-e ${TAR1FILE}); +die ("ERROR: ${TAR2FILE} file already exists") if (-e ${TAR2FILE}); die ("ERROR: ${DEBFILE} file already exists") if (-e ${DEBFILE}); +die ("ERROR: ${BUILDFILE} file already exists") if (-e ${BUILDFILE}); +die ("ERROR: ${BUILDINFOFILE} file already exists") if (-e ${BUILDINFOFILE}); +die ("ERROR: ${CHANGESFILE} file already exists") if (-e ${CHANGESFILE}); +die ("ERROR: ${DSCFILE} file already exists") if (-e ${DSCFILE}); @@ -108,7 +121,7 @@ sub build_deb { print "Running 'dh_make'. Ignore messages about overwriting, and it's OK if it goes blank\n"; `dh_make --s -y -e \“info\@sleuthkit.org\” -p sleuthkit-java_${VER} --createorig`; - die ("ERROR: ${TARFILE} file not created") unless (-e ${TARFILE}); + die ("ERROR: ${TAR1FILE} file not created") unless (-e ${TAR1FILE}); print "Running debuild\n"; `debuild -us -uc`; @@ -119,6 +132,17 @@ sub build_deb { } } +sub cleanup { + print "Removing intermediate files\n"; + `rm -f $TAR1FILE`; + `rm -f $TAR2FILE`; + `rm -f $BUILDFILE`; + `rm -f $BUILDINFOFILE`; + `rm -f $CHANGESFILE`; + `rm -f $DSCFILE`; + `rm -f $DDEBFILE`; +} + ############################## @@ -126,3 +150,4 @@ sub build_deb { update_code(); build_deb(); +cleanup();