/[packages]/cauldron/rpm/current/SOURCES/rpm-4.6.1-setup-rubygems.patch
ViewVC logotype

Contents of /cauldron/rpm/current/SOURCES/rpm-4.6.1-setup-rubygems.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 343 - (show annotations) (download)
Sat Jan 8 00:05:19 2011 UTC (9 years, 2 months ago) by tmb
File size: 2213 byte(s)
imported package rpm
1 diff -p -up rpm-4.6.1/build/parsePrep.c.1017~ rpm-4.6.1/build/parsePrep.c
2 --- rpm-4.6.1/build/parsePrep.c.1017~ 2010-10-18 11:43:11.990977199 +0000
3 +++ rpm-4.6.1/build/parsePrep.c 2010-10-18 11:47:22.228774653 +0000
4 @@ -147,7 +147,9 @@ static char *doUntar(rpmSpec spec, uint3
5 {
6 char *fn;
7 char *buf = NULL;
8 - char *tar, *taropts;
9 + char *tar, taropts[8];
10 + char *t;
11 + int rubygem = 0;
12 struct Source *sp;
13 rpmCompressedMagic compressed = COMPRESSED_NOT;
14
15 @@ -172,8 +174,16 @@ static char *doUntar(rpmSpec spec, uint3
16
17 fn = rpmGetPath("%{_sourcedir}/", sp->source, NULL);
18
19 - /* FIX: shrug */
20 - taropts = ((rpmIsVerbose() && !quietly) ? "-xvvf" : "-xf");
21 + t = rindex(sp->source, '.');
22 + if(t && !strcasecmp(t, ".gem"))
23 + rubygem = 1;
24 +
25 + t = stpcpy(taropts, "-x");
26 + if(rpmIsVerbose() && !quietly)
27 + t = stpcpy(t, "vv");
28 + if(rubygem)
29 + t = stpcpy(t, "m");
30 + t = stpcpy(t, "f");
31
32 #ifdef AUTOFETCH_NOT /* XXX don't expect this code to be enabled */
33 /* XXX
34 @@ -231,10 +241,20 @@ static char *doUntar(rpmSpec spec, uint3
35 zipper = rpmGetPath(t, NULL);
36 if (needtar) {
37 rasprintf(&buf, "%s '%s' | %s %s - \n"
38 - "STATUS=$?\n"
39 - "if [ $STATUS -ne 0 ]; then\n"
40 - " exit $STATUS\n"
41 - "fi", zipper, fn, tar, taropts);
42 + "STATUS=$?\n"
43 + "if [ $STATUS -ne 0 ]; then\n"
44 + " exit $STATUS\n"
45 + "fi", zipper, fn, tar, taropts);
46 + if(rubygem) {
47 + t = stpcpy(t,
48 + "\n"
49 + "if [ -f data.tar.gz ]; then\n"
50 + " tar ");
51 + t = stpcpy(t, taropts);
52 + t = stpcpy(t,
53 + " data.tar.gz\n"
54 + "fi");
55 + }
56 } else {
57 rasprintf(&buf, "%s '%s'\n"
58 "STATUS=$?\n"
59 @@ -358,6 +378,20 @@ static int doSetupMacro(rpmSpec spec, co
60 free(buf);
61 }
62
63 + /* check if source is a ruby gem */
64 + { struct Source *sp;
65 + for (sp = spec->sources; sp != NULL; sp = sp->next) {
66 + if ((sp->flags & RPMBUILD_ISSOURCE) && (sp->num == 0)) {
67 + break;
68 + }
69 + }
70 + if (sp != NULL) {
71 + char *t = rindex(sp->source, '.');
72 + if(t && !strcasecmp(t, ".gem"))
73 + createDir = 1;
74 + }
75 + }
76 +
77 /* if necessary, create and cd into the proper dir */
78 if (createDir) {
79 rasprintf(&buf, RPM_MKDIR_P " %s\ncd '%s'",

  ViewVC Help
Powered by ViewVC 1.1.26