summaryrefslogtreecommitdiff
path: root/eclass
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
commit954de2a7153b630074c6b956cf94d3a2076ccf28 (patch)
tree79128dba05bb005d887d16d71a9ed94465ea56a7 /eclass
parentStable for arm, wrt bug #468504 (diff)
downloadgentoo-2-954de2a7153b630074c6b956cf94d3a2076ccf28.tar.gz
gentoo-2-954de2a7153b630074c6b956cf94d3a2076ccf28.tar.bz2
gentoo-2-954de2a7153b630074c6b956cf94d3a2076ccf28.zip
use find to get file permissions instead of chmod --reference which is not portable, bug #468952
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog6
-rw-r--r--eclass/libtool.eclass11
2 files changed, 11 insertions, 6 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 734fbfd3894d..8ae87def83f0 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for eclass directory
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.818 2013/05/10 22:03:30 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.819 2013/05/11 11:17:58 aballier Exp $
+
+ 11 May 2013; Alexis Ballier <aballier@gentoo.org> libtool.eclass:
+ use find to get file permissions instead of chmod --reference which is not
+ portable, bug #468952
10 May 2013; Michał Górny <mgorny@gentoo.org> python-any-r1.eclass,
python-r1.eclass, python-single-r1.eclass, python-utils-r1.eclass:
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}"
}