1 |
flameeyes 10/07/29 09:38:10 |
2 |
|
3 |
Modified: ruby-fakegem.eclass |
4 |
Log: |
5 |
When unpacking, don't unpack patch files. |
6 |
|
7 |
Since we can declare the patches as an array in global scope, _but_ we |
8 |
cannot use $WORKDIR in there (they are not extracted in proper |
9 |
$WORKDIR but rather $WORKDIR/all, then copied/hardlinked for the |
10 |
various implementations), there is no point into unpacking them when |
11 |
using .bz2. |
12 |
|
13 |
Rather, leave it to epatch to deal with them and for the rest of the time. |
14 |
|
15 |
Revision Changes Path |
16 |
1.22 eclass/ruby-fakegem.eclass |
17 |
|
18 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.22&view=markup |
19 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.22&content-type=text/plain |
20 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.21&r2=1.22 |
21 |
|
22 |
Index: ruby-fakegem.eclass |
23 |
=================================================================== |
24 |
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v |
25 |
retrieving revision 1.21 |
26 |
retrieving revision 1.22 |
27 |
diff -u -r1.21 -r1.22 |
28 |
--- ruby-fakegem.eclass 27 Jul 2010 11:02:47 -0000 1.21 |
29 |
+++ ruby-fakegem.eclass 29 Jul 2010 09:38:09 -0000 1.22 |
30 |
@@ -1,6 +1,6 @@ |
31 |
# Copyright 1999-2009 Gentoo Foundation |
32 |
# Distributed under the terms of the GNU General Public License v2 |
33 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.21 2010/07/27 11:02:47 flameeyes Exp $ |
34 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.22 2010/07/29 09:38:09 flameeyes Exp $ |
35 |
# |
36 |
# @ECLASS: ruby-fakegem.eclass |
37 |
# @MAINTAINER: |
38 |
@@ -152,7 +152,7 @@ |
39 |
# so better taking this into consideration. |
40 |
local quoted_description=${DESCRIPTION//\"/\\\"} |
41 |
cat - > "${T}"/${RUBY_FAKEGEM_NAME}-${_ruby_implementation} <<EOF |
42 |
-# generated by ruby-fakegem.eclass $Revision: 1.21 $ |
43 |
+# generated by ruby-fakegem.eclass $Revision: 1.22 $ |
44 |
Gem::Specification.new do |s| |
45 |
s.name = "${RUBY_FAKEGEM_NAME}" |
46 |
s.version = "${RUBY_FAKEGEM_VERSION}" |
47 |
@@ -206,7 +206,7 @@ |
48 |
#!${rubycmd} |
49 |
# This is a simplified version of the RubyGems wrapper |
50 |
# |
51 |
-# Generated by ruby-fakegem.eclass $Revision: 1.21 $ |
52 |
+# Generated by ruby-fakegem.eclass $Revision: 1.22 $ |
53 |
|
54 |
require 'rubygems' |
55 |
|
56 |
@@ -237,25 +237,36 @@ |
57 |
# extracted twice and the mtime from the archive _has_ to be |
58 |
# ignored (it's always set to epoch 0). |
59 |
for archive in ${A}; do |
60 |
- if [[ ${archive} == *.gem ]]; then |
61 |
- # Make sure that we're not running unoack for more than |
62 |
- # one .gem file, since we won't support that at all. |
63 |
- [[ -d "${S}" ]] && die "Unable to unpack ${archive}, ${S} exists" |
64 |
- |
65 |
- ebegin "Unpacking .gem file..." |
66 |
- tar -mxf ${DISTDIR}/${archive} || die |
67 |
- eend $? |
68 |
- |
69 |
- mkdir "${S}" |
70 |
- pushd "${S}" &>/dev/null |
71 |
- |
72 |
- ebegin "Unpacking data.tar.gz" |
73 |
- tar -mxf "${my_WORKDIR}"/data.tar.gz || die |
74 |
- eend $? |
75 |
- popd &>/dev/null |
76 |
- else |
77 |
- unpack ${archive} |
78 |
- fi |
79 |
+ case "${archive}" in |
80 |
+ *.gem) |
81 |
+ # Make sure that we're not running unoack for more than |
82 |
+ # one .gem file, since we won't support that at all. |
83 |
+ [[ -d "${S}" ]] && die "Unable to unpack ${archive}, ${S} exists" |
84 |
+ |
85 |
+ ebegin "Unpacking .gem file..." |
86 |
+ tar -mxf ${DISTDIR}/${archive} || die |
87 |
+ eend $? |
88 |
+ |
89 |
+ mkdir "${S}" |
90 |
+ pushd "${S}" &>/dev/null |
91 |
+ |
92 |
+ ebegin "Unpacking data.tar.gz" |
93 |
+ tar -mxf "${my_WORKDIR}"/data.tar.gz || die |
94 |
+ eend $? |
95 |
+ popd &>/dev/null |
96 |
+ ;; |
97 |
+ *.patch.bz2) |
98 |
+ # We apply the patches with RUBY_PATCHES directly from DISTDIR, |
99 |
+ # as the WORKDIR variable changes value between the global-scope |
100 |
+ # and the time all_ruby_unpack/_prepare are called. Since we can |
101 |
+ # simply decompress them when applying, this is much easier to |
102 |
+ # deal with for us. |
103 |
+ einfo "Keeping ${archive} as-is" |
104 |
+ ;; |
105 |
+ *) |
106 |
+ unpack ${archive} |
107 |
+ ;; |
108 |
+ esac |
109 |
done |
110 |
} |