mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-19 04:41:28 +00:00
pull-lp-source: Use launchpadlib instead of screen scraping to get and check if the Ubuntu release exists.
This commit is contained in:
parent
332b507bc2
commit
27f83c2602
@ -32,7 +32,8 @@ import sys
|
|||||||
import urllib2
|
import urllib2
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
|
|
||||||
# Ubuntu-dev-tools modules.
|
# ubuntu-dev-tools modules.
|
||||||
|
import ubuntutools.lp.functions as lp_functions
|
||||||
from ubuntutools import packages
|
from ubuntutools import packages
|
||||||
|
|
||||||
class BackportFromLP:
|
class BackportFromLP:
|
||||||
@ -58,7 +59,7 @@ class BackportFromLP:
|
|||||||
'Ensure that the package specified is a valid source ' +\
|
'Ensure that the package specified is a valid source ' +\
|
||||||
'package name and that Launchpad is not down.'
|
'package name and that Launchpad is not down.'
|
||||||
|
|
||||||
default_release = 'karmic'
|
default_release = lp_functions.ubuntuDevelopmentSeries()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
usage = "Usage: %prog <package> [release]"
|
usage = "Usage: %prog <package> [release]"
|
||||||
@ -74,9 +75,9 @@ if __name__ == '__main__':
|
|||||||
else:
|
else:
|
||||||
release = os.getenv('DIST') or default_release
|
release = os.getenv('DIST') or default_release
|
||||||
|
|
||||||
# Correct-ish args, can proceed.
|
# Arguments are correct, proceed.
|
||||||
# Check release by checking if Launchpad page exists
|
# Check that the Ubuntu release specified exists.
|
||||||
packages.checkReleaseExists(release)
|
lp_functions.doesUbuntuReleaseExist(release)
|
||||||
|
|
||||||
# Check package exists.
|
# Check package exists.
|
||||||
packages.checkSourceExists(package, release)
|
packages.checkSourceExists(package, release)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user