diff -r e63951c1d0f8 -r 6112bcc5d1cf librazor/rpm.c --- a/librazor/rpm.c Thu Nov 10 10:35:21 2011 +0000 +++ b/librazor/rpm.c Sat Feb 11 23:50:26 2012 +0000 @@ -1,7 +1,7 @@ /* * Copyright (C) 2008 Kristian Høgsberg * Copyright (C) 2008 Red Hat, Inc - * Copyright (C) 2009, 2011 J. Ali Harlow + * Copyright (C) 2009, 2011, 2012 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 @@ -1141,6 +1141,7 @@ const char *path, *name; size_t filesize; char *s; + int retval = 0; assert (rpm != NULL); assert (root != NULL); @@ -1161,10 +1162,10 @@ razor_relocations_set_rpm(rpm->relocations, rpm); if (stage & RAZOR_STAGE_SCRIPTS_PRE) - run_script(&installer, RPMTAG_PREINPROG, RPMTAG_PREIN, - install_count); + retval = run_script(&installer, RPMTAG_PREINPROG, RPMTAG_PREIN, + install_count); - if (stage & RAZOR_STAGE_FILES) { + if (!retval && (stage & RAZOR_STAGE_FILES)) { if (installer_init(&installer)) return -1; @@ -1205,13 +1206,15 @@ if (installer_finish(&installer)) return -1; + + retval = razor_atomic_in_error_state(atomic); } - if (stage & RAZOR_STAGE_SCRIPTS_POST) - run_script(&installer, RPMTAG_POSTINPROG, RPMTAG_POSTIN, - install_count); + if (!retval && (stage & RAZOR_STAGE_SCRIPTS_POST)) + retval = run_script(&installer, RPMTAG_POSTINPROG, + RPMTAG_POSTIN, install_count); - return 0; + return retval; } RAZOR_EXPORT int