script exit codes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have been investigating the use of script error codes in order to prevent the –erase option from being executed.

When I previously asked on this list about using %preun to stop the erasure, I was told that that was bad practice.

 

In walking through the latest code, rpm-4.13.0-rc1, I found something that was confusing.

 

In lib/rpmscript.c, function rpmScriptRun() (which starts on line 434) –

 

    /* Run scriptlet pre hook for all plugins */

    rc = rpmpluginsCallScriptletPre(plugins, script->descr, script_type);

 

    if (rc != RPMRC_FAIL) {

        if (script_type & RPMSCRIPTLET_EXEC) {

            rc = runExtScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, &script->nextFileFunc);

        } else {

            rc = runLuaScript(plugins, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, &script->nextFileFunc);

        }

    }

 

    /* Run scriptlet post hook for all plugins */

    rpmpluginsCallScriptletPost(plugins, script->descr, script_type, rc);

 

The question is – if the rc is equal to RPMRC_FAIL after the call to rpmpluginsCallScriptletPre(), why would you then execute the rpmpluginsCallScriptletPost() function?

 

Jerry Heyman                           |

Principal Software Engineer            |    Software is the difference

EMC Data Domain                        |    between hardware and reality

Jerrold.Heyman@xxxxxxx / 919.597.7812  |

 

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux