Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sleuthkit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IRT
Sleuthkit
Commits
ba57531d
"...teknikattan-scoring-system.git" did not exist on "41d0b8e1d13d4a148d0573b63bf9cf55304b64e4"
Commit
ba57531d
authored
6 years ago
by
Brian Carrier
Browse files
Options
Downloads
Patches
Plain Diff
Added debian release script
parent
0931e420
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
release/release-deb.pl
+129
-0
129 additions, 0 deletions
release/release-deb.pl
with
129 additions
and
0 deletions
release/release-deb.pl
0 → 100755
+
129
−
0
View file @
ba57531d
#!/usr/bin/perl
# Makes deb file based on release tag
#
use
strict
;
my
$TESTING
=
0
;
print
"
TESTING MODE (no commits)
\n
"
if
(
$TESTING
);
unless
(
@ARGV
==
1
)
{
print
stderr
"
Missing arguments: version
\n
";
print
stderr
"
for example: release-deb.pl 3.1.0
\n
";
exit
(
1
);
}
my
$RELDIR
=
`
pwd
`;
# The release directory
chomp
$RELDIR
;
#my $TSKDIR = "$RELDIR/../";
my
$TSKDIR
=
"
$RELDIR
/sleuthkit/
";
my
$VER
=
$ARGV
[
0
];
my
$TAGNAME
=
"
sleuthkit-
${VER}
";
my
$TARFILE
=
"
${TSKDIR}
/../sleuthkit-java_
${VER}
.orig.tar.xz
";
my
$DEBFILE
=
"
${TSKDIR}
/../sleuthkit-java_
${VER}
-1_amd64.deb
";
die
("
ERROR:
${TARFILE}
file already exists
")
if
(
-
e
$
{
TARFILE
});
die
("
ERROR:
${DEBFILE}
file already exists
")
if
(
-
e
$
{
DEBFILE
});
#######################
# Function to execute a command and send output to pipe
# returns handle
# exec_pipe(HANDLE, CMD);
sub
exec_pipe
{
my
$handle
=
shift
(
@
_
);
my
$cmd
=
shift
(
@
_
);
die
"
Can't open pipe for exec_pipe
"
unless
defined
(
my
$pid
=
open
(
$handle
,
'
-|
'));
if
(
$pid
)
{
return
$handle
;
}
else
{
$|
=
1
;
exec
("
$cmd
")
or
die
"
Can't exec program: $!
";
}
}
# Read a line of text from an open exec_pipe handle
sub
read_pipe_line
{
my
$handle
=
shift
(
@
_
);
my
$out
;
for
(
my
$i
=
0
;
$i
<
100
;
$i
++
)
{
$out
=
<
$handle
>
;
return
$out
if
(
defined
$out
);
}
return
$out
;
}
############## CODE SPECIFIC STUFF ##########
# Checkout a specific tag
# Starts and ends in sleuthkit
sub
update_code
{
`
git reset --hard HEAD > /dev/null
`;
# 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 checkout develop
`;
`
git pull
`;
# 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}
`;
}
# Make deb
sub
build_deb
{
print
"
Running bootstrap
\n
";
`
rm configure
`;
`
./bootstrap
`;
die
("
Configure missing
")
unless
(
-
e
"
configure
");
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
});
print
"
Running debuild
\n
";
`
debuild -us -uc
`;
if
(
-
e
$
{
DEBFILE
})
{
print
"
${DEBFILE}
created
\n
";
}
else
{
die
"
deb file was not created
\n
";
}
}
##############################
chdir
("
$TSKDIR
")
or
die
"
Error changing to TSK dir
$TSKDIR
";
update_code
();
build_deb
();
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment