mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-13 08:01:09 +00:00
Suggest python-simplejson | python (>= 2.7) and complain if they are missing in pull-debian-debdiff
This commit is contained in:
parent
18d02c4c39
commit
b5274624ac
3
debian/control
vendored
3
debian/control
vendored
@ -16,7 +16,6 @@ Build-Depends: dctrl-tools,
|
||||
python-apt (>= 0.7.93~),
|
||||
python-debian (>= 0.1.15),
|
||||
python-gnupginterface,
|
||||
python-simplejson,
|
||||
python-launchpadlib (>= 1.5.7),
|
||||
python-magic,
|
||||
python-setuptools,
|
||||
@ -57,7 +56,7 @@ Recommends: bzr,
|
||||
python-magic,
|
||||
python-soappy,
|
||||
reportbug (>= 3.39ubuntu1)
|
||||
Suggests: qemu-kvm-extras-static
|
||||
Suggests: python-simplejson | python (>= 2.7), qemu-kvm-extras-static
|
||||
Breaks: ${python:Breaks}
|
||||
Description: useful tools for Ubuntu developers
|
||||
This is a collection of useful tools that Ubuntu developers use to make their
|
||||
|
@ -25,10 +25,6 @@ import sys
|
||||
import urllib2
|
||||
|
||||
import debian.changelog
|
||||
try:
|
||||
import json
|
||||
except ImportError:
|
||||
import simplejson as json
|
||||
|
||||
from ubuntutools.config import UDTConfig
|
||||
from ubuntutools.logger import Logger
|
||||
@ -63,6 +59,15 @@ def pull(package, version, unpack=False):
|
||||
|
||||
def pull_from_snapshot(package, version, unpack=False):
|
||||
"Download Debian source package version version from snapshot.debian.org"
|
||||
try:
|
||||
import json
|
||||
except ImportError:
|
||||
import simplejson as json
|
||||
except ImportError:
|
||||
Logger.error("Require python-simplejson or python >= 2.7 to be "
|
||||
"installed for snapshot.debian.org support")
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
srcfiles = json.load(urllib2.urlopen(
|
||||
'http://snapshot.debian.org/mr/package/%s/%s/srcfiles'
|
||||
@ -71,6 +76,7 @@ def pull_from_snapshot(package, version, unpack=False):
|
||||
Logger.error('Version %s of %s not found on snapshot.debian.org',
|
||||
version, package)
|
||||
return False
|
||||
|
||||
for hash_ in srcfiles['result']:
|
||||
hash_ = hash_['hash']
|
||||
|
||||
@ -167,6 +173,11 @@ def main():
|
||||
version = args[1]
|
||||
distance = args[2] if len(args) > 2 else 1
|
||||
|
||||
if not os.path.exists('/usr/bin/dget'):
|
||||
Logger.error("dget is not installed. "
|
||||
"Please install the 'devscripts' package.")
|
||||
sys.exit(1)
|
||||
|
||||
config = UDTConfig(opts.no_conf)
|
||||
if opts.debian_mirror is None:
|
||||
opts.debian_mirror = config.get_value('DEBIAN_MIRROR')
|
||||
|
Loading…
x
Reference in New Issue
Block a user