public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH eutils 1/2] Add dointo && newinto.
@ 2012-08-16 20:19 Michał Górny
  2012-08-16 20:19 ` [gentoo-dev] [PATCH eutils 2/2] Convert simple uses to dointo/newinto Michał Górny
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Michał Górny @ 2012-08-16 20:19 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

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

diff --git a/eutils.eclass b/eutils.eclass
index eb8c8f7..119fc32 100644
--- a/eutils.eclass
+++ b/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.
+newinto() {
+	[[ ${#} -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



^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2012-09-19  7:52 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-16 20:19 [gentoo-dev] [PATCH eutils 1/2] Add dointo && newinto Michał Górny
2012-08-16 20:19 ` [gentoo-dev] [PATCH eutils 2/2] Convert simple uses to dointo/newinto Michał Górny
2012-08-16 20:29 ` [gentoo-dev] [PATCH eutils 1/2] Add dointo && newinto Diego Elio Pettenò
2012-08-16 20:45   ` Michał Górny
2012-08-16 20:45     ` Diego Elio Pettenò
2012-08-16 21:23       ` Michał Górny
2012-08-16 20:36 ` Ulrich Mueller
2012-08-16 20:46   ` Michał Górny
2012-08-16 22:02     ` Ulrich Mueller
2012-08-16 22:23       ` [gentoo-dev] [PATCH eutils] " Michał Górny
2012-08-17 16:53 ` [gentoo-dev] [PATCH eutils 1/2] " Jeroen Roovers
2012-08-17 17:13   ` Michał Górny
2012-08-18  3:25 ` Mike Frysinger
2012-08-18  7:21   ` Michał Górny
2012-08-18 15:45     ` Mike Frysinger
2012-09-19  5:45 ` Mike Frysinger
2012-09-19  7:51   ` Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox