Ubuntu Pastebin

Paste from cyphermox at Thu, 13 Apr 2017 04:59:40 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/python
#
# lp-binary-url -- finds the binary package URL from Launchpad
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# See file /usr/share/common-licenses/GPL for more details.

import sys

from launchpadlib.launchpad import Launchpad

if len(sys.argv) < 4:
    print ("Usage: %s owner series project arch" % sys.argv[0])
    sys.exit(1)


launchpad = Launchpad.login_with('rebuild-livefs', "production",
                                 version="devel")
ubuntu = launchpad.distributions['ubuntu']
archive = ubuntu.main_archive
series = ubuntu.getSeries(name_or_version=sys.argv[2])
owner = launchpad.people[sys.argv[1]]
name = sys.argv[3]
arch = sys.argv[4]

if len(sys.argv) > 5:
    ppa_name = sys.argv[5]
    archive = owner.getPPAByName(name=ppa_name)

print("Using archive {}".format(archive.reference))

livefs = launchpad.livefses.getByName(name=name, distro_series=series, owner=owner)

print("Requesting ~%s build for %s (%s)" % (owner.name, name, series.name))
arch_series = series.getDistroArchSeries(archtag=arch)

livefs_build = livefs.requestBuild(archive=archive, distro_arch_series=arch_series, pocket="Release")
print ("URL: %s" % livefs_build.web_link)

sys.exit(0)
Download as text