diff -r d842feb64ecb -r a3e288343fe7 src/import-rpmdb.c --- a/src/import-rpmdb.c Thu Mar 12 20:52:12 2009 +0000 +++ b/src/import-rpmdb.c Thu Jul 02 11:31:03 2009 +0100 @@ -1,6 +1,7 @@ /* * Copyright (C) 2008 Kristian Høgsberg * Copyright (C) 2008 Red Hat, Inc + * Copyright (C) 2009 J. Ali Harlow * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -79,6 +80,21 @@ versions.list[i]); } +static void +add_script(struct razor_importer *importer, + uint32_t type_flags, Header h, + int32_t program_tag, int32_t body_tag) +{ + union rpm_entry program, body; + int32_t type, count; + + headerGetEntry(h, program_tag, &type, &program.p, &count); + headerGetEntry(h, body_tag, &type, &body.p, &count); + + razor_importer_add_script(importer, type_flags, + program.string, body.string); +} + struct razor_set * razor_set_create_from_rpmdb(void) { @@ -163,6 +179,12 @@ razor_importer_add_file(importer, filename); } + add_script(importer, RAZOR_PROPERTY_PREUN, h, + RPMTAG_PREUNPROG, RPMTAG_PREUN); + + add_script(importer, RAZOR_PROPERTY_POSTUN, h, + RPMTAG_POSTUNPROG, RPMTAG_POSTUN); + razor_importer_finish_package(importer); printf("\rimporting %d", ++imported_count);