summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Ballier <aballier@gentoo.org>2013-05-11 11:17:58 +0000
committerAlexis Ballier <aballier@gentoo.org>2013-05-11 11:17:58 +0000
commite640ad98dec82f56dae9d904c060ec1e6d888454 (patch)
treea1430ba71228552ae134bc3640cde22d66190f45 /eclass/libtool.eclass
parentStable for arm, wrt bug #468504 (diff)
downloadhistorical-e640ad98dec82f56dae9d904c060ec1e6d888454.tar.gz
historical-e640ad98dec82f56dae9d904c060ec1e6d888454.tar.bz2
historical-e640ad98dec82f56dae9d904c060ec1e6d888454.zip
use find to get file permissions instead of chmod --reference which is not portable, bug #468952
Diffstat (limited to 'eclass/libtool.eclass')
-rw-r--r--eclass/libtool.eclass11
1 files changed, 6 insertions, 5 deletions
diff --git a/eclass/libtool.eclass b/eclass/libtool.eclass
index 2a413f3acfd4..3eea6ad10acc 100644
--- a/eclass/libtool.eclass
+++ b/eclass/libtool.eclass
@@ -1,6 +1,6 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.105 2013/05/07 14:23:33 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.106 2013/05/11 11:17:58 aballier Exp $
# @ECLASS: libtool.eclass
# @MAINTAINER:
@@ -55,7 +55,9 @@ ELT_try_and_apply_patch() {
fi
# Save file for permission restoration. `patch` sometimes resets things.
- cp -p "${file}" "${file}.gentoo.elt"
+ # Ideally we'd want 'stat -c %a', but stat is highly non portable and we are
+ # guaranted to have GNU find, so use that instead.
+ local perms="$(find ${file} -maxdepth 0 -printf '%m')"
# We only support patchlevel of 0 - why worry if its static patches?
if patch -p0 --dry-run "${file}" "${patch}" >> "${log}" 2>&1 ; then
einfo " Applying ${disp} ..."
@@ -65,8 +67,7 @@ ELT_try_and_apply_patch() {
else
ret=1
fi
- chmod --reference="${file}.gentoo.elt" "${file}"
- rm -f "${file}.gentoo.elt"
+ chmod "${perms}" "${file}"
return "${ret}"
}