[Bug 964930] Re: apt-setup generator 50mirror.ubuntu writes to wrong file, fails to update

Brian Murray brian at ubuntu.com
Wed Mar 28 16:05:50 UTC 2012


** Changed in: apt-setup (Ubuntu)
       Status: New => In Progress

** Changed in: apt-setup (Ubuntu)
   Importance: Undecided => Medium

** Changed in: apt-setup (Ubuntu)
     Assignee: (unassigned) => Brian Murray (brian-murray)

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

Title:
  apt-setup generator 50mirror.ubuntu writes to wrong file, fails to
  update

Status in “apt-setup” package in Ubuntu:
  In Progress

Bug description:
  In the process of setting up a preseed file to load Ubuntu Precise
  Pangolin from a local mirror, I ran into a problem where the
  installation would fail. The logs reported it could not find most of
  the packages on my mirror to install, but if I ran "in-target apt-get
  update" everything worked fine.  Looking through the log files, it was
  clear that "apt-get update" was not being run for most of my mirrors.

  After some troubleshooting, I believe I have found a bug in the
  installer file "/usr/lib/apt-setup/generators/50mirror.ubuntu".

  That file seems to take a command-line parameter telling it where to
  write the generated configuration.  "apt-setup" runs the generator and
  tells it what filename to write into, then "apt-setup-verify" checks
  the file, and updates the mirror information with "in-target apt-get
  ... update".

  Towards the beginning, 50mirror.ubuntu sets $file to $1, and later it writes its configuration to $file.  In between, however, it uses "file" as a temporary loop variable, like this:
  for file in $ROOT/etc/apt/sources.list.base \
    $ROOT/etc/apt/sources.list.new; do
      ...
  done

  After that loop completes, $file is set to the last of those files,
  instead of the original file that was passed in.  That makes the
  script write its configuration to the wrong place, so apt-setup-verify
  doesn't verify the file, and doesn't run "in-target apt-get ...
  update".  As a result, the index files for my mirrors aren't loaded,
  and no packages can be found there.

  After changing "for file" to "for file2", the installation completed
  successfully.

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




More information about the foundations-bugs mailing list