aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--parsehdlist.c25
-rw-r--r--rpmtools.pm2
-rw-r--r--rpmtools.spec9
4 files changed, 29 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index d7b4152..d5f49d6 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION = 4.1
+VERSION = 4.2
NAME = rpmtools
FROMC = parsehdlist rpm2header #rpm-find-leaves
FROMCC = #gendepslist2 hdlist2names hdlist2files hdlist2prereq hdlist2groups
diff --git a/parsehdlist.c b/parsehdlist.c
index 88c9235..86ea778 100644
--- a/parsehdlist.c
+++ b/parsehdlist.c
@@ -164,7 +164,7 @@ void print_list_name(Header header, char *format, char print_sep, int extension)
char *name = get_name(header, RPMTAG_NAME);
char *version = get_name(header, RPMTAG_VERSION);
char *release = get_name(header, RPMTAG_RELEASE);
- char *arch = get_name(header, RPMTAG_ARCH);
+ char *arch = headerIsEntry(header, RPMTAG_SOURCEPACKAGE) ? "src" : get_name(header, RPMTAG_ARCH);
char *buff = alloca(strlen(name) + strlen(version) + strlen(release) + strlen(arch) + 1+1+1 + 5);
printf(format, name, "");
@@ -192,6 +192,21 @@ void print_list_name(Header header, char *format, char print_sep, int extension)
}
static
+void print_multiline(char *format, char *name, char *multiline_str) {
+ char *s, *e;
+ if ((e = strchr(multiline_str, '\n'))) {
+ char buf[4096];
+ for (s = multiline_str;(e = strchr(s, '\n')); s = e+1) {
+ if (e-s >= sizeof(buf)-1) continue; /* else it will fails */
+ memcpy(buf, s, e-s); buf[e-s] = 0;
+ printf(format, name, buf);
+ }
+ } else {
+ printf(format, name, multiline_str);
+ }
+}
+
+static
void print_help(void) {
fprintf(stderr,
"parsehdlist version " VERSION_STRING "\n"
@@ -423,10 +438,10 @@ int main(int argc, char **argv)
if (print_size) printf(printable_header(print_quiet, "size", print_sep, "\n"), name, get_int(header, RPMTAG_SIZE));
if (print_serial) printf(printable_header(print_quiet, "serial", print_sep, "\n"),
name, get_int(header, RPMTAG_EPOCH));
- if (print_summary) printf(printable_header(print_quiet, "summary", print_sep, "\n"),
- name, get_name(header, RPMTAG_SUMMARY));
- if (print_description) printf(printable_header(print_quiet, "description", print_sep, "\n"),
- name, get_name(header, RPMTAG_DESCRIPTION));
+ if (print_summary) print_multiline(printable_header(print_quiet, "summary", print_sep, "\n"),
+ name, get_name(header, RPMTAG_SUMMARY));
+ if (print_description) print_multiline(printable_header(print_quiet, "description", print_sep, "\n"),
+ name, get_name(header, RPMTAG_DESCRIPTION));
if (print_name) print_list_name(header, printable_header(print_quiet, "name", print_sep, 0), print_sep, 0);
if (print_info) print_list_name(header, printable_header(print_quiet, "info", print_sep, 0), print_sep, 1);
if ((print_name | print_info | print_group | print_size | print_serial | print_summary | print_description |
diff --git a/rpmtools.pm b/rpmtools.pm
index a5e4ebf..d8954c1 100644
--- a/rpmtools.pm
+++ b/rpmtools.pm
@@ -6,7 +6,7 @@ use vars qw($VERSION @ISA %compat_arch);
require DynaLoader;
@ISA = qw(DynaLoader);
-$VERSION = '4.1';
+$VERSION = '4.2';
bootstrap rpmtools $VERSION;
diff --git a/rpmtools.spec b/rpmtools.spec
index 797dccc..26a2ae2 100644
--- a/rpmtools.spec
+++ b/rpmtools.spec
@@ -1,8 +1,8 @@
%define name rpmtools
-%define release 4mdk
+%define release 1mdk
# do not modify here, see Makefile in the CVS
-%define version 4.1
+%define version 4.2
%{expand:%%define perlbase_version %(rpm -q --queryformat '%{VERSION}' perl-base)}
%{expand:%%define rpm_version %(rpm -q --queryformat '%{VERSION}-%{RELEASE}' rpm)}
@@ -54,6 +54,11 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/perl5/man/*/*
%changelog
+* Fri Feb 8 2002 François Pons <fpons@mandrakesoft.com> 4.2-1mdk
+- fixed --descriptions and --summary of parsehdlist for multiline
+ output by adding prefix after each linefeed.
+- fixed management of source package.
+
* Tue Feb 5 2002 François Pons <fpons@mandrakesoft.com> 4.1-4mdk
- added possible fixes for using build_hdlist in specific
environment.