Closed markdirish closed 2 years ago
Made some changes. In the error functions that previously used getprogname
, I changed to the new libutil_getprogname
, but they will return NULL
now unless the calling program calls libutil_setprogname
Thanks for help navigating it. If I have to make a PR again, at least I'll know how everything fits together now.
Newer versions of
rpm
make use ofgetprogname
/setprogname
to change behavior of the main program. We had privately implementedgetprogname
, but this PR seeks to implementsetprogname
as well. I created a static global variable__progname
to track the string, which is then returned fromgetprogname
.HOWEVER, I wasn't sure if it was best practice to modify current
getprogname
behavior, which is to simply go and grab the program name if it hasn't already been set. As written in this PR,getprogname
will set the progname to the value retrieved from getargs ifsetprogname
hasn't been called yet.Part of: https://github.ibm.com/ibmi-oss/rpm-specs/issues/1527
Create an implementation of setprogname that sets the global progname variable Modify getprogname to use the new global progname variable, but still generates its own name if __progname is NULL Move progname functions to err.c
Signed-off-by: Mark Irish markdirish@gmail.com