[Rpm-maint] [PATCH] re-factoring rpmInstall & rpmErase - merging common code & removing redundancy
pmatilai at redhat.com
Thu Feb 12 08:33:59 UTC 2009
On Tue, 10 Feb 2009, Rakesh Pandit wrote:
> 2009/2/10 Panu Matilainen wrote:
>> On Thu, 15 Jan 2009, Rakesh Pandit wrote:
>>> - Merge rpmInstallInterfaceFlags_e and rpmEraseInterfaceFlags_e to
>>> - Renamed (UN)?INSTALL_* to RPMCLI_* and all corresponding changes in
>>> different interface related files.
>> As we've talked (outside list), finding a good name for these things seems
>> to be almost the hardest part here, silly as it is. The problem with "cli"
>> for these flags is that it's *too* generic.
>> How about just merge rpmInstallInterfaceFlags_e and rpmEraseInterfaceFlags_e
>> to rpmInstallFlags_e? Obviously erasing isn't installing, but it's at least
>> in the ballpark.
> Very much right.
This still changes the INSTALL_FOO operations to RPMCLI_FOO, which is
kinda unnecessary. Path of least change would probably be leaving the
INSTALL_FOO enumerations as they are and maybe add defines for the
UNINSTALL_FOO bits, like:
#define UNINSTALL_NODEPS INSTALL_NODEPS
>>> Second patch:
>>> - Merged installInterfaceFlags and eraseInterfaceFlags into
>> ..and the same here, if we just follow what query verify etc do here, just
>> call it 'rpmcliInstallFlags'.
>>> - Moved transaction part from rpmInstall and rpmErase to
>> I'd suggest leaving rpmCliTransaction() static for now, just to have the
>> freedom of changing it's arguments if that becomes necessary later on. As
>> long as rpmqv.c is using rpmInstall() and rpmErase(), rpmCliTransaction()
>> doesn't need exporting.
> Yes. Fixed.
One leftover cliInterface bit here:
- rpmInstallFlags installInterfaceFlags;
- rpmInstallFlags eraseInterfaceFlags;
+ rpmInstallFlags rpmcliInterfaceFlags;
Might as well leave that as "rpmInstallFlags installInterfaceFlags;" I
think. Should make the patch a lot smaller too :)
- Panu -
More information about the Rpm-maint