~brian-murray/ubuntu-archive-tools/add-pkg-ime-team

« back to all changes in this revision

Viewing changes to copy-proposed-kernel

  • Committer: Adam Conrad
  • Date: 2015-05-20 10:00:22 UTC
  • Revision ID: adconrad@0c3.net-20150520100022-9ifiuq3rk72xuw5m
copy-proposed-kernel: Add a --security option to copy from the security PPA

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
'''Copy a kernel from the kernel team's PPA to -proposed.
19
19
 
20
20
USAGE:
21
 
   copy-proposed-kernel <release> <sourcepackage>
 
21
   copy-proposed-kernel [--security] <release> <sourcepackage>
22
22
'''
23
23
 
24
24
from __future__ import print_function
27
27
 
28
28
from launchpadlib.launchpad import Launchpad
29
29
 
30
 
 
31
 
if len(sys.argv) != 3:
32
 
    sys.stderr.write('Usage: %s <release> <sourcepackage>\n' % sys.argv[0])
 
30
args = sys.argv[1:]
 
31
if args[0] == '--security':
 
32
    args = args[1:]
 
33
    ppa_name = '~ubuntu-security/ubuntu/ppa'
 
34
    security = True
 
35
else:
 
36
    ppa_name = '~canonical-kernel-team/ubuntu/ppa'
 
37
    security = False
 
38
if len(args) != 2:
 
39
    sys.stderr.write('Usage: %s [--security] <release> <sourcepackage>\n' % sys.argv[0])
33
40
    sys.exit(1)
34
 
(release, pkg) = sys.argv[1:]
 
41
(release, pkg) = args[0:]
35
42
 
36
43
launchpad = Launchpad.login_with(
37
44
    'ubuntu-archive-tools', 'production', version='devel')
38
45
ubuntu = launchpad.distributions['ubuntu']
39
46
distro_series = ubuntu.getSeries(name_or_version=release)
40
47
kernel_ppa = launchpad.archives.getByReference(
41
 
    reference='~canonical-kernel-team/ubuntu/ppa')
 
48
    reference=ppa_name)
42
49
 
43
50
# get current version in PPA for that series
44
51
versions = kernel_ppa.getPublishedSources(
53
60
ubuntu.getArchive(name='primary').copyPackage(
54
61
    from_archive=kernel_ppa, include_binaries=include_binaries,
55
62
    source_name=pkg, to_series=release, to_pocket='proposed', version=version,
56
 
    auto_approve=True)
 
63
    auto_approve=True, unembargo=security)
57
64
 
58
65
# TODO: adjust this script to use find-bin-overrides or rewrite
59
66
# find-bin-overrides to use lpapi and use it here.