Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7b8c5f58
Commit
7b8c5f58
authored
Apr 05, 2015
by
Steve Dower
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates Windows release scripts to generate and upload GPG signatures.
parent
79a6ccad
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
1 deletion
+56
-1
Tools/msi/generate_md5.py
Tools/msi/generate_md5.py
+27
-0
Tools/msi/uploadrelease.bat
Tools/msi/uploadrelease.bat
+9
-0
Tools/msi/uploadrelease.proj
Tools/msi/uploadrelease.proj
+20
-1
No files found.
Tools/msi/generate_md5.py
0 → 100644
View file @
7b8c5f58
import
hashlib
import
os
import
sys
def
main
():
filenames
,
hashes
,
sizes
=
[],
[],
[]
for
file
in
sys
.
argv
[
1
:]:
if
not
os
.
path
.
isfile
(
file
):
continue
with
open
(
file
,
'rb'
)
as
f
:
data
=
f
.
read
()
md5
=
hashlib
.
md5
()
md5
.
update
(
data
)
filenames
.
append
(
os
.
path
.
split
(
file
)[
1
])
hashes
.
append
(
md5
.
hexdigest
())
sizes
.
append
(
str
(
len
(
data
)))
print
(
'{:40s} {:<32s} {:<9s}'
.
format
(
'File'
,
'MD5'
,
'Size'
))
for
f
,
h
,
s
in
zip
(
filenames
,
hashes
,
sizes
):
print
(
'{:40s} {:>32s} {:>9s}'
.
format
(
f
,
h
,
s
))
if
__name__
==
"__main__"
:
sys
.
exit
(
int
(
main
()
or
0
))
Tools/msi/uploadrelease.bat
View file @
7b8c5f58
...
...
@@ -20,19 +20,28 @@ if "%1" EQU "--target" (set TARGET=%~2) && shift && shift && goto CheckOpts
if
"
%
1"
EQU
"--dry-run"
(
set
DRYRUN
=
true
)
&&
shift
&&
goto
CheckOpts
if
not
defined
PLINK
where
plink
>
"
%TEMP%
\plink.loc"
2
>
nul
&&
set
/P
PLINK
=
<
"
%TEMP%
\plink.loc"
&
del
"
%TEMP%
\plink.loc"
if
not
defined
PLINK
where
/R
"
%ProgramFiles
(x86)
%
\PuTTY"
plink
>
"
%TEMP%
\plink.loc"
2
>
nul
&&
set
/P
PLINK
=
<
"
%TEMP%
\plink.loc"
&
del
"
%TEMP%
\plink.loc"
if
not
defined
PLINK
where
/R
"
%ProgramFiles
(x86)
%
"
plink
>
"
%TEMP%
\plink.loc"
2
>
nul
&&
set
/P
PLINK
=
<
"
%TEMP%
\plink.loc"
&
del
"
%TEMP%
\plink.loc"
if
not
defined
PLINK
echo
Cannot
locate
plink
.exe
&
exit
/B
1
echo
Found
plink
.exe
at
%PLINK%
if
not
defined
PSCP
where
pscp
>
"
%TEMP%
\pscp.loc"
2
>
nul
&&
set
/P
pscp
=
<
"
%TEMP%
\pscp.loc"
&
del
"
%TEMP%
\pscp.loc"
if
not
defined
PSCP
where
/R
"
%ProgramFiles
(x86)
%
\PuTTY"
pscp
>
"
%TEMP%
\pscp.loc"
2
>
nul
&&
set
/P
pscp
=
<
"
%TEMP%
\pscp.loc"
&
del
"
%TEMP%
\pscp.loc"
if
not
defined
PSCP
where
/R
"
%ProgramFiles
(x86)
%
"
pscp
>
"
%TEMP%
\pscp.loc"
2
>
nul
&&
set
/P
pscp
=
<
"
%TEMP%
\pscp.loc"
&
del
"
%TEMP%
\pscp.loc"
if
not
defined
PSCP
echo
Cannot
locate
pscp
.exe
&
exit
/B
1
echo
Found
pscp
.exe
at
%PSCP%
if
not
defined
GPG
where
gpg2
>
"
%TEMP%
\gpg.loc"
2
>
nul
&&
set
/P
GPG
=
<
"
%TEMP%
\gpg.loc"
&
del
"
%TEMP%
\gpg.loc"
if
not
defined
GPG
where
/R
"
%PCBUILD%
..\externals"
gpg2
>
"
%TEMP%
\gpg.loc"
2
>
nul
&&
set
/P
GPG
=
<
"
%TEMP%
\gpg.loc"
&
del
"
%TEMP%
\gpg.loc"
if
not
defined
GPG
echo
Cannot
locate
gpg2
.exe
.
Signatures
will
not
be
uploaded
&
pause
echo
Found
gpg2
.exe
at
%GPG%
call
"
%PCBUILD%
env.bat"
>
nul
2
>
nul
pushd
"
%D%
"
msbuild
/v
:m
/nologo
uploadrelease
.proj
/t
:Upload
/p
:Platform
=
x86
msbuild
/v
:m
/nologo
uploadrelease
.proj
/t
:Upload
/p
:Platform
=
x64
/p
:IncludeDoc
=
false
msbuild
/v
:m
/nologo
uploadrelease
.proj
/t
:ShowHashes
/p
:Platform
=
x86
msbuild
/v
:m
/nologo
uploadrelease
.proj
/t
:ShowHashes
/p
:Platform
=
x64
/p
:IncludeDoc
=
false
popd
exit
/B
0
...
...
Tools/msi/uploadrelease.proj
View file @
7b8c5f58
...
...
@@ -38,6 +38,17 @@
<Error
Text=
"No path for PLINK provided"
Condition=
"'$(PLINK)' == ''"
/>
</Target>
<Target
Name=
"_RunGpg"
Condition=
"'$(GPG)' != ''"
Inputs=
"@(File)"
Outputs=
"$(IntermediateOutputPath)\gpg\%(FileName)%(Extension).asc"
>
<MakeDir
Directories=
"$(IntermediateOutputPath)gpg"
/>
<Delete
Files=
"$(IntermediateOutputPath)\gpg\%(File.FileName)%(File.Extension).asc"
Condition=
"Exists('$(IntermediateOutputPath)\gpg\%(File.FileName)%(File.Extension).asc')"
/>
<Exec
Command=
""$(GPG)" -ba -o "$(IntermediateOutputPath)\gpg\%(File.FileName)%(File.Extension).asc" "%(File.FullPath)""
/>
<ItemGroup>
<File
Include=
"$(IntermediateOutputPath)\gpg\%(File.FileName)%(File.Extension).asc"
>
<CopyTo>
%(File.CopyTo)
</CopyTo>
</File>
</ItemGroup>
</Target>
<Target
Name=
"_Upload"
Condition=
"!$(DryRun)"
>
<Exec
Command=
""$(PLINK)" $(User)@$(Host) mkdir %(File.CopyTo) ^&^& chgrp downloads %(File.CopyTo) ^&^& chmod g-w,o+rx %(File.CopyTo)
"$(PSCP)" @(File,' ') $(User)@$(Host):%(File.CopyTo)
...
...
@@ -53,7 +64,15 @@ echo.
echo."
/>
</Target>
<Target
Name=
"Upload"
DependsOnTargets=
"_ValidateProperties;_PrintNames;_Upload"
/>
<Target
Name=
"Upload"
DependsOnTargets=
"_ValidateProperties;_RunGpg;_PrintNames;_Upload"
/>
<Target
Name=
"ShowHashes"
>
<ItemGroup>
<UserFiles
Include=
"@(File)"
Condition=
"'%(File.CopyTo)' == '$(EXETarget)'"
/>
</ItemGroup>
<Exec
Command=
""$(PythonExe)" generate_md5.py @(UserFiles->'"%(FullPath)"',' ')"
/>
</Target>
<Target
Name=
"Build"
>
<Error
Text=
"This script should be invoked using uploadrelease.bat."
/>
...
...
Write
Preview
Markdown
is supported
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