Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Gentoo: Dev

[PATCH eutils] Add dointo && newinto.

 

 

Gentoo dev RSS feed   Index | Next | Previous | View Threaded


mgorny at gentoo

Aug 16, 2012, 3:23 PM

Post #1 of 1 (78 views)
Permalink
[PATCH eutils] Add dointo && newinto.

---
gx86/eclass/eutils.eclass | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)

diff --git a/gx86/eclass/eutils.eclass b/gx86/eclass/eutils.eclass
index eb8c8f7..edea3ea 100644
--- a/gx86/eclass/eutils.eclass
+++ b/gx86/eclass/eutils.eclass
@@ -650,6 +650,43 @@ edos2unix() {
sed -i 's/\r$//' -- "$@" || die
}

+# @FUNCTION: dointo
+# @USAGE: <directory> <file> [...]
+# @DESCRIPTION:
+# Install all specified <file>s into <directory>. This doesn't modify global
+# 'insinto' path. Alike doins, calls 'die' on failure in EAPI 4+; in earlier
+# EAPIs, returns false in that case.
+dointo() {
+ [[ ${#} -gt 2 ]] || die 'Synopsis: dointo <directory> <file> [...]'
+
+ local directory=${1}
+ shift
+
+ (
+ insinto "${directory}" && \
+ doins "${@}"
+ )
+}
+
+# @FUNCTION: newinto
+# @USAGE: <directory> <file> <new-name>
+# @DESCRIPTION:
+# Install the specified <file> into <directory>, renaming it to <new-name>.
+# This doesn't modify global 'insinto' path. Alike doins, calls 'die' on failure
+# in EAPI 4+; in earlier EAPIs, returns false in that case.
+dointo() {
+ [[ ${#} -eq 3 ]] || die 'Synopsis: newinto <directory> <file> <new-name>'
+
+ local directory=${1}
+ local f=${2}
+ local new_name=${3}
+
+ (
+ insinto "${directory}" && \
+ newins "${f}" "${new_name}"
+ )
+}
+
# @FUNCTION: make_desktop_entry
# @USAGE: make_desktop_entry(<command>, [name], [icon], [type], [fields])
# @DESCRIPTION:
--
1.7.11.1

Gentoo dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.