Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Loic
tools
Commits
b09406e3
Commit
b09406e3
authored
Jan 18, 2019
by
Oliver Pinter
Browse files
HBSD: add basic error handling
Signed-off-by:
Oliver Pinter
<
oliver.pinter@hardenedbsd.org
>
parent
cfa32540
Changes
1
Hide whitespace changes
Inline
Side-by-side
release/git/update_meta.py
View file @
b09406e3
...
...
@@ -5,11 +5,21 @@ import os.path
cwd
=
os
.
path
.
basename
(
os
.
getcwd
())
with
open
(
"CHECKSUM.SHA512"
,
"r"
)
as
f
:
checksum
=
f
.
read
()
with
open
(
"CHECKSUM.SHA512.asc"
,
"r"
)
as
f
:
signature
=
f
.
read
()
try
:
with
open
(
"CHECKSUM.SHA512"
,
"r"
)
as
f
:
checksum
=
f
.
read
()
update_checksum
=
True
except
:
print
(
"missing CHECKSUM.SHA512 file!"
)
update_checksum
=
False
try
:
with
open
(
"CHECKSUM.SHA512.asc"
,
"r"
)
as
f
:
signature
=
f
.
read
()
update_signature
=
True
except
:
print
(
"missing CHECKSUM.SHA512.asc file!"
)
update_signature
=
False
with
open
(
"drupal-{version}.template"
.
format
(
version
=
cwd
),
"r"
)
as
f
:
drupal_template
=
f
.
read
()
...
...
@@ -34,17 +44,17 @@ github_text = "\n".join(github_formatted_lines)
drupal_text
=
"
\n
"
.
join
(
drupal_formatted_lines
)
with
open
(
"drupal-{version}.txt"
.
format
(
version
=
cwd
),
"w+"
)
as
f
:
drupal
=
(
drupal_template
.
replace
(
"%%NOTES%%"
,
drupal_text
)
.
replace
(
"%%CHECKSUM%%"
,
checksum
)
.
replace
(
"%%SIGNATURE%%"
,
signature
)
)
drupal
=
drupal_template
.
replace
(
"%%NOTES%%"
,
drupal_text
)
if
update_checksum
:
drupal
=
drupal
.
replace
(
"%%CHECKSUM%%"
,
checksum
)
if
update_
signature
:
drupal
=
drupal
.
replace
(
"%%SIGNATURE%%"
,
signature
)
f
.
write
(
drupal
)
with
open
(
"github-{version}.txt"
.
format
(
version
=
cwd
),
"w+"
)
as
f
:
github
=
(
github_template
.
replace
(
"%%NOTES%%"
,
github_text
)
.
replace
(
"%%CHECKSUM%%"
,
checksum
)
.
replace
(
"%%SIGNATURE%%"
,
signature
)
)
github
=
github_template
.
replace
(
"%%NOTES%%"
,
github_text
)
if
update_checksum
:
github
=
github
.
replace
(
"%%CHECKSUM%%"
,
checksum
)
if
update_
signature
:
github
=
github
.
replace
(
"%%SIGNATURE%%"
,
signature
)
f
.
write
(
github
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment