summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-05-27 13:58:38 (EDT)
committer P. J. McDermott <pjm@nac.net>2013-05-27 13:58:38 (EDT)
commit5a519379cb2798310f20ebe4fc06c30cec114965 (patch)
treea2c956e115a79f8711dba6fd8250e47d45410fca
parentac48e843249d8f3593476d703ac9d0eefecd5879 (diff)
Manage /usr/bin/ar with update-alternatives.
-rw-r--r--binutils.pkg.in/postinst8
-rw-r--r--binutils.pkg.in/prerm7
-rwxr-xr-xbuild7
3 files changed, 21 insertions, 1 deletions
diff --git a/binutils.pkg.in/postinst b/binutils.pkg.in/postinst
new file mode 100644
index 0000000..ebd719d
--- /dev/null
+++ b/binutils.pkg.in/postinst
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+if [ "x${1}" = 'xconfigure' ]; then
+ if [ "x$(cat /etc/proteanos_arch)" = 'x@PKG_TARGET_ARCH@' ]; then
+ update-alternatives --install /usr/bin/ar ar \
+ /usr/bin/ar.binutils 20
+ fi
+fi
diff --git a/binutils.pkg.in/prerm b/binutils.pkg.in/prerm
new file mode 100644
index 0000000..0eda014
--- /dev/null
+++ b/binutils.pkg.in/prerm
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+if [ "${1}" = remove ]; then
+ if [ "x$(cat /etc/proteanos_arch)" = 'x@PKG_TARGET_ARCH@' ]; then
+ update-alternatives --remove ar /usr/bin/ar.binutils
+ fi
+fi
diff --git a/build b/build
index 1a3ad5e..bcdc56e 100755
--- a/build
+++ b/build
@@ -113,8 +113,13 @@ install: build
for target in $$(cat ../targets); do \
if [ '$(OPK_HOST_ARCH)' = "$${target}" ]; then \
for util in "binutils-$${target}.data/usr/bin/$${target}-"*; do \
+ if [ "$${util}" = 'ar' ]; then \
+ dest='ar.binutils'; \
+ else \
+ dest="$${util##*/$${target}-}"; \
+ fi; \
ln -sf "$${util##*/}" \
- "$${util%/*}/$${util##*/$${target}-}"; \
+ "$${util%/*}/$${dest}"; \
done \
fi; \
done