diff options
| author | Aaron Bohy <aab@odoo.com> | 2014-11-26 17:45:39 +0100 |
|---|---|---|
| committer | Simon Lejeune <sle@openerp.com> | 2014-11-28 16:40:55 +0100 |
| commit | e874cdafaa9675251cd7852b8e9b1662cee7d19a (patch) | |
| tree | 0315ec13145242e63a13f3c498bfb7b82be297c8 /setup/package.py | |
| parent | 56b61da16387e642130477e604022207a77e3f74 (diff) | |
[IMP] Packaging: RedHat: sign packages with gpg key
Diffstat (limited to 'setup/package.py')
| -rwxr-xr-x | setup/package.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/setup/package.py b/setup/package.py index f803c688676..c4f2f48458f 100755 --- a/setup/package.py +++ b/setup/package.py @@ -377,6 +377,27 @@ def gen_deb_package(o, published_files): # Options -abs: -a (Create ASCII armored output), -b (Make a detach signature), -s (Make a signature) subprocess.call(['gpg', '--yes', '-abs', '-o', 'Release.gpg', 'Release'], cwd=os.path.join(o.pub, 'deb')) +#--------------------------------------------------------- +# Generates an RPM repo +#--------------------------------------------------------- +def gen_rpm_repo(o, file_name): + # Sign the RPM + subprocess.call(['rpm', '--resign', file_name], cwd=os.path.join(o.pub, 'rpm')) + + # Removes the old repodata + subprocess.call(['rm', '-rf', os.path.join(o.pub, 'rpm', 'repodata')]) + + # Copy files to a temp directory (required because the working directory must contain only the + # files of the last release) + temp_path = tempfile.mkdtemp(suffix='rpmPackages') + subprocess.call(['cp', file_name, temp_path]) + + subprocess.call(['createrepo', temp_path]) # creates a repodata folder in temp_path + subprocess.call(['cp', '-r', os.path.join(temp_path, "repodata"), os.path.join(o.pub, 'rpm')]) + + # Remove temp directory + shutil.rmtree(temp_path) + #---------------------------------------------------------- # Options and Main #---------------------------------------------------------- @@ -444,6 +465,7 @@ def main(): if not o.no_testing: test_rpm(o) published_files = publish(o, 'redhat', ['odoo.noarch.rpm']) + gen_rpm_repo(o, published_files[0]) except Exception, e: print("Won't publish the rpm release.\n Exception: %s" % str(e)) if not o.no_windows: |
