1 |
commit 5004eb6d9c47dda023e3758615fb24b2a8a4868f |
2 |
Author: tv <thierry.vignaud@gmail.com> |
3 |
Date: Fri Oct 7 17:30:10 2011 +0200 |
4 |
|
5 |
drop support for rpm-4.4.x |
6 |
|
7 |
rationale: |
8 |
- too much ifdef/else/endif spaghetti |
9 |
- and already broken since rpm-4.6 & rpm-4.8 support patches |
10 |
|
11 |
diff --git a/src/RPM4.xs b/src/RPM4.xs |
12 |
index b891511..64239d9 100644 |
13 |
--- a/src/RPM4.xs |
14 |
+++ b/src/RPM4.xs |
15 |
@@ -65,9 +65,6 @@ |
16 |
#endif |
17 |
|
18 |
#include "rpmversion.h" |
19 |
-#ifdef RPM4_4_6 |
20 |
- #define _RPMPS_INTERNAL |
21 |
-#endif |
22 |
|
23 |
#include <rpm/header.h> |
24 |
#include <rpm/rpmio.h> |
25 |
@@ -410,13 +407,8 @@ void _newspec(rpmts ts, char * filename, SV * svpassphrase, SV * svrootdir, SV * |
26 |
|
27 |
if (filename) { |
28 |
if (!parseSpec(ts, filename, rootdir |
29 |
-#ifndef RPM4_4_8 |
30 |
, NULL |
31 |
-#endif |
32 |
,0, passphrase, cookies, anyarch, force |
33 |
-#ifdef RPM4_4_8 |
34 |
- , verify |
35 |
-#endif |
36 |
)) |
37 |
spec = rpmtsSetSpec(ts, NULL); |
38 |
#ifdef HHACK |
39 |
@@ -748,12 +740,8 @@ platformscore(platform) |
40 |
const char * platform |
41 |
PREINIT: |
42 |
CODE: |
43 |
-#ifdef RPM4_4_8 |
44 |
- RETVAL=rpmPlatformScore(platform, NULL, 0); |
45 |
-#else |
46 |
RETVAL=0; |
47 |
croak("platformscore exists only from rpm 4.4.8"); |
48 |
-#endif |
49 |
OUTPUT: |
50 |
RETVAL |
51 |
|
52 |
@@ -1617,9 +1605,6 @@ Ts_transadd(ts, header, key = NULL, upgrade = 1, sv_relocation = NULL, force = 0 |
53 |
int force |
54 |
PREINIT: |
55 |
rpmRelocation * relocations = NULL; |
56 |
-#ifdef RPM4_4_6 |
57 |
- rpmRelocation relptr = NULL; |
58 |
-#endif |
59 |
HV * hv_relocation; |
60 |
HE * he_relocation; |
61 |
int i = 0; |
62 |
@@ -1643,42 +1628,22 @@ Ts_transadd(ts, header, key = NULL, upgrade = 1, sv_relocation = NULL, force = 0 |
63 |
if (SvTYPE(sv_relocation) == SVt_PV) { |
64 |
/* String value, assume a prefix */ |
65 |
relocations = malloc(2 * sizeof(*relocations)); |
66 |
-#ifdef RPM4_4_6 |
67 |
- relptr = relocations[0]; |
68 |
- relptr->newPath = SvPV_nolen(sv_relocation); |
69 |
- relptr = relocations[1]; |
70 |
- relptr->oldPath = relptr->newPath = NULL; |
71 |
-#else |
72 |
relocations[0].oldPath = NULL; |
73 |
relocations[0].newPath = SvPV_nolen(sv_relocation); |
74 |
relocations[1].oldPath = relocations[1].newPath = NULL; |
75 |
-#endif |
76 |
} else if (SvTYPE(SvRV(sv_relocation)) == SVt_PVHV) { |
77 |
hv_relocation = (HV*)SvRV(sv_relocation); |
78 |
hv_iterinit(hv_relocation); |
79 |
while ((he_relocation = hv_iternext(hv_relocation)) != NULL) { |
80 |
relocations = realloc(relocations, sizeof(*relocations) * (++i)); |
81 |
-#ifdef RPM4_4_6 |
82 |
- relptr = relocations[i-1]; |
83 |
- relptr->oldPath = NULL; |
84 |
- relptr->newPath = NULL; |
85 |
- relptr->oldPath = hv_iterkey(he_relocation, &len); |
86 |
- relptr->newPath = SvPV_nolen(hv_iterval(hv_relocation, he_relocation)); |
87 |
-#else |
88 |
relocations[i-1].oldPath = NULL; |
89 |
relocations[i-1].newPath = NULL; |
90 |
relocations[i-1].oldPath = hv_iterkey(he_relocation, &len); |
91 |
relocations[i-1].newPath = SvPV_nolen(hv_iterval(hv_relocation, he_relocation)); |
92 |
-#endif |
93 |
} |
94 |
/* latest relocation is identify by NULL setting */ |
95 |
relocations = realloc(relocations, sizeof(*relocations) * (++i)); |
96 |
-#ifdef RPM4_4_6 |
97 |
- relptr = relocations[i-1]; |
98 |
- relptr->oldPath = relptr->newPath = NULL; |
99 |
-#else |
100 |
relocations[i-1].oldPath = relocations[i-1].newPath = NULL; |
101 |
-#endif |
102 |
} else { |
103 |
croak("latest argument is set but is not an array ref or a string"); |
104 |
} |