aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-07-02 12:39:42 +0000
committerFrancois Pons <fpons@mandriva.com>2001-07-02 12:39:42 +0000
commit7ae2c69a2fef5f617f68c5f203e71fa4538de27a (patch)
tree4c7bd4bd07a91fdb19b7fad32e245195c658e116
parentd8d949cd037f50fe93e78211675a63bfe002d3e3 (diff)
downloadrpmtools-7ae2c69a2fef5f617f68c5f203e71fa4538de27a.tar
rpmtools-7ae2c69a2fef5f617f68c5f203e71fa4538de27a.tar.gz
rpmtools-7ae2c69a2fef5f617f68c5f203e71fa4538de27a.tar.bz2
rpmtools-7ae2c69a2fef5f617f68c5f203e71fa4538de27a.tar.xz
rpmtools-7ae2c69a2fef5f617f68c5f203e71fa4538de27a.zip
added arch support for parsehdlist.
-rw-r--r--parsehdlist.c19
-rw-r--r--rpmtools.spec5
2 files changed, 18 insertions, 6 deletions
diff --git a/parsehdlist.c b/parsehdlist.c
index c8ab948..af8b904 100644
--- a/parsehdlist.c
+++ b/parsehdlist.c
@@ -388,7 +388,7 @@ int main(int argc, char **argv)
/* interactive mode */
while (interactive_mode) {
char in_name[4096];
- char *in_tag, *in_version, *in_release;
+ char *in_tag, *in_version, *in_release, *in_arch;
unsigned long hash_in_name;
int i, count = 0;
@@ -398,6 +398,7 @@ int main(int argc, char **argv)
break;
}
*in_tag++ = 0;
+ if ((in_arch = strrchr(in_name, '.')) != NULL && !strchr(in_arch, '-')) *in_arch++ = 0; else in_arch = 0;
if ((in_release = strrchr(in_name, '-')) != NULL) {
*in_release++ = 0;
if ((in_version = strrchr(in_name, '-')) != NULL) {
@@ -406,15 +407,22 @@ int main(int argc, char **argv)
for (i = 0; i < count_headers; ++i) {
if (headers[i].hash_name == hash_in_name && !strcmp(headers[i].name, in_name)) {
if (strcmp(get_name(headers[i].header, RPMTAG_VERSION), in_version)) continue;
- if (strcmp(get_name(headers[i].header, RPMTAG_RELEASE), in_release)) continue;
+ if (strcmp(get_name(headers[i].header, RPMTAG_RELEASE), in_release)) {
+ if (in_arch) in_arch[-1] = '.';
+ if (strcmp(get_name(headers[i].header, RPMTAG_RELEASE), in_release)) {
+ if (in_arch) in_arch[-1] = 0;
+ continue;
+ }
+ } else if (in_arch && strcmp(get_name(headers[i].header, RPMTAG_ARCH), in_arch)) continue;
print_header_flag_interactive(in_tag, headers[i].header);
++count;
break; /* special case to avoid multiple output for multiply defined same package */
}
}
- if (!count) in_version[-1] = '-';
+ in_version[-1] = '-';
}
if (!count) {
+ if (in_arch) in_arch[-1] = '.';
in_version = in_release;
hash_in_name = hash(in_name);
for (i = 0; i < count_headers; ++i) {
@@ -424,15 +432,16 @@ int main(int argc, char **argv)
++count;
}
}
- if (!count) in_version[-1] = '-';
+ in_version[-1] = '-';
}
}
if (!count) {
+ if (in_arch) in_arch[-1] = '.';
hash_in_name = hash(in_name);
for (i = 0; i < count_headers; ++i) {
if (headers[i].hash_name == hash_in_name && !strcmp(headers[i].name, in_name)) {
print_header_flag_interactive(in_tag, headers[i].header);
- ++count;
+ ++count;
}
}
}
diff --git a/rpmtools.spec b/rpmtools.spec
index 86316b6..e388e07 100644
--- a/rpmtools.spec
+++ b/rpmtools.spec
@@ -1,5 +1,5 @@
%define name rpmtools
-%define release 6mdk
+%define release 7mdk
# do not modify here, see Makefile in the CVS
%define version 3.0
@@ -54,6 +54,9 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/perl5/man/*/*
%changelog
+* Mon Jul 2 2001 François Pons <fpons@mandrakesoft.com> 3.0-7mdk
+- added arch check support for parsehdlist.
+
* Thu Jun 28 2001 François Pons <fpons@mandrakesoft.com> 3.0-6mdk
- removed some specific urpm code to urpm package.
- removed obsoleted methods.