This repository has been archived by the owner on Sep 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 708656 - Use signing on demand for releases. r=bhearsum
--HG-- rename : scripts/l10n/release_repacks.sh => scripts/release/generate-sums.sh
- Loading branch information
Rail Aliiev
committed
Jan 18, 2012
1 parent
443ae69
commit dbeafbe
Showing
13 changed files
with
449 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import os | ||
from util.commands import run_cmd | ||
|
||
def generateChecksums(checksums_dir, sums_info): | ||
""" | ||
Generates {MD5,SHA1,etc}SUMS files using *.checksums files. | ||
@type checksums_dir: string | ||
@param checksums_dir: Directory name wich *.checksums files | ||
@type sums_info: dict | ||
@param sums_info: A dictionary which contains hash type and output file | ||
pairs. Example: {'sha1': '/tmp/SHA1SUMS', | ||
'md5': '/tmp/MD5SUMS'} | ||
""" | ||
sums = {} | ||
for hash_type in sums_info.keys(): | ||
sums[hash_type] = [] | ||
for top, dirs, files in os.walk(checksums_dir): | ||
files = [f for f in files if f.endswith('.checksums')] | ||
for f in files: | ||
fd = open(os.path.join(top, f)) | ||
for line in fd: | ||
line = line.rstrip() | ||
try: | ||
hash, hash_type, size, file_name = line.split(None, 3) | ||
except ValueError: | ||
print "Failed to parse the following line:" | ||
print line | ||
raise | ||
if sums.has_key(hash_type): | ||
sums[hash_type].append((hash, file_name)) | ||
for hash_type in sums_info.keys(): | ||
sums_file = open(sums_info[hash_type], 'w') | ||
# sort by file name | ||
for hash, file_name in sorted(sums[hash_type], key=lambda x: x[1]): | ||
sums_file.write('%s %s\n' % (hash, file_name)) | ||
sums_file.close() | ||
|
||
def signFiles(files): | ||
for f in files: | ||
run_cmd(['bash', '-c', os.environ['MOZ_SIGN_CMD'] + ' -f gpg "%s"' % f]) |
Oops, something went wrong.