aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2008-07-14 16:49:08 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2008-07-14 16:49:08 +0000
commit86419fe6b51fed42da704092c42a36399b0391a6 (patch)
tree0964230482b5409d515e4c1f250c5b52cde6f11f /URPM.xs
parent724f619c39ab45497b7a8cdaf568c37c34926a16 (diff)
downloadperl-URPM-86419fe6b51fed42da704092c42a36399b0391a6.tar
perl-URPM-86419fe6b51fed42da704092c42a36399b0391a6.tar.gz
perl-URPM-86419fe6b51fed42da704092c42a36399b0391a6.tar.bz2
perl-URPM-86419fe6b51fed42da704092c42a36399b0391a6.tar.xz
perl-URPM-86419fe6b51fed42da704092c42a36399b0391a6.zip
fix build with rpm5.org HEAD
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs9
1 files changed, 9 insertions, 0 deletions
diff --git a/URPM.xs b/URPM.xs
index 679bede..671ede1 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -26,6 +26,7 @@
#undef Fflush
#undef Mkdir
#undef Stat
+#undef Fstat
#define RPM_VERSION(maj,min,pl) (((maj) << 16) + ((min) << 8) + (pl))
@@ -1263,10 +1264,18 @@ update_header(char *filename, URPM__Package pkg, int keep_all_tags, int vsflags)
rpmtsSetVSFlags(ts, _RPMVSF_NOSIGNATURES | vsflags);
if (fd != NULL && rpmReadPackageFile(ts, fd, filename, &header) == 0 && header) {
char *basename;
+#if RPM_VERSION_CODE >= RPM_VERSION(5,2,0)
+ struct stat sb;
+#else
int_32 size;
+#endif
basename = strrchr(filename, '/');
+#if RPM_VERSION_CODE >= RPM_VERSION(5,2,0)
+ Fstat(fd, &sb);
+#else
size = fdSize(fd);
+#endif
Fclose(fd);
/* this is only kept for compatibility with older distros