[Bug 1076237] Re: /etc/kernel/postinst.d/apt-auto-removal creates comment with invalid # character

Launchpad Bug Tracker 1076237 at bugs.launchpad.net
Thu Nov 8 07:14:12 UTC 2012


This bug was fixed in the package apt - 0.9.7.6ubuntu3

---------------
apt (0.9.7.6ubuntu3) raring; urgency=low

  * Fix comment char in /etc/apt/apt.conf.d/01autoremove-kernels to
    use C++ style comments instead of POSIX shell style (LP: #1076237)
 -- Adam Conrad <adconrad at ubuntu.com>   Wed, 07 Nov 2012 23:10:35 -0700

** Changed in: apt (Ubuntu)
       Status: Fix Committed => Fix Released

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

Title:
   /etc/kernel/postinst.d/apt-auto-removal creates comment with invalid
  # character

Status in “apt” package in Ubuntu:
  Fix Released

Bug description:
  /etc/kernel/postinst.d/apt-auto-removal does:

  cat > "$config_file".dpkg-new <<EOF
  # File autogenerated by $0, do not edit
  APT
  {
  [...]

  But apt does not seem to accept that. This is exposed by the current
  aptdaemon autopkgtest failure in
  https://jenkins.qa.ubuntu.com/view/Raring/view/AutoPkgTest/job/raring-
  adt-aptdaemon/lastFailedBuild/ARCH=i386,label=albali/ :

  =====================================================================
  ERROR: test_ (tests.test_configparser.ConfigurationParserTestCase)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/tmp/tmp.dHacB3CTL5/dsc0-build/aptdaemon-0.45+bzr861/tests/test_configparser.py", line 63, in test_
      config = self.parser.parse(fd.readlines())
    File "/tmp/tmp.dHacB3CTL5/dsc0-build/aptdaemon-0.45+bzr861/aptdaemon/config.py", line 156, in parse
      raise Exception("Unknown char '%s' in: %s" % (char, line))
  Exception: Unknown char '#' in: # File autogenerated by /etc/kernel/postinst.d/apt-auto-removal, do not edit

  man apt.conf also just documents // and /* .. */ as valid comments,
  not #.

  I think this apt script should be fixed to write a // comment instead
  of a # comment. Or should aptdaemon/apt accept # as well?

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




More information about the foundations-bugs mailing list