Browse Source

Improve handling when dlocate fails; improve behavior with new exim.

suites/jessie-proposed-backports
Chris Lawrence 16 years ago
parent
commit
84de1c52ee
  1. 2
      debian/changelog
  2. 14
      reportbug
  3. 17
      reportbug.py

2
debian/changelog

@ -4,6 +4,8 @@ reportbug (3.31) unstable; urgency=low
* More ehlo/helo madness.
* Change default for get_string() in the urwid interface to ''.
(Closes: #392608)
* Add BIG CAPS WARNINGS to the reportbug presubj about the new default
behavior of exim4. (Closes: #392609)
--

14
reportbug

@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE."""
#
# Version ##VERSION##; see changelog for revision history
# $Id: reportbug,v 1.98.2.14 2006-09-20 19:03:52 lawrencc Exp $
# $Id: reportbug,v 1.98.2.15 2006-10-19 21:10:31 lawrencc Exp $
# Work around case where Python install might be broken (#290043)
try:
@ -410,7 +410,7 @@ def offer_configuration(options):
stupidmode = not ui.yes_no(
'Do you have a "mail transport agent" (MTA) like Exim, Postfix or '
'SSMTP configured on this computer?',
'SSMTP configured on this computer to send mail to the Internet?',
'Yes, I can run /usr/sbin/sendmail without horrible things happening. '
'If you can send email from this machine without setting an SMTP Host '
'in your mailer, you should choose this answer.',
@ -1418,11 +1418,11 @@ orphaned for a long period of time are often removed from the archive.\n''')
if status:
conftext += '\n-- debconf-show failed\n'
elif output:
if (notatty or
ui.yes_no("*** The following debconf settings were detected:\n"
+output+"\nInclude these settings in your report",
'Send your debconf settings.',
"Don't send your debconf settings.", nowrap=True)):
if (notatty or ui.yes_no(
"*** The following debconf settings were detected:\n"
+output+"\nInclude these settings in your report",
'Send your debconf settings.',
"Don't send your debconf settings.", nowrap=True)):
conftext += '\n-- debconf information:\n%s\n' % output
else:
conftext += '\n-- debconf information excluded\n'

17
reportbug.py

@ -21,7 +21,7 @@
#
# Version ##VERSION##; see changelog for revision history
#
# $Id: reportbug.py,v 1.35.2.3 2006-08-25 01:18:06 lawrencc Exp $
# $Id: reportbug.py,v 1.35.2.4 2006-10-19 21:10:31 lawrencc Exp $
VERSION = "reportbug ##VERSION##"
VERSION_NUMBER = "##VERSION##"
@ -114,21 +114,22 @@ def glob_escape(filename):
filename = re.sub(r'([*?\[\]])', r'\\\1', filename)
return filename
def search_pipe(searchfile):
def search_pipe(searchfile, use_dlocate=True):
arg = commands.mkarg(searchfile)
if os.path.exists('/usr/bin/dlocate'):
if use_dlocate and os.path.exists('/usr/bin/dlocate'):
pipe = os.popen('COLUMNS=79 dlocate -S %s 2>/dev/null' % arg)
else:
use_dlocate = False
pipe = os.popen('COLUMNS=79 dpkg --search %s 2>/dev/null' % arg)
return pipe
return (pipe, use_dlocate)
def query_dpkg_for(filename):
def query_dpkg_for(filename, use_dlocate=True):
try:
x = os.getcwd()
except OSError:
os.chdir('/')
searchfilename = glob_escape(filename)
pipe = search_pipe(searchfilename)
(pipe, dlocate_used) = search_pipe(searchfilename)
packages = {}
for line in pipe:
@ -145,6 +146,10 @@ def query_dpkg_for(filename):
else:
packages[package] = [path]
pipe.close()
# Try again without dlocate if no packages found
if not packages and dlocate_used:
return query_dpkg_for(filename, use_dlocate=False)
return filename, packages
def find_package_for(filename, pathonly=False):

Loading…
Cancel
Save