apt-mirror is too restrictive when parsing arch

Bug #913837 reported by Ketil
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt-mirror (Ubuntu)
Fix Released
Brandon Holtsclaw

Bug Description

I am using apt-mirror to fetch a repository of a commercial appliance based on solaris, and the arch is solaris-i386. If I try to add this to /etc/apt/mirror.list, like this:

deb-solaris-i386 http://example.com/ natty partner

I get an error from apt-mirror:

apt-mirror: invalid line in config file (80: deb-solaris-i386 ...) at /usr/bin/apt-mirror line 282, <CONFIG> line 80.

I was able to work around this bug by using defaultarch instead, and

set defaultarch solaris-i386
deb-solaris-i386 http://example.com/ natty partner

works fine, and does the job just like I want it to be done.

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: apt-mirror 0.4.8-3ubuntu1
ProcVersionSignature: Ubuntu 2.6.38-13.53-generic-pae
Uname: Linux 2.6.38-13-generic-pae i686
Architecture: i386
Date: Mon Jan 9 15:54:52 2012
InstallationMedia: Ubuntu 10.04.1 LTS "Lucid Lynx" - Release i386 (20100816.1)
PackageArchitecture: all
 PATH=(custom, user)
SourcePackage: apt-mirror
UpgradeStatus: Upgraded to natty on 2011-07-07 (186 days ago)

Related branches

Revision history for this message
Ketil (ketil-froyn) wrote :
Revision history for this message
Leigh Taylor (leigh-taylor-l) wrote :

If you do a search for "arm" in the apt-mirror script, it will take you to a regular expression with multiple architectures specified.

It would be possible to add the architecture required into that regular expressions (it's just a set of alternatives).

Alternatively changing the test expression to ...

if($config_line =~ /deb-([\w\-]+)/)

Makes any architecture comprising word characters (letters digits underscores), or "-" acceptable.

However you MUST move this test below the test for deb-src, otherwise "src" will be treated as an architecture (you don't want this).

I found this problem when I was trying to mirror the Raspbian repository which is architecture "armhf". There was an entry in the regex for "arm" but not "armhf", so the test passed and "arm" became the architecture which caused a failure further down.

I'm not sure why there is a specific list of architectures - perhaps to eliminate the match with "deb-src". By moving the test below the specific test for deb-src, this clash disappears so the more general regular expression can be used.

Setting the default architecture and just specifying "deb" works because this test is not involved. As far as I can infer from the code you can change the default architecture as many times as you like in mirror.list and it just affects the following lines until you change it again.

Revision history for this message
Brandon Holtsclaw (imbrandon) wrote :

This has been changed for the upcoming 0.5.0 release. Will close this once its been uploaded to Ubuntu.

Changed in apt-mirror (Ubuntu):
assignee: nobody → Brandon Holtsclaw (imbrandon)
importance: Undecided → Low
importance: Low → High
status: New → Confirmed
Benjamin Drung (bdrung)
Changed in apt-mirror (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt-mirror - 0.5.0-1

apt-mirror (0.5.0-1) unstable; urgency=medium

  * New upstream release.
    - Removed restrictions when parsing deb-$arch (LP: #913837)
    - Download all provided translation files instead of trying to download
      translation files based on a hard-coded language list. (Closes: #725762)
    - Fix typos (Closes: #736904, LP: #1211097).
    - Mirror Contents-*.gz for each component. (Closes: #647301)
  * Use Makefile for installation.
  * Bump Standards-Version to 3.9.5.

 -- Benjamin Drung <email address hidden> Sat, 22 Feb 2014 15:42:22 +0100

Changed in apt-mirror (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.