Re: How do i force upgrade a installed package through the C API?

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

 



On Mon, 19 Jan 2004, Ram Prakash. R wrote:

> Hello,
>       I have written an application in C which upgrades already running 
> package. I do the following:
> 
>    rpmtsCreate()
>    rpmtsAddInstallElement () /* with the upgrade flag set to 1 */
>    rpmtsCheck()
>    rpmtsOrder()
>    rpmtsRun()
> 
> The rpmtsRun function fails saying the package is already installed. How do I 
> specify that I want to do a forced upgrade of the package in the C API? 

The equivalent of --force in the C API is setting the right rpm problem 
filter flags, basically:

      int probFilter = 0;
      ...
      probFilter |= RPMPROB_FILTER_REPLACEPKG;
      probFilter |= RPMPROB_FILTER_REPLACEOLDFILES;
      probFilter |= RPMPROB_FILTER_REPLACENEWFILES;
      ...
      rpmtsRun(TS, NULL, (rpmprobFilterFlags)probFilter);

	- Panu -


_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/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