Trap an exception and fix some strings.

This commit is contained in:
Siegfried-Angel Gevatter Pujals 2008-09-06 15:48:30 +02:00
parent 03e3d66c30
commit 6009e9d41b
3 changed files with 18 additions and 7 deletions

View File

@ -92,7 +92,7 @@ def checkSourceExists(package, release):
m = re.search('"/ubuntu/%s/\+source/%s/(\d[^"]+)"' % (release,
package.replace('+', '\+')), page)
if not m:
print >> sys.stderr, "Unable to find this source package '%s' in " \
print >> sys.stderr, "Unable to find source package '%s' in " \
"the %s release." % (package, release.capitalize())
sys.exit(1)
@ -140,7 +140,7 @@ def prepareLaunchpadCookie():
if launchpad_cookiefile != None:
break
# Unable to find an correct file.
# Unable to find a correct file.
if launchpad_cookiefile == None:
print >> sys.stderr, "Could not find cookie file for Launchpad. "
print >> sys.stderr, "Looked in: %s" % ", ".join(try_globs)
@ -152,13 +152,16 @@ def prepareLaunchpadCookie():
def _check_for_launchpad_cookie(cookie_file):
# Found SQLite file? Parse information from it.
if cookie_file.find('cookies.sqlite') != -1:
if 'cookies.sqlite' in cookie_file.find():
import sqlite3 as sqlite
con = sqlite.connect(cookie_file)
cur = con.cursor()
cur.execute("select host, path, isSecure, expiry, name, value from moz_cookies where host like ?", ['%%launchpad%%'])
try:
cur.execute("select host, path, isSecure, expiry, name, value from moz_cookies where host like ?", ['%%launchpad%%'])
except sqlite.OperationalError:
print 'Warning: Database "%s" is locked; ignoring it.' % cookie_file
return None
# No matching cookies? Abort.
items = cur.fetchall()

8
debian/changelog vendored
View File

@ -1,3 +1,11 @@
ubuntu-dev-tools (0.45ubuntu1) intrepid; urgency=low
* common.py:
- Trying to read from a locked sqlite cookie database isn't a fatal
error anymore.
-- Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com> Sat, 06 Sep 2008 15:46:55 +0200
ubuntu-dev-tools (0.44ubuntu1) intrepid; urgency=low
* Bazaar revision 203.

4
debian/control vendored
View File

@ -25,5 +25,5 @@ Description: useful tools for Ubuntu developers
This is a collection of useful tools that Ubuntu developers use to make their
packaging work a lot easier.
.
Such tools can include bug filing, build rebuilding, packaging preparation,
package analysis, among other things.
Such tools can include bug filing, build rebuilding, packaging preparation
and package analysis, among other things.