Re: [gentoo-dev] mono.eclass EAPI3(/4)

2011-03-25 Thread Donnie Berkholz
On 23:48 Thu 24 Mar , Christoph Mende wrote:
 Index: mono.eclass
 ===
 RCS file: /var/cvsroot/gentoo-x86/eclass/mono.eclass,v
 retrieving revision 1.13
 diff -u -b -B -r1.13 mono.eclass
 --- mono.eclass   8 Mar 2009 15:46:54 -   1.13
 +++ mono.eclass   24 Mar 2011 22:47:08 -
 @@ -35,24 +35,26 @@
  unset MONO_AOT_CACHE
  
  egacinstall() {
 + [[ -z ${ED+set} ]]  local ED=${D%/}${EPREFIX}/
   gacutil -i ${1} \
 - -root ${D}/usr/$(get_libdir) \
 + -root ${ED}/usr/$(get_libdir) \
   -gacdir /usr/$(get_libdir) \
   -package ${2:-${GACPN:-${PN}}} \
   || die installing ${1} into the Global Assembly Cache failed
  }
  
  mono_multilib_comply() {
 + [[ -z ${ED+set} ]]  local ED=${D%/}${EPREFIX}/
   local dir finddirs=() mv_command=${mv_command:-mv}
 - if [[ -d ${D}/usr/lib  $(get_libdir) != lib ]]
 + if [[ -d ${ED}/usr/lib  $(get_libdir) != lib ]]

No need for quotes when expanding variables or functions inside [[ ]]. 
That holds true for the rest of the diff, too. I'd also split this (and 
a later find call) into two separate conditionals, with just one test 
per [[ ]].

-- 
Thanks,
Donnie

Donnie Berkholz
Sr. Developer, Gentoo Linux
Blog: http://dberkholz.com


pgp15BGErOV6U.pgp
Description: PGP signature


[gentoo-dev] mono.eclass EAPI3(/4)

2011-03-24 Thread Christoph Mende
Hi,

this should make mono.eclass EAPI3 compatible, please review the
attached patch before I commit it, so you can throw your stones before
it appears on gentoo-commits. Thanks.
Index: mono.eclass
===
RCS file: /var/cvsroot/gentoo-x86/eclass/mono.eclass,v
retrieving revision 1.13
diff -u -b -B -r1.13 mono.eclass
--- mono.eclass	8 Mar 2009 15:46:54 -	1.13
+++ mono.eclass	24 Mar 2011 22:47:08 -
@@ -35,24 +35,26 @@
 unset MONO_AOT_CACHE
 
 egacinstall() {
+	[[ -z ${ED+set} ]]  local ED=${D%/}${EPREFIX}/
 	gacutil -i ${1} \
-		-root ${D}/usr/$(get_libdir) \
+		-root ${ED}/usr/$(get_libdir) \
 		-gacdir /usr/$(get_libdir) \
 		-package ${2:-${GACPN:-${PN}}} \
 		|| die installing ${1} into the Global Assembly Cache failed
 }
 
 mono_multilib_comply() {
+	[[ -z ${ED+set} ]]  local ED=${D%/}${EPREFIX}/
 	local dir finddirs=() mv_command=${mv_command:-mv}
-	if [[ -d ${D}/usr/lib  $(get_libdir) != lib ]]
+	if [[ -d ${ED}/usr/lib  $(get_libdir) != lib ]]
 	then
-		if ! [[ -d ${D}/usr/$(get_libdir) ]]
+		if ! [[ -d ${ED}/usr/$(get_libdir) ]]
 		then
-			mkdir ${D}/usr/$(get_libdir) || die Couldn't mkdir ${D}/usr/$(get_libdir)
+			mkdir ${ED}/usr/$(get_libdir) || die Couldn't mkdir ${ED}/usr/$(get_libdir)
 		fi
-		${mv_command} ${D}/usr/lib/* ${D}/usr/$(get_libdir)/ || die Moving files into correct libdir failed
-		rm -rf ${D}/usr/lib
-		for dir in ${D}/usr/$(get_libdir)/pkgconfig ${D}/usr/share/pkgconfig
+		${mv_command} ${ED}/usr/lib/* ${ED}/usr/$(get_libdir)/ || die Moving files into correct libdir failed
+		rm -rf ${ED}/usr/lib
+		for dir in ${ED}/usr/$(get_libdir)/pkgconfig ${ED}/usr/share/pkgconfig
 		do
 
 			if [[ -d ${dir}  $(find ${dir} -name '*.pc') !=  ]]
@@ -64,9 +66,9 @@
 popd ${dir}  /dev/null
 			fi
 		done
-		if [[ -d ${D}/usr/bin ]]
+		if [[ -d ${ED}/usr/bin ]]
 		then
-			for exe in ${D}/usr/bin/*
+			for exe in ${ED}/usr/bin/*
 			do
 if [[ $(file ${exe}) == *shell script text* ]]
 then


Re: [gentoo-dev] mono.eclass EAPI3(/4)

2011-03-24 Thread Christoph Mende
On Thu, 2011-03-24 at 23:48 +0100, Christoph Mende wrote:
 Hi,
 
 this should make mono.eclass EAPI3 compatible, please review the
 attached patch before I commit it, so you can throw your stones before
 it appears on gentoo-commits. Thanks.

Tiny update to the patch:
24/235024 @ABCD I would set ED as follows: `use !prefix  has
${EAPI:-0} 0 1 2  ED=${D}`