1 |
commit: b2b6ac0932d7214f17752e9b89a6603580a857e5 |
2 |
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Feb 16 17:48:13 2018 +0000 |
4 |
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Mar 2 08:33:39 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b2b6ac09 |
7 |
|
8 |
vcs-clean.eclass: Split off clean helpers from eutils.eclass. |
9 |
|
10 |
Split off functions ecvs_clean, esvn_clean, and egit_clean into |
11 |
a dedicated vcs-clean.eclass. No code changes. |
12 |
|
13 |
For backwards compatibility, eutils inherits the new eclass in |
14 |
existing EAPIs. |
15 |
|
16 |
eclass/eutils.eclass | 34 ++-------------------------------- |
17 |
eclass/vcs-clean.eclass | 40 ++++++++++++++++++++++++++++++++++++++++ |
18 |
2 files changed, 42 insertions(+), 32 deletions(-) |
19 |
|
20 |
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass |
21 |
index 0a5bf385358..7840afbb77b 100644 |
22 |
--- a/eclass/eutils.eclass |
23 |
+++ b/eclass/eutils.eclass |
24 |
@@ -20,7 +20,8 @@ _EUTILS_ECLASS=1 |
25 |
# implicitly inherited (now split) eclasses |
26 |
case ${EAPI:-0} in |
27 |
0|1|2|3|4|5|6) |
28 |
- inherit desktop epatch estack ltprune multilib preserve-libs toolchain-funcs |
29 |
+ inherit desktop epatch estack ltprune multilib preserve-libs \ |
30 |
+ toolchain-funcs vcs-clean |
31 |
;; |
32 |
esac |
33 |
|
34 |
@@ -37,37 +38,6 @@ if ! declare -F eqawarn >/dev/null ; then |
35 |
} |
36 |
fi |
37 |
|
38 |
-# @FUNCTION: ecvs_clean |
39 |
-# @USAGE: [list of dirs] |
40 |
-# @DESCRIPTION: |
41 |
-# Remove CVS directories recursiveley. Useful when a source tarball contains |
42 |
-# internal CVS directories. Defaults to $PWD. |
43 |
-ecvs_clean() { |
44 |
- [[ $# -eq 0 ]] && set -- . |
45 |
- find "$@" '(' -type d -name 'CVS' -prune -o -type f -name '.cvs*' ')' \ |
46 |
- -exec rm -rf '{}' + |
47 |
-} |
48 |
- |
49 |
-# @FUNCTION: esvn_clean |
50 |
-# @USAGE: [list of dirs] |
51 |
-# @DESCRIPTION: |
52 |
-# Remove .svn directories recursiveley. Useful when a source tarball contains |
53 |
-# internal Subversion directories. Defaults to $PWD. |
54 |
-esvn_clean() { |
55 |
- [[ $# -eq 0 ]] && set -- . |
56 |
- find "$@" -type d -name '.svn' -prune -exec rm -rf '{}' + |
57 |
-} |
58 |
- |
59 |
-# @FUNCTION: egit_clean |
60 |
-# @USAGE: [list of dirs] |
61 |
-# @DESCRIPTION: |
62 |
-# Remove .git* directories/files recursiveley. Useful when a source tarball |
63 |
-# contains internal Git directories. Defaults to $PWD. |
64 |
-egit_clean() { |
65 |
- [[ $# -eq 0 ]] && set -- . |
66 |
- find "$@" -type d -name '.git*' -prune -exec rm -rf '{}' + |
67 |
-} |
68 |
- |
69 |
# @FUNCTION: emktemp |
70 |
# @USAGE: [temp dir] |
71 |
# @DESCRIPTION: |
72 |
|
73 |
diff --git a/eclass/vcs-clean.eclass b/eclass/vcs-clean.eclass |
74 |
new file mode 100644 |
75 |
index 00000000000..649a9e3039b |
76 |
--- /dev/null |
77 |
+++ b/eclass/vcs-clean.eclass |
78 |
@@ -0,0 +1,40 @@ |
79 |
+# Copyright 1999-2018 Gentoo Foundation |
80 |
+# Distributed under the terms of the GNU General Public License v2 |
81 |
+ |
82 |
+# @ECLASS: vcs-clean.eclass |
83 |
+# @MAINTAINER: |
84 |
+# base-system@g.o |
85 |
+# @AUTHOR: |
86 |
+# Benedikt Böhm <hollow@g.o> |
87 |
+# @BLURB: helper functions to remove VCS directories |
88 |
+ |
89 |
+# @FUNCTION: ecvs_clean |
90 |
+# @USAGE: [list of dirs] |
91 |
+# @DESCRIPTION: |
92 |
+# Remove CVS directories and .cvs* files recursively. Useful when a |
93 |
+# source tarball contains internal CVS directories. Defaults to ${PWD}. |
94 |
+ecvs_clean() { |
95 |
+ [[ $# -eq 0 ]] && set -- . |
96 |
+ find "$@" '(' -type d -name 'CVS' -prune -o -type f -name '.cvs*' ')' \ |
97 |
+ -exec rm -rf '{}' + |
98 |
+} |
99 |
+ |
100 |
+# @FUNCTION: esvn_clean |
101 |
+# @USAGE: [list of dirs] |
102 |
+# @DESCRIPTION: |
103 |
+# Remove .svn directories recursively. Useful when a source tarball |
104 |
+# contains internal Subversion directories. Defaults to ${PWD}. |
105 |
+esvn_clean() { |
106 |
+ [[ $# -eq 0 ]] && set -- . |
107 |
+ find "$@" -type d -name '.svn' -prune -exec rm -rf '{}' + |
108 |
+} |
109 |
+ |
110 |
+# @FUNCTION: egit_clean |
111 |
+# @USAGE: [list of dirs] |
112 |
+# @DESCRIPTION: |
113 |
+# Remove .git* directories recursively. Useful when a source tarball |
114 |
+# contains internal Git directories. Defaults to ${PWD}. |
115 |
+egit_clean() { |
116 |
+ [[ $# -eq 0 ]] && set -- . |
117 |
+ find "$@" -type d -name '.git*' -prune -exec rm -rf '{}' + |
118 |
+} |