summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorKrzysztof Pawlik <nelchael@gentoo.org>2012-04-03 19:21:45 +0000
committerKrzysztof Pawlik <nelchael@gentoo.org>2012-04-03 19:21:45 +0000
commitd90ec58ce758259d2363982ea6cd7c11edbd180a (patch)
tree9c0d4a5da8ac9eac1c078b64059267db18aedc88 /eclass
parentVersion bump including themes with Gentoo colors (#409613), add me as co-main... (diff)
downloadgentoo-2-d90ec58ce758259d2363982ea6cd7c11edbd180a.tar.gz
gentoo-2-d90ec58ce758259d2363982ea6cd7c11edbd180a.tar.bz2
gentoo-2-d90ec58ce758259d2363982ea6cd7c11edbd180a.zip
Add function that makes it easier to properly install Python scripts that get installed automatically by distutils.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog7
-rw-r--r--eclass/python-distutils-ng.eclass15
2 files changed, 20 insertions, 2 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 8a1cbcc30331..9af75a38a356 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for eclass directory
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.201 2012/04/03 19:16:29 nelchael Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.202 2012/04/03 19:21:45 nelchael Exp $
+
+ 03 Apr 2012; Krzysztof Pawlik <nelchael@gentoo.org>
+ python-distutils-ng.eclass:
+ Add function that makes it easier to properly install Python scripts that get
+ installed automatically by distutils.
03 Apr 2012; Krzysztof Pawlik <nelchael@gentoo.org> mercurial.eclass:
Rename ESCM_OFFLINE to EVCS_OFFLINE, see bug #410469.
diff --git a/eclass/python-distutils-ng.eclass b/eclass/python-distutils-ng.eclass
index fe34667bef13..9e48c9b0713d 100644
--- a/eclass/python-distutils-ng.eclass
+++ b/eclass/python-distutils-ng.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/python-distutils-ng.eclass,v 1.10 2012/04/03 19:12:46 nelchael Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python-distutils-ng.eclass,v 1.11 2012/04/03 19:21:45 nelchael Exp $
# @ECLASS: python-distutils-ng
# @MAINTAINER:
@@ -204,6 +204,19 @@ _python-distutils-ng_has_compileall_opt() {
esac
}
+# @FUNCTION: python-distutils-ng_redoscript
+# @USAGE: script_file_path [destination_directory]
+# @DESCRIPTION:
+# Reinstall script installed already by setup.py. This works by first moving the
+# script to ${T} directory and later running python-distutils-ng_doscript on it.
+# script_file_path has to be a full path relative to ${D}.
+python-distutils-ng_redoscript() {
+ local sbn="$(basename "${1}")"
+ mkdir -p "${T}/_${sbn}/" || die "failed to create directory"
+ mv "${D}/${1}" "${T}/_${sbn}/${sbn}" || die "failed to move file"
+ python-distutils-ng_doscript "${T}/_${sbn}/${sbn}" "${2}"
+}
+
# @FUNCTION: python-distutils-ng_doscript
# @USAGE: script_file_name [destination_directory]
# @DESCRIPTION: