Hi, just noticed this wierd happening... (sorry, long post as per my thought process )
If I make a root using "mkarchroot", I notice the mirrorlist in that root contains this:
$this->bbcode_second_pass_code('', 'Server = http://mirror.archlinuxarm.org/arm/extra/devtools-20120720-1-any.pkg.tar.xz')
which is clearly wrong. This is despite pacman-mirrorlist being included in the package list given to mkarchroot.
I looked in /usr/sbin/mkarchroot and there is this at line 266 that rewrites the mirrorlist file:
$this->bbcode_second_pass_code('', 'echo "Server = ${host_mirror}" > ${working_dir}/etc/pacman.d/mirrorlist')
The value host_mirror gets set at line 199:
$this->bbcode_second_pass_code('', 'host_mirror=$(pacman -Sddp extra/devtools 2>/dev/null | sed -E 's#(.*/)extra/os/.*#\1$repo/os/$arch#')')
Executing that on the command line gives the bad output found in the mirrorlist:
$this->bbcode_second_pass_code('', '$ pacman -Sddp extra/devtools 2>/dev/null | sed -E 's#(.*/)extra/os/.*#\1$repo/os/$arch#'
http://mirror.archlinuxarm.org/arm/extra/devtools-20120720-1-any.pkg.tar.xz')
The "sed" part of the command has no effect . This construct works fine on x86_64, so I did some tests:
on x86_64:
$this->bbcode_second_pass_code('', '$ pacman -Sddp extra/devtools
http://mirror.bytemark.co.uk/archlinux/extra/os/x86_64/devtools-20120720-1-any.pkg.tar.xz')
I copied that output and ran the sed part on on arm:
$this->bbcode_second_pass_code('', '$ echo http://mirror.bytemark.co.uk/archlinux/extra/os/x86_64/devtools-20120720-1-any.pkg.tar.xz | sed -E 's#(.*/)extra/os/.*#\1$repo/os/$arch#'
http://mirror.bytemark.co.uk/archlinux/$repo/os/$arch
')
That works, so the difference between the pacman output on x86 and arm is not being picked up by the sed part:
$this->bbcode_second_pass_code('', 'http://mirror.archlinuxarm.org/arm/extra/devtools-20120720-1-any.pkg.tar.xz
http://mirror.bytemark.co.uk/archlinux/extra/os/x86_64/devtools-20120720-1-any.pkg.tar.xz')
The reason is that the sed part expects to find "extra/os" in its input but, on arm, the "os" part of the path isn't there.
The correct path on arm is:
$this->bbcode_second_pass_code('', 'http://mirror.archlinuxarm.org/arm/$repo')
and on x86 it is
$this->bbcode_second_pass_code('', 'http://mirror.bytemark.co.uk/archlinux/$repo/os/$arch')
I've tried to make a modified sed and it appears to almost work in both places:
$this->bbcode_second_pass_code('', '
pacman -Sddp extra/devtools 2>/dev/null | sed -E -e 's#(.*/)extra/os/.*#\1$repo/os/$arch#' -e 's#(.*/)extra/.*#\1$repo#'
')
returns on x86:
$this->bbcode_second_pass_code('', 'http://mirror.bytemark.co.uk/archlinux/$repo/os/$arch')
returns on arm:
$this->bbcode_second_pass_code('', 'http://mirror.archlinuxarm.org/arm/$repo')
I ought to raise this as a bug but not sure where to do that. Presumably the location of the problem is something that would need to be agreed between the ArchLinux and the ArchLinuxARM folks as to whether this is a mkarchroot issue or a directory issue on the arm side.
Let me know and I'll raise an appropriate bug report.
Here is a patch for mkarchroot:
$this->bbcode_second_pass_code('', '
--- /usr/sbin/mkarchroot 2012-07-21 18:08:16.000000000 +0100
+++ mkarchroot 2012-10-02 11:17:48.496579764 +0100
@@ -196,7 +196,7 @@
cache_dirs=(${cache_dir})
fi
-host_mirror=$(pacman -Sddp extra/devtools 2>/dev/null | sed -E 's#(.*/)extra/os/.*#\1$repo/os/$arch#')
+host_mirror=$(pacman -Sddp extra/devtools 2>/dev/null | sed -E -e 's#(.*/)extra/os/.*#\1$repo/os/$arch#' -e 's#(.*/)extra/.*#\1$repo#')
if echo "${host_mirror}" | grep -q 'file://'; then
host_mirror_path=$(echo "${host_mirror}" | sed -E 's#file://(/.*)/\$repo/os/\$arch#\1#g')
fi
')