[Bug 1311056] Re: apt-add-repository adds duplicate commented/disabled source lines

Dave Jones dave.jones at canonical.com
Thu Jan 30 13:36:40 UTC 2020


** Description changed:

+ Impact
+ ======
+ 
+ Under most circumstances, the impact is minimal (a few extra redundant
+ comment lines in apt sources. However, if users are automating source
+ removal / addition on a machine (as in comment 11), there is the
+ potential to wind up with an excessively large (and thus slow to parse)
+ apt sources configuration.
+ 
+ Test Case
+ =========
+ 
+ * sudo add-apt-repository -y ppa:deadsnakes/ppa
+ * cat /etc/apt/sources.list.d/deadsnakes*.list
+ * Note the presence of one uncommented "deb" line, and one commented "deb-src" line
+ * sudo add-apt-repository -y ppa:deadsnakes/ppa
+ * cat /etc/apt/sources.list.d/deadsnakes*.list
+ * Note the uncommented "deb" line is still there but the commented "deb-src" line has now been duplicated
+ * Upgrade python-apt to 1.9.3ubuntu2 (or later)
+ * sudo add-apt-repository -y ppa:deadsnakes/ppa
+ * cat /etc/apt/sources.list.d/deadsnakes*.list
+ * Note there has been no further duplication of the commented "deb-src" line
+ 
+ Regression Potential
+ ====================
+ 
+ Minimal; test cases have been added to cover the duplication case, and
+ to cover the enabling of sources (which was not covered by existing
+ tests, but was part of the code altered to fix the duplication case),
+ and insertion of sources at a position (again, not covered by existing
+ tests but modified as part of the fix). The test case has been used
+ successfully on all targeted releases (xenial, bionic, and eoan).
+ 
+ Original Description
+ ====================
+ 
  Trusty Tahr 14.04
  
- 0 root at osprey:/etc/apt/sources.list.d#cat aims-aims-desktop-trusty.list 
+ 0 root at osprey:/etc/apt/sources.list.d#cat aims-aims-desktop-trusty.list
  deb http://ppa.launchpad.net/aims/aims-desktop/ubuntu trusty main
  # deb-src http://ppa.launchpad.net/aims/aims-desktop/ubuntu trusty main
  0 root at osprey:/etc/apt/sources.list.d#apt-add-repository -y ppa:aims/aims-desktop
  gpg: keyring `/tmp/tmp0ufdhnmv/secring.gpg' created
  gpg: keyring `/tmp/tmp0ufdhnmv/pubring.gpg' created
  gpg: requesting key BE796FF2 from hkp server keyserver.ubuntu.com
  gpg: /tmp/tmp0ufdhnmv/trustdb.gpg: trustdb created
  gpg: key BE796FF2: public key "Launchpad PPA for AIMS" imported
  gpg: Total number processed: 1
  gpg:               imported: 1  (RSA: 1)
  OK
  0 root at osprey:/etc/apt/sources.list.d#cat aims-aims-desktop-trusty.list deb http://ppa.launchpad.net/aims/aims-desktop/ubuntu trusty main
  # deb-src http://ppa.launchpad.net/aims/aims-desktop/ubuntu trusty main
  # deb-src http://ppa.launchpad.net/aims/aims-desktop/ubuntu trusty main
  0 root at osprey:/etc/apt/sources.list.d#
  
  That deb-src line should have stayed commented out, and not been
  duplicated. (Commented deb lines should of course be uncommented, as
  already fixed per https://bugs.launchpad.net/ubuntu/+source/python-
  apt/+bug/1042916 .)

** Summary changed:

- apt-add-repository adds duplicate commented/disabled source lines
+ [SRU] apt-add-repository adds duplicate commented/disabled source lines

** Description changed:

  Impact
  ======
  
  Under most circumstances, the impact is minimal (a few extra redundant
  comment lines in apt sources. However, if users are automating source
  removal / addition on a machine (as in comment 11), there is the
  potential to wind up with an excessively large (and thus slow to parse)
  apt sources configuration.
  
  Test Case
  =========
  
  * sudo add-apt-repository -y ppa:deadsnakes/ppa
  * cat /etc/apt/sources.list.d/deadsnakes*.list
  * Note the presence of one uncommented "deb" line, and one commented "deb-src" line
  * sudo add-apt-repository -y ppa:deadsnakes/ppa
  * cat /etc/apt/sources.list.d/deadsnakes*.list
  * Note the uncommented "deb" line is still there but the commented "deb-src" line has now been duplicated
- * Upgrade python-apt to 1.9.3ubuntu2 (or later)
+ * sudo add-apt-repository ppa:waveform/python-apt
+ * sudo apt upgrade  # update python-apt to fixed version
  * sudo add-apt-repository -y ppa:deadsnakes/ppa
  * cat /etc/apt/sources.list.d/deadsnakes*.list
  * Note there has been no further duplication of the commented "deb-src" line
  
  Regression Potential
  ====================
  
  Minimal; test cases have been added to cover the duplication case, and
  to cover the enabling of sources (which was not covered by existing
  tests, but was part of the code altered to fix the duplication case),
  and insertion of sources at a position (again, not covered by existing
  tests but modified as part of the fix). The test case has been used
  successfully on all targeted releases (xenial, bionic, and eoan).
  
  Original Description
  ====================
  
  Trusty Tahr 14.04
  
  0 root at osprey:/etc/apt/sources.list.d#cat aims-aims-desktop-trusty.list
  deb http://ppa.launchpad.net/aims/aims-desktop/ubuntu trusty main
  # deb-src http://ppa.launchpad.net/aims/aims-desktop/ubuntu trusty main
  0 root at osprey:/etc/apt/sources.list.d#apt-add-repository -y ppa:aims/aims-desktop
  gpg: keyring `/tmp/tmp0ufdhnmv/secring.gpg' created
  gpg: keyring `/tmp/tmp0ufdhnmv/pubring.gpg' created
  gpg: requesting key BE796FF2 from hkp server keyserver.ubuntu.com
  gpg: /tmp/tmp0ufdhnmv/trustdb.gpg: trustdb created
  gpg: key BE796FF2: public key "Launchpad PPA for AIMS" imported
  gpg: Total number processed: 1
  gpg:               imported: 1  (RSA: 1)
  OK
  0 root at osprey:/etc/apt/sources.list.d#cat aims-aims-desktop-trusty.list deb http://ppa.launchpad.net/aims/aims-desktop/ubuntu trusty main
  # deb-src http://ppa.launchpad.net/aims/aims-desktop/ubuntu trusty main
  # deb-src http://ppa.launchpad.net/aims/aims-desktop/ubuntu trusty main
  0 root at osprey:/etc/apt/sources.list.d#
  
  That deb-src line should have stayed commented out, and not been
  duplicated. (Commented deb lines should of course be uncommented, as
  already fixed per https://bugs.launchpad.net/ubuntu/+source/python-
  apt/+bug/1042916 .)

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to python-apt in Ubuntu.
https://bugs.launchpad.net/bugs/1311056

Title:
  [SRU] apt-add-repository adds duplicate commented/disabled source
  lines

Status in python-apt package in Ubuntu:
  Fix Released
Status in python-apt source package in Xenial:
  New
Status in python-apt source package in Bionic:
  New
Status in python-apt source package in Eoan:
  New

Bug description:
  Impact
  ======

  Under most circumstances, the impact is minimal (a few extra redundant
  comment lines in apt sources. However, if users are automating source
  removal / addition on a machine (as in comment 11), there is the
  potential to wind up with an excessively large (and thus slow to
  parse) apt sources configuration.

  Test Case
  =========

  * sudo add-apt-repository -y ppa:deadsnakes/ppa
  * cat /etc/apt/sources.list.d/deadsnakes*.list
  * Note the presence of one uncommented "deb" line, and one commented "deb-src" line
  * sudo add-apt-repository -y ppa:deadsnakes/ppa
  * cat /etc/apt/sources.list.d/deadsnakes*.list
  * Note the uncommented "deb" line is still there but the commented "deb-src" line has now been duplicated
  * sudo add-apt-repository ppa:waveform/python-apt
  * sudo apt upgrade  # update python-apt to fixed version
  * sudo add-apt-repository -y ppa:deadsnakes/ppa
  * cat /etc/apt/sources.list.d/deadsnakes*.list
  * Note there has been no further duplication of the commented "deb-src" line

  Regression Potential
  ====================

  Minimal; test cases have been added to cover the duplication case, and
  to cover the enabling of sources (which was not covered by existing
  tests, but was part of the code altered to fix the duplication case),
  and insertion of sources at a position (again, not covered by existing
  tests but modified as part of the fix). The test case has been used
  successfully on all targeted releases (xenial, bionic, and eoan).

  Original Description
  ====================

  Trusty Tahr 14.04

  0 root at osprey:/etc/apt/sources.list.d#cat aims-aims-desktop-trusty.list
  deb http://ppa.launchpad.net/aims/aims-desktop/ubuntu trusty main
  # deb-src http://ppa.launchpad.net/aims/aims-desktop/ubuntu trusty main
  0 root at osprey:/etc/apt/sources.list.d#apt-add-repository -y ppa:aims/aims-desktop
  gpg: keyring `/tmp/tmp0ufdhnmv/secring.gpg' created
  gpg: keyring `/tmp/tmp0ufdhnmv/pubring.gpg' created
  gpg: requesting key BE796FF2 from hkp server keyserver.ubuntu.com
  gpg: /tmp/tmp0ufdhnmv/trustdb.gpg: trustdb created
  gpg: key BE796FF2: public key "Launchpad PPA for AIMS" imported
  gpg: Total number processed: 1
  gpg:               imported: 1  (RSA: 1)
  OK
  0 root at osprey:/etc/apt/sources.list.d#cat aims-aims-desktop-trusty.list deb http://ppa.launchpad.net/aims/aims-desktop/ubuntu trusty main
  # deb-src http://ppa.launchpad.net/aims/aims-desktop/ubuntu trusty main
  # deb-src http://ppa.launchpad.net/aims/aims-desktop/ubuntu trusty main
  0 root at osprey:/etc/apt/sources.list.d#

  That deb-src line should have stayed commented out, and not been
  duplicated. (Commented deb lines should of course be uncommented, as
  already fixed per https://bugs.launchpad.net/ubuntu/+source/python-
  apt/+bug/1042916 .)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-apt/+bug/1311056/+subscriptions



More information about the foundations-bugs mailing list