public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] Remove and upgrade in ebuild
@ 2004-11-26  9:01 Andrea Carpani
  2004-11-26 12:45 ` Paul de Vrieze
  0 siblings, 1 reply; 4+ messages in thread
From: Andrea Carpani @ 2004-11-26  9:01 UTC (permalink / raw
  To: gentoo-portage-dev

Hi everybody, I'm writing a custom ebuild and I'd like some actions to
be taken only when a package is removed from my system. 
At first I thought that pkg_postrm was the answer, but I discovered that
the function is also executed during an upgrade when the older version
is removed. 
I can't check has_version because at "pkg_postrm" time the package I'm
removing seems still registered. 

Any ideas? 
Thanks.

-- 

andrea@carpani.net
Andrea Carpani
.a.c.



--
gentoo-portage-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-portage-dev] Remove and upgrade in ebuild
  2004-11-26  9:01 [gentoo-portage-dev] Remove and upgrade in ebuild Andrea Carpani
@ 2004-11-26 12:45 ` Paul de Vrieze
  2004-11-26 12:47   ` Paul de Vrieze
  0 siblings, 1 reply; 4+ messages in thread
From: Paul de Vrieze @ 2004-11-26 12:45 UTC (permalink / raw
  To: gentoo-portage-dev

[-- Attachment #1: Type: text/plain, Size: 684 bytes --]

On Friday 26 November 2004 10:01, Andrea Carpani wrote:
> Hi everybody, I'm writing a custom ebuild and I'd like some actions to
> be taken only when a package is removed from my system.
> At first I thought that pkg_postrm was the answer, but I discovered
> that the function is also executed during an upgrade when the older
> version is removed.
> I can't check has_version because at "pkg_postrm" time the package I'm
> removing seems still registered.

What about
if has_version \<$PF || has_version \>$PF; then
fi

btw. What kind of action would that be?

Paul

-- 
Paul de Vrieze
Gentoo Developer
Mail: pauldv@gentoo.org
Homepage: http://www.devrieze.net

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-portage-dev] Remove and upgrade in ebuild
  2004-11-26 12:45 ` Paul de Vrieze
@ 2004-11-26 12:47   ` Paul de Vrieze
  2004-11-26 14:25     ` Andrea Carpani
  0 siblings, 1 reply; 4+ messages in thread
From: Paul de Vrieze @ 2004-11-26 12:47 UTC (permalink / raw
  To: gentoo-portage-dev

[-- Attachment #1: Type: text/plain, Size: 887 bytes --]

On Friday 26 November 2004 13:45, Paul de Vrieze wrote:
> On Friday 26 November 2004 10:01, Andrea Carpani wrote:
> > Hi everybody, I'm writing a custom ebuild and I'd like some actions
> > to be taken only when a package is removed from my system.
> > At first I thought that pkg_postrm was the answer, but I discovered
> > that the function is also executed during an upgrade when the older
> > version is removed.
> > I can't check has_version because at "pkg_postrm" time the package
> > I'm removing seems still registered.
>
> What about
> if has_version \<$PF || has_version \>$PF; then
> fi
>
> btw. What kind of action would that be?

You could also just check whether a file that your package provides 
exists. Just remember to use the ROOT variable

Paul

-- 
Paul de Vrieze
Gentoo Developer
Mail: pauldv@gentoo.org
Homepage: http://www.devrieze.net

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-portage-dev] Remove and upgrade in ebuild
  2004-11-26 12:47   ` Paul de Vrieze
@ 2004-11-26 14:25     ` Andrea Carpani
  0 siblings, 0 replies; 4+ messages in thread
From: Andrea Carpani @ 2004-11-26 14:25 UTC (permalink / raw
  To: gentoo-portage-dev

Il ven, 2004-11-26 alle 13:47, Paul de Vrieze ha scritto:

> > What about
> > if has_version \<$PF || has_version \>$PF; then
> > fi

I'll try this one. Thanks.

> > btw. What kind of action would that be?

I need more control over "config" files: I've created a custom eclass
that saves to a custom /var/db/<dir>/<package> directory a list of
"protected" files belonging to a package at pkg_postinst time.

This list has to be removed if I remove the last instance of the
package.

Ciao.

-- 

andrea@carpani.net
Andrea Carpani
.a.c.



--
gentoo-portage-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-11-26 14:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-26  9:01 [gentoo-portage-dev] Remove and upgrade in ebuild Andrea Carpani
2004-11-26 12:45 ` Paul de Vrieze
2004-11-26 12:47   ` Paul de Vrieze
2004-11-26 14:25     ` Andrea Carpani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox