aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-02-25 19:17:04 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-02-25 19:17:04 +0000
commit6416c07fc43c6592242ec9895f2b035f68817181 (patch)
tree4c7b0abe6046c4cc00582cae9608049fdef5f07e
parente7e8c533b6f98fb49235558a490ad58df43bc3b1 (diff)
downloadperl-URPM-6416c07fc43c6592242ec9895f2b035f68817181.tar
perl-URPM-6416c07fc43c6592242ec9895f2b035f68817181.tar.gz
perl-URPM-6416c07fc43c6592242ec9895f2b035f68817181.tar.bz2
perl-URPM-6416c07fc43c6592242ec9895f2b035f68817181.tar.xz
perl-URPM-6416c07fc43c6592242ec9895f2b035f68817181.zip
- do not add FILENAME_TAG and FILESIZE_TAG to hdlist anymore,
deprecate ->filename and ->header_filename, deprecate URPM::Build build_hdlist and parse_rpms_build_headers
-rw-r--r--NEWS3
-rw-r--r--URPM.pm6
-rw-r--r--URPM.xs49
-rw-r--r--URPM/Build.pm4
4 files changed, 14 insertions, 48 deletions
diff --git a/NEWS b/NEWS
index 50a1047..6507890 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,9 @@
- fix sort choices changed in perl-URPM 3.08
- allow fixing "using one big transaction" that occurs when using --keep
(#30198)
+- do not add FILENAME_TAG and FILESIZE_TAG to hdlist anymore,
+ deprecate ->filename and ->header_filename,
+ deprecate URPM::Build build_hdlist and parse_rpms_build_headers
Version 3.08 - 25 February 2008, by Pascal "Pixel" Rigaux
diff --git a/URPM.pm b/URPM.pm
index 5bda797..3453943 100644
--- a/URPM.pm
+++ b/URPM.pm
@@ -511,10 +511,6 @@ Writes a line of information in a synthesis file.
=item $package->exclusivearchs()
-=item $package->filename()
-
-The rpm's file name.
-
=item $package->files()
List of files in this rpm.
@@ -582,8 +578,6 @@ Return an array of human readable view of tag values. $tagid is the numerical va
=item $package->group()
-=item $package->header_filename()
-
=item $package->id()
=item $package->installtid()
diff --git a/URPM.xs b/URPM.xs
index ca75a8e..e34306b 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -131,9 +131,6 @@ typedef struct s_Package* URPM__Package;
#define FLAG_RATE_INVALID 0
-#define FILENAME_TAG 1000000
-#define FILESIZE_TAG 1000001
-
#define FILTER_MODE_ALL_FILES 0
#define FILTER_MODE_CONF_FILES 2
@@ -833,16 +830,10 @@ pack_header(URPM__Package pkg) {
char *version = get_name(pkg->h, RPMTAG_VERSION);
char *release = get_name(pkg->h, RPMTAG_RELEASE);
char *arch = headerIsEntry(pkg->h, RPMTAG_SOURCERPM) ? get_name(pkg->h, RPMTAG_ARCH) : "src";
- char *filename = get_name(pkg->h, FILENAME_TAG);
p += snprintf(buff, sizeof(buff), "%s-%s-%s.%s@%d@%d@%s@", name, version, release, arch,
get_int(pkg->h, RPMTAG_EPOCH), get_int(pkg->h, RPMTAG_SIZE), get_name(pkg->h, RPMTAG_GROUP));
- if (filename) snprintf(p, sizeof(buff) - (p-buff), "%s-%s-%s.%s.rpm", name, version, release, arch);
- if (!filename || !strcmp(p, filename)) {
- p[-1] = 0;
- } else {
- p = p + 1 + snprintf(p, sizeof(buff) - (p-buff), "%s", filename);
- }
+ p[-1] = 0;
pkg->info = memcpy(malloc(p-buff), buff, p-buff);
}
if (pkg->requires == NULL && pkg->suggests == NULL)
@@ -1274,8 +1265,6 @@ update_header(char *filename, URPM__Package pkg, int keep_all_tags, int vsflags)
basename = strrchr(filename, '/');
size = fdSize(fd);
Fclose(fd);
- headerAddEntry(header, FILENAME_TAG, RPM_STRING_TYPE, basename != NULL ? basename + 1 : filename, 1);
- headerAddEntry(header, FILESIZE_TAG, RPM_INT32_TYPE, &size, 1);
if (pkg->h && !(pkg->flag & FLAG_NO_HEADER_FREE)) headerFree(pkg->h);
pkg->h = header;
@@ -1989,50 +1978,34 @@ Pkg_group(pkg)
XPUSHs(sv_2mortal(newSVpv_utf8(get_name(pkg->h, RPMTAG_GROUP), 0)));
}
+/* deprecated */
void
Pkg_filename(pkg)
URPM::Package pkg
PPCODE:
if (pkg->info) {
- char *s, *eon, *eos;
+ char *eon;
if ((eon = strchr(pkg->info, '@')) != NULL) {
- if ((s = strchr(eon+1, '@')) != NULL && (s = strchr(s+1, '@')) != NULL && (s = strchr(s+1, '@')) != NULL) {
- eos = strchr(s+1, '@');
- XPUSHs(sv_2mortal(newSVpv(s+1, eos != NULL ? eos-s-1 : 0)));
- } else {
char savbuf[4];
memcpy(savbuf, eon, 4); /* there should be at least epoch and size described so (@0@0 minimum) */
memcpy(eon, ".rpm", 4);
XPUSHs(sv_2mortal(newSVpv(pkg->info, eon-pkg->info+4)));
memcpy(eon, savbuf, 4);
- }
}
} else if (pkg->h) {
- char *filename = get_name(pkg->h, FILENAME_TAG);
-
- if (filename != NULL)
- XPUSHs(sv_2mortal(newSVpv(filename, 0)));
}
+/* deprecated */
void
Pkg_header_filename(pkg)
URPM::Package pkg
PPCODE:
if (pkg->info) {
- char *s, *eon, *eos;
+ char *eon;
if ((eon = strchr(pkg->info, '@')) != NULL) {
- if ((s = strchr(eon+1, '@')) != NULL && (s = strchr(s+1, '@')) != NULL && (s = strchr(s+1, '@')) != NULL) {
- eos = strstr(s+1, ".rpm");
- if (eos != NULL) *eos = 0;
- if (eon != NULL) *eon = 0;
- XPUSHs(sv_2mortal(newSVpvf("%s:%s", pkg->info, s+1)));
- if (eon != NULL) *eon = '@';
- if (eos != NULL) *eos = '.';
- } else {
- XPUSHs(sv_2mortal(newSVpv(pkg->info, eon-pkg->info)));
- }
+ XPUSHs(sv_2mortal(newSVpv(pkg->info, eon-pkg->info)));
}
} else if (pkg->h) {
char buff[1024];
@@ -2041,16 +2014,8 @@ Pkg_header_filename(pkg)
char *version = get_name(pkg->h, RPMTAG_VERSION);
char *release = get_name(pkg->h, RPMTAG_RELEASE);
char *arch = headerIsEntry(pkg->h, RPMTAG_SOURCERPM) ? get_name(pkg->h, RPMTAG_ARCH) : "src";
- char *filename = get_name(pkg->h, FILENAME_TAG);
- p += snprintf(buff, sizeof(buff), "%s-%s-%s.%s:", name, version, release, arch);
- if (filename) snprintf(p, sizeof(buff) - (p-buff), "%s-%s-%s.%s.rpm", name, version, release, arch);
- if (!filename || !strcmp(p, filename)) {
- *--p = 0;
- } else {
- p += snprintf(p, sizeof(buff) - (p-buff), "%s", filename);
- *(p -= 4) = 0; /* avoid .rpm */
- }
+ p += snprintf(buff, sizeof(buff), "%s-%s-%s.%s", name, version, release, arch);
XPUSHs(sv_2mortal(newSVpv(buff, p-buff)));
}
diff --git a/URPM/Build.pm b/URPM/Build.pm
index f5a3aff..78942b9 100644
--- a/URPM/Build.pm
+++ b/URPM/Build.pm
@@ -18,6 +18,8 @@ sub _get_tmp_dir () {
#- callback : perl code to be called for each package read (defaults pack_header)
#- clean : bool to clean cache before (default no).
#- packing : bool to create info (default is weird)
+#
+# deprecated
sub parse_rpms_build_headers {
my ($urpm, %options) = @_;
my ($dir, %cache, @headers);
@@ -402,6 +404,8 @@ sub compute_deps {
#- idlist : id list of rpm to compute (defaults is start .. end)
#- ratio : compression ratio (default 4).
#- split : split ratio (default 400kb, see MDV::Packdrakeng).
+#
+# deprecated
sub build_hdlist {
my ($urpm, %options) = @_;
my ($dir, $ratio, @idlist);