2008-08-11 21:48:40 +01:00
|
|
|
#
|
2008-08-12 20:15:15 +02:00
|
|
|
# common.py - provides functions which are commonly used by the
|
|
|
|
# ubuntu-dev-tools package.
|
2008-08-11 21:48:40 +01:00
|
|
|
#
|
2008-12-30 10:23:00 +00:00
|
|
|
# Copyright (C) 2008 Jonathan Davies <jpds@ubuntu.com>
|
2008-08-12 23:42:44 +02:00
|
|
|
# Copyright (C) 2008 Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com>
|
2008-08-11 21:48:40 +01:00
|
|
|
#
|
2008-08-12 20:15:15 +02:00
|
|
|
# Some of the functions are based upon code written by Martin Pitt
|
|
|
|
# <martin.pitt@ubuntu.com> and Kees Cook <kees@ubuntu.com>.
|
2008-08-11 21:48:40 +01:00
|
|
|
#
|
2008-08-12 20:15:15 +02:00
|
|
|
# ##################################################################
|
2008-08-11 21:48:40 +01:00
|
|
|
#
|
2008-08-12 20:15:15 +02:00
|
|
|
# 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.
|
2008-08-11 21:48:40 +01:00
|
|
|
#
|
2008-08-12 20:15:15 +02:00
|
|
|
# See file /usr/share/common-licenses/GPL for more details.
|
|
|
|
#
|
|
|
|
# ##################################################################
|
2008-08-11 21:48:40 +01:00
|
|
|
|
|
|
|
import cookielib
|
|
|
|
import glob
|
|
|
|
import os.path
|
2008-08-27 10:22:08 +01:00
|
|
|
import re
|
2008-08-29 07:44:58 +01:00
|
|
|
import subprocess
|
2008-08-11 21:48:40 +01:00
|
|
|
import sys
|
|
|
|
import urllib2
|
2009-01-02 17:51:55 +01:00
|
|
|
import urlparse
|
2009-01-05 14:45:20 +01:00
|
|
|
import urllib
|
2008-08-11 21:48:40 +01:00
|
|
|
|
2008-09-01 11:41:19 +01:00
|
|
|
# Clear https_proxy env var as it's not supported in urllib/urllib2; see
|
|
|
|
# LP #122551
|
|
|
|
if os.environ.has_key('https_proxy'):
|
|
|
|
print >> sys.stderr, "Ignoring https_proxy (no support in urllib/urllib2; see LP #122551)"
|
|
|
|
del os.environ['https_proxy']
|
|
|
|
|
2008-08-12 23:42:44 +02:00
|
|
|
|
|
|
|
|
2008-08-27 10:22:08 +01:00
|
|
|
|
|
|
|
|