Package: reportbug
Version: 13.0.1
Severity: normal
X-Debbugs-Cc: spa...@gmail.com

Dear Maintainer,

I have filed a few bug reports recently by running reportbug on a non-debian
system. This resulted in the subject line of the report email being blank and
the title of the bug report being set to "(no subject)".

The problem occurs because the scripts rely on the existence of the file
`/etc/dpkg/origins/debian` to provide the `type` for that default `SYSTEM`, or
for some other source to provide the `type` for other `SYSTEM`s such as
`"ubuntu"` or `"guug"`, or for the `type` to be set as a command line argument.

There are a few places that a default `type` could be defined. For the attached
patch I chose to apply a global default, although it may be preferable to
instead put per-`SYSTEM` defaults in `debbugs.py`'s definition of `SYSTEMS`.

This bug report is being filed with `reportbug` using this patch, on a system
previously affected by the bug. If all goes well, it will be titled as follows:

reportbug: Missing report type results in Subject being dropped

-- Package-specific info:
** Environment settings:
EDITOR="code --wait"
VISUAL="code --wait"
DEBEMAIL="spa...@gmail.com"
DEBFULLNAME="Clarence "Sparr" Risher"
INTERFACE="text"

** /home/sparr/.reportbugrc:
reportbug_version "13.0.1"
mode novice
ui text
realname "Clarence \"Sparr\" Risher"
email "spa...@gmail.com"
no-cc
list-cc-me
smtphost reportbug.debian.org

-- System Information:
Architecture: amd64 (x86_64)

Kernel: Linux 6.10.10-arch1-1 (SMP w/12 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
diff --git a/bin/reportbug b/bin/reportbug
index 21c4354..435333d 100755
--- a/bin/reportbug
+++ b/bin/reportbug
@@ -1137,7 +1137,7 @@ class UI(object):
         subject = self.options.subject
         bts = self.options.bts or 'debian'
         sysinfo = debbugs.SYSTEMS[bts]
-        rtype = self.options.type or sysinfo.get('type')
+        rtype = self.options.type or sysinfo.get('type') or 'debbugs'
         attachments = self.options.attachments
         pgp_addr = self.options.keyid
         bugnumber = self.options.bugnumber

Reply via email to