Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: reavertm@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH autotools-utils 6/9] Refactor remove_libtool_files() to simplify conditions.
Date: Tue, 13 Sep 2011 14:13:16
Message-Id: 1315923033-23397-6-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH autotools-utils 1/9] Fix handling whitespace in filenames when looking for .la files. by "Michał Górny"
1 ---
2 eclass/autotools-utils.eclass | 18 ++++++++++--------
3 1 files changed, 10 insertions(+), 8 deletions(-)
4
5 diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
6 index 84f6cb6..48b39cb 100644
7 --- a/eclass/autotools-utils.eclass
8 +++ b/eclass/autotools-utils.eclass
9 @@ -162,18 +162,20 @@ remove_libtool_files() {
10 local archivefile=${f/%.la/.a}
11 [[ "${f}" != "${archivefile}" ]] || die 'regex sanity check failed'
12
13 - # Keep .la files when:
14 - # - they have shouldnotlink=yes - likely plugins,
15 - # - respective static archive exists.
16 - if [[ ${removing_all} || ( -z ${shouldnotlink} && ! -f ${archivefile} ) ]]; then
17 - einfo "Removing unnecessary ${f#${D%/}}"
18 - rm -f "${f}" || die
19 - fi
20 -
21 # Remove static libs we're not supposed to link against
22 if [[ ${shouldnotlink} ]]; then
23 einfo "Removing unnecessary ${archivefile#${D%/}}"
24 rm -f "${archivefile}" || die
25 + # We're never going to remove the .la file.
26 + [[ ${removing_all} ]] || continue
27 + fi
28 +
29 + # Keep .la files when:
30 + # - they have shouldnotlink=yes - likely plugins (handled above),
31 + # - respective static archive exists.
32 + if [[ ${removing_all} || ! -f ${archivefile} ]]; then
33 + einfo "Removing unnecessary ${f#${D%/}}"
34 + rm -f "${f}" || die
35 fi
36 done
37 }
38 --
39 1.7.6.1