apt-mirror is too restrictive when parsing arch
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt-mirror (Ubuntu) |
Fix Released
|
High
|
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/
deb-solaris-i386 http://
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://
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
ProcVersionSign
Uname: Linux 2.6.38-
Architecture: i386
Date: Mon Jan 9 15:54:52 2012
InstallationMedia: Ubuntu 10.04.1 LTS "Lucid Lynx" - Release i386 (20100816.1)
PackageArchitec
ProcEnviron:
SHELL=/bin/bash
PATH=(custom, user)
LANG=en_GB.UTF-8
LANGUAGE=en_GB:en
SourcePackage: apt-mirror
UpgradeStatus: Upgraded to natty on 2011-07-07 (186 days ago)
Related branches
Changed in apt-mirror (Ubuntu): | |
status: | Confirmed → Fix Committed |
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.