diff options
Diffstat (limited to 'URPM.xs')
-rw-r--r-- | URPM.xs | 102 |
1 files changed, 0 insertions, 102 deletions
@@ -28,15 +28,11 @@ #undef Stat #undef Fstat -#ifdef RPM_ORG static inline void *_free(const void * p) { if (p != NULL) free((void *)p); return NULL; } typedef struct rpmSpec_s * Spec; -#else -#include <rpm/rpm46compat.h> -#endif #include <rpm/rpmio.h> #include <rpm/rpmdb.h> @@ -554,9 +550,7 @@ return_list_tag(URPM__Package pkg, int32_t tag_name) { switch (rpmtdType(&td)) { case RPM_NULL_TYPE: break; -#ifdef RPM_ORG case RPM_CHAR_TYPE: -#endif case RPM_INT8_TYPE: case RPM_INT16_TYPE: case RPM_INT32_TYPE: @@ -1181,10 +1175,6 @@ static void drop_tags(Header *h) { headerDel(*h, RPMTAG_FILESIZES); /* ? */ headerDel(*h, RPMTAG_FILERDEVS); /* it seems unused. always empty */ headerDel(*h, RPMTAG_FILEVERIFYFLAGS); /* only used for -V */ -#ifndef RPM_ORG - headerDel(*h, RPMTAG_FILEDIGESTALGOS); /* only used for -V */ - headerDel(*h, RPMTAG_FILEDIGESTS); /* only used for -V */ /* alias: RPMTAG_FILEMD5S */ -#endif /* keep RPMTAG_FILEFLAGS for %config (rpmnew) to work */ /* keep RPMTAG_FILELANGS for %lang (_install_langs) to work */ /* keep RPMTAG_FILELINKTOS for checking conflicts between symlinks */ @@ -1235,18 +1225,10 @@ update_header(char *filename, URPM__Package pkg, __attribute__((unused)) int kee rpmtsSetVSFlags(ts, _RPMVSF_NOSIGNATURES | vsflags); if (fd != NULL && rpmReadPackageFile(ts, fd, filename, &header) == 0 && header) { char *basename; -#ifndef RPM_ORG - struct stat sb; -#else int32_t size; -#endif basename = strrchr(filename, '/'); -#ifndef RPM_ORG - Fstat(fd, &sb); -#else size = fdSize(fd); -#endif Fclose(fd); /* this is only kept for compatibility with older distros @@ -1519,9 +1501,6 @@ int Pkg_is_arch_compat__XS(pkg) URPM::Package pkg INIT: -#ifndef RPM_ORG - char * platform; -#endif CODE: read_config_files(0); if (pkg->info) { @@ -1530,23 +1509,11 @@ Pkg_is_arch_compat__XS(pkg) get_fullname_parts(pkg, NULL, NULL, NULL, &arch, &eos); *eos = 0; -#ifndef RPM_ORG - platform = rpmExpand(arch, "-%{_target_vendor}-%{_target_os}%{?_gnu}", NULL); - RETVAL = rpmPlatformScore(platform, NULL, 0); - _free(platform); -#else RETVAL = rpmMachineScore(RPM_MACHTABLE_INSTARCH, arch); -#endif *eos = '@'; } else if (pkg->h && headerIsEntry(pkg->h, RPMTAG_SOURCERPM)) { char *arch = get_name(pkg->h, RPMTAG_ARCH); -#ifndef RPM_ORG - platform = rpmExpand(arch, "-%{_target_vendor}-%{_target_os}%{?_gnu}", NULL); - RETVAL = rpmPlatformScore(platform, NULL, 0); - _free(platform); -#else RETVAL = rpmMachineScore(RPM_MACHTABLE_INSTARCH, arch); -#endif } else { RETVAL = 0; } @@ -1557,33 +1524,9 @@ int Pkg_is_platform_compat(pkg) URPM::Package pkg INIT: -#ifndef RPM_ORG - char * platform = NULL; - struct rpmtd_s val; -#endif CODE: -#ifndef RPM_ORG - read_config_files(0); - if (pkg->h && headerIsEntry(pkg->h, RPMTAG_PLATFORM)) { - (void) headerGet(pkg->h, RPMTAG_PLATFORM, &val, HEADERGET_DEFAULT); - platform = (char *) rpmtdGetString(&val); - RETVAL = rpmPlatformScore(platform, NULL, 0); - platform = headerFreeData(platform, val.type); - } else if (pkg->info) { - char *arch; - char *eos; - - get_fullname_parts(pkg, NULL, NULL, NULL, &arch, &eos); - *eos = 0; - platform = rpmExpand(arch, "-%{_target_vendor}-", eos, "%{?_gnu}", NULL); - RETVAL = rpmPlatformScore(platform, NULL, 0); - *eos = '@'; - _free(platform); - } else { -#else croak("is_platform_compat() is available only since rpm 4.4.8"); { /* to match last } and avoid another #ifdef for it */ -#endif RETVAL = 0; } @@ -3033,11 +2976,7 @@ Trans_add(trans, pkg, ...) CODE: if ((pkg->flag & FLAG_ID) <= FLAG_ID_MAX && pkg->h != NULL) { int update = 0; -#ifndef RPM_ORG - rpmRelocation relocations = NULL; -#else rpmRelocation *relocations = NULL; -#endif /* compability mode with older interface of add */ if (items == 3) { update = SvIV(ST(2)); @@ -3053,20 +2992,11 @@ Trans_add(trans, pkg, ...) if (SvROK(ST(i+1)) && SvTYPE(SvRV(ST(i+1))) == SVt_PVAV) { AV *excludepath = (AV*)SvRV(ST(i+1)); I32 j = 1 + av_len(excludepath); -#ifndef RPM_ORG - int relno = 0; - relocations = malloc(sizeof(rpmRelocation)); -#else relocations = calloc(j + 1, sizeof(rpmRelocation)); -#endif while (--j >= 0) { SV **e = av_fetch(excludepath, j, 0); if (e != NULL && *e != NULL) { -#ifndef RPM_ORG - rpmfiAddRelocation(&relocations, &relno, SvPV_nolen(*e), NULL); -#else relocations[j].oldPath = SvPV_nolen(*e); -#endif } } } @@ -3075,11 +3005,7 @@ Trans_add(trans, pkg, ...) } RETVAL = rpmtsAddInstallElement(trans->ts, pkg->h, (fnpyKey)(1+(long)(pkg->flag & FLAG_ID)), update, relocations) == 0; /* free allocated memory, check rpm is copying it just above, at least in 4.0.4 */ -#ifndef RPM_ORG - rpmfiFreeRelocations(relocations); -#else free(relocations); -#endif } else RETVAL = 0; OUTPUT: RETVAL @@ -3853,18 +3779,9 @@ int Urpm_archscore(arch) const char * arch PREINIT: -#ifndef RPM_ORG - char * platform = NULL; -#endif CODE: read_config_files(0); -#ifndef RPM_ORG - platform = rpmExpand(arch, "-%{_target_vendor}-%{_target_os}%{?_gnu}", NULL); - RETVAL=rpmPlatformScore(platform, NULL, 0); - _free(platform); -#else RETVAL=rpmMachineScore(RPM_MACHTABLE_INSTARCH, arch); -#endif OUTPUT: RETVAL @@ -3872,18 +3789,9 @@ int Urpm_osscore(os) const char * os PREINIT: -#ifndef RPM_ORG - char * platform = NULL; -#endif CODE: read_config_files(0); -#ifndef RPM_ORG - platform = rpmExpand("%{_target_cpu}-%{_target_vendor}-", os, "%{?_gnu}", NULL); - RETVAL=rpmPlatformScore(platform, NULL, 0); - _free(platform); -#else RETVAL=rpmMachineScore(RPM_MACHTABLE_INSTOS, os); -#endif OUTPUT: RETVAL @@ -3892,13 +3800,9 @@ Urpm_platformscore(platform) const char * platform CODE: read_config_files(0); -#ifndef RPM_ORG - RETVAL=rpmPlatformScore(platform, NULL, 0); -#else unused_variable(platform); croak("platformscore() is available only since rpm 4.4.8"); RETVAL=0; -#endif OUTPUT: RETVAL @@ -3951,13 +3855,7 @@ Urpm_spec2srcheader(specfile) // (See http://www.rpm.org/wiki/Releases/4.9.0) spec = rpmtsSetSpec(ts, NULL); header = spec->sourceHeader; -#endif -#ifdef RPM_ORG -#ifndef RPM490 if (! header) -#endif -#endif -#ifndef RPM490 initSourceHeader(spec); #endif pkg = (URPM__Package)malloc(sizeof(struct s_Package)); |