[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1060914: reportbug: [PATCH] Fully remove config option "cc"



Package: reportbug
Version: 13.0.0
Severity: normal
Tags: patch
X-Debbugs-Cc: safinaskar@gmail.com

Please, apply this patch. It is against current master ( 9ee3cd8db321283319c3c8e96a96acb3a659cdb8 ).
All motivation/rationale is inside the patch itself.
Tested by building and sending this very email.

-- Package-specific info:
** Environment settings:
INTERFACE="text"

** /root/.reportbugrc:
reportbug_version "12.0.0"
mode advanced
ui text
realname "Askar Safin"
email "safinaskar@gmail.com"
no-check-uid
list-cc-me
smtphost reportbug.debian.org

-- System Information:
Debian Release: trixie/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-0.deb9.24-amd64 (SMP w/4 CPU threads)
Locale: LANG=C, LC_CTYPE=C (charmap=UTF-8) (ignored: LC_ALL set to C.UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: unable to detect

Versions of packages reportbug depends on:
ii  apt                2.7.7
ii  python3            3.11.4-5+b1
ii  python3-reportbug  13.0.0
ii  sensible-utils     0.0.20

reportbug recommends no packages.

Versions of packages reportbug suggests:
pn  claws-mail                                            <none>
ii  debconf                                               1.5.82
pn  debsums                                               <none>
pn  default-mta | postfix | exim4 | mail-transport-agent  <none>
pn  dlocate                                               <none>
pn  emacs-bin-common                                      <none>
ii  file                                                  1:5.45-2
ii  gnupg                                                 2.2.40-1.1
pn  python3-urwid                                         <none>
pn  reportbug-gtk                                         <none>
pn  xdg-utils                                             <none>

Versions of packages python3-reportbug depends on:
ii  apt                2.7.7
ii  file               1:5.45-2
ii  python3            3.11.4-5+b1
ii  python3-apt        2.7.0
ii  python3-debian     0.1.49
ii  python3-debianbts  4.0.2
ii  python3-requests   2.31.0+dfsg-1
ii  sensible-utils     0.0.20

python3-reportbug suggests no packages.

-- no debconf information
>From 064c4ae6c008760add008c89f6c9d7328312c341 Mon Sep 17 00:00:00 2001
From: Askar Safin <safinaskar@gmail.com>
Date: Tue, 16 Jan 2024 11:30:24 +0000
Subject: [PATCH] Fully remove config option "cc"

Fully remove config options "cc" and "no-cc". And CLI options "-x" and "--no-cc".
And all related code, tests and documentation.

Current code contains two ways of controlling CC'ing reporter:

1. CLI options "-x", "--no-cc", config options "cc", "no-cc"

2. CLI option "--list-cc-me", config option "list-cc-me"

It seems that the second way was added later. And it seems to work.
The first way seems not to work with current bugs.debian.org .

So let's just remove the first way. This will simplify code and
documentation.

Now user will get a warning if their config contains "cc".
But I don't think this is bad. This is just a warning

---
 bin/reportbug            | 9 +--------
 conf/reportbug.conf      | 3 ---
 man/reportbug.1          | 4 ----
 man/reportbug.conf.5     | 3 ---
 reportbug/utils.py       | 4 +---
 test/data/reportbug.conf | 1 -
 test/test_utils.py       | 1 -
 7 files changed, 2 insertions(+), 23 deletions(-)

diff --git a/bin/reportbug b/bin/reportbug
index 34961d6..1fb17a2 100755
--- a/bin/reportbug
+++ b/bin/reportbug
@@ -691,13 +691,11 @@ def offer_configuration(options):
 
     if stupidmode:
         print('# Disable fallback mode by commenting out the following:', file=fp)
-        print('no-cc', file=fp)
         print('list-cc-me', file=fp)
         print('smtphost reportbug.debian.org', file=fp)
     else:
         print('# If nothing else works, remove the # at the beginning', file=fp)
         print('# of the following three lines:', file=fp)
-        print('#no-cc', file=fp)
         print('#list-cc-me', file=fp)
         print('#smtphost reportbug.debian.org', file=fp)
 
@@ -847,8 +845,6 @@ def main():
     parser.add_option('-q', '--quiet', action='store_true', dest='quietly',
                       help='reduce the verbosity of the output', default=False)
     parser.add_option('-s', '--subject', help='the subject for your report')
-    parser.add_option('-x', '--no-cc', dest='nocc', action='store_true',
-                      help='do not send a copy of the report to yourself')
     parser.add_option('-z', '--no-compress', dest='nocompress',
                       action='store_true', help='do not strip blank lines '
                                                 'and comments from config files')
@@ -1820,10 +1816,7 @@ class UI(object):
                 return
 
         ccaddr = os.environ.get('MAILCC')
-        if self.options.nocc:
-            bccaddr = os.environ.get('MAILBCC')
-        else:
-            bccaddr = os.environ.get('MAILBCC', fromaddr)
+        bccaddr = os.environ.get('MAILBCC')
 
         if maintainer:
             mstr = "Maintainer for %s is '%s'.\n" % (package, maintainer)
diff --git a/conf/reportbug.conf b/conf/reportbug.conf
index 11f0b99..fd7345b 100644
--- a/conf/reportbug.conf
+++ b/conf/reportbug.conf
@@ -33,9 +33,6 @@ query-bts
 # Should I check for newer releases of the package
 # check-available
 
-# Should I CC the reporter?
-cc
-
 # Should I ever include modified config files?
 config-files
 
diff --git a/man/reportbug.1 b/man/reportbug.1
index 90e0fe9..9ec93f8 100644
--- a/man/reportbug.1
+++ b/man/reportbug.1
@@ -503,10 +503,6 @@ Specify the version of the package the problem was found in.  This is
 probably most useful if you are reporting a bug in a package that is
 not installable or installed on a different system.
 .TP
-.B \-x, \-\-no\-cc
-Don't send a blind carbon copy (BCC) of the bug report to the
-submitter (i.e. yourself).
-.TP
 .B \-z, \-\-no\-compress
 Don't compress configuration files by removing comments and blank
 lines.
diff --git a/man/reportbug.conf.5 b/man/reportbug.conf.5
index 9301718..408d641 100644
--- a/man/reportbug.conf.5
+++ b/man/reportbug.conf.5
@@ -61,9 +61,6 @@ The summary of possible options (in alphabetical order) is as follows:
 The bug tracking system to use, see \fBreportbug \-\-bts=help\fP
 for a list of currently supported BTSes.
 .TP
-.B cc (\fIboolean\fP)
-Whether the reporter should be Cc:ed on the bug report.
-.TP
 .B check-available (\fIboolean\fP)
 Whether Debian package lists should be queried for newer releases
 of the package.  In \fBadvanced\fP and \fBexpert\fP mode,
diff --git a/reportbug/utils.py b/reportbug/utils.py
index 4a8fd29..ac27843 100644
--- a/reportbug/utils.py
+++ b/reportbug/utils.py
@@ -1426,7 +1426,7 @@ FILES = ('/etc/reportbug.conf', USERFILE)
 CONFIG_ARGS = (
     'sendto', 'severity', 'mua', 'mta', 'email', 'realname', 'bts', 'verify',
     'replyto', 'http_proxy', 'smtphost', 'editor', 'debconf', 'justification',
-    'sign', 'nocc', 'nocompress', 'dontquery', 'noconf', 'mirrors', 'keyid',
+    'sign', 'nocompress', 'dontquery', 'noconf', 'mirrors', 'keyid',
     'headers', 'interface', 'template', 'mode', 'check_available', 'query_src',
     'printonly', 'offline', 'check_uid', 'smtptls', 'smtpuser', 'smtppasswd',
     'paranoid', 'mbox_reader_cmd', 'max_attachment_size', 'listccme',
@@ -1478,8 +1478,6 @@ def parse_config_files():
                         args['severity'] = token
                 elif token == 'header':
                     args['headers'] = args.get('headers', []) + [lex.get_token()]
-                elif token in ('no-cc', 'cc'):
-                    args['nocc'] = (token == 'no-cc')
                 elif token in ('no-compress', 'compress'):
                     args['nocompress'] = (token == 'no-compress')
                 elif token in ('no-list-cc-me', 'list-cc-me'):
diff --git a/test/data/reportbug.conf b/test/data/reportbug.conf
index 17c8d15..7c9d6c8 100644
--- a/test/data/reportbug.conf
+++ b/test/data/reportbug.conf
@@ -5,7 +5,6 @@ mutt
 header "X-Reportbug-Testsuite: this is the test suite"
 query-bts
 check-available
-cc
 config-files
 compress
 # all possible 'sign' values
diff --git a/test/test_utils.py b/test/test_utils.py
index b2eb7a5..29f07fc 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -615,7 +615,6 @@ class TestConfig(unittest.TestCase):
             'mirrors': ['this_is_a_bts_mirror'],
             'mode': 'novice',
             'mta': '/usr/sbin/sendmail',
-            'nocc': False,
             'nocompress': False,
             'noconf': False,
             'offline': True,
-- 
2.43.0


Reply to: