Bug#560317: dpkg-trigger complains at dpkg-reconfigure time

2010-09-13 Thread Ian Jackson
Raphael Hertzog writes (Re: Bug#560317: dpkg-trigger complains at 
dpkg-reconfigure time):
 On Thu, 10 Dec 2009, Joey Hess wrote:
  Does it actually make sense for dpkg-trigger to see those environment
  variables when the postinst is not being run by dpkg? Seems possible that
  any deferred trigger processing it then sets up will not take effect until
  the next dpkg run, which could be well after dpkg-reconfigure finishes.

I think Joey is right.  In particular, dpkg-reconfigure should not set
DPKG_RUNNING_VERSION, because that promises that the whole thing is
running as a descendant a copy of dpkg; said copy of dpkg is
responsible for processing triggers.

If these variables are all set, dpkg-trigger --check-supported will
say yes and an update-foobar script called by the postinst is
entitled to simply activate a trigger, rather than doing real work.

The effect could be that although it is necessary to rerun the work
done by update-foobar, it won't happen (until the next time dpkg runs
for some other reason, for added confusion).

 Given that dpkg-maintscript-helper is also impacted and not only
 dpkg-trigger, I think that ? yes ? it really make sense to set them.

Can you explain why the analysis above is wrong ?

Ian.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#560317: dpkg-trigger complains at dpkg-reconfigure time

2010-09-13 Thread Raphael Hertzog
On Mon, 13 Sep 2010, Ian Jackson wrote:
 Raphael Hertzog writes (Re: Bug#560317: dpkg-trigger complains at 
 dpkg-reconfigure time):
  On Thu, 10 Dec 2009, Joey Hess wrote:
   Does it actually make sense for dpkg-trigger to see those environment
   variables when the postinst is not being run by dpkg? Seems possible that
   any deferred trigger processing it then sets up will not take effect until
   the next dpkg run, which could be well after dpkg-reconfigure finishes.
 
 I think Joey is right.  In particular, dpkg-reconfigure should not set
 DPKG_RUNNING_VERSION, because that promises that the whole thing is
 running as a descendant a copy of dpkg; said copy of dpkg is
 responsible for processing triggers.

I agree with not setting DPKG_RUNNING_VERSION, but the others should be
set. Otherwise you can't reliably use the variables in a postint. And they
are used in several situations when dpkg-maintscript-helper is invoked.

  Given that dpkg-maintscript-helper is also impacted and not only
  dpkg-trigger, I think that ? yes ? it really make sense to set them.
 
 Can you explain why the analysis above is wrong ?

Did I say it's wrong?

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer ◈ [Flattr=20693]

Follow my Debian News ▶ http://RaphaelHertzog.com (English)
  ▶ http://RaphaelHertzog.fr (Français)



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#560317: dpkg-trigger complains at dpkg-reconfigure time

2010-09-13 Thread Ian Jackson
Raphael Hertzog writes (Re: Bug#560317: dpkg-trigger complains at 
dpkg-reconfigure time):
 I agree with not setting DPKG_RUNNING_VERSION, but the others should be
 set. [...]

Ah, good, then we are in agreement.

  Can you explain why the analysis above is wrong ?
 
 Did I say it's wrong?

Your message seemed to me to suggest that you were going to set
DPKG_RUNNING_VERSION.  Thanks for clarifying.

Ian.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#560317: dpkg-trigger complains at dpkg-reconfigure time

2010-09-10 Thread Raphael Hertzog
Hi,

On Thu, 10 Dec 2009, Joey Hess wrote:
 Raphael Hertzog wrote:
  Because the postinst is called by dpkg-reconfigure (of debconf) and it
  doesn't set the same environment variables that dpkg does set when
  it calls the postinst by itself. In particular DPKG_MAINTSCRIPT_PACKAGE
  is missing.
  
  (dpkg does also set DPKG_MAINTSCRIPT_ARCH and DPKG_RUNNING_VERSION)
  
  It's a bug in dpkg-reconfigure, please file it or reassign.
 
 Does it actually make sense for dpkg-trigger to see those environment
 variables when the postinst is not being run by dpkg? Seems possible that
 any deferred trigger processing it then sets up will not take effect until
 the next dpkg run, which could be well after dpkg-reconfigure finishes.

You also need to set DPKG_MAINTSCRIPT_NAME to postinst as this one
is used by dpkg-maintscript-helper.

Given that dpkg-maintscript-helper is also impacted and not only
dpkg-trigger, I think that — yes — it really make sense to set them.

It would even be nice to have a fixed version sooner rather than later.

I just merged 596369 into this one (where cron is affected due to its
usage of dpkg-maintscript-helper).

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer ◈ [Flattr=20693]

Follow my Debian News ▶ http://RaphaelHertzog.com (English)
  ▶ http://RaphaelHertzog.fr (Français)



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#560317: dpkg-trigger complains at dpkg-reconfigure time

2010-03-09 Thread Soren Hansen
FWIW, I wrote a patch a long time ago in an attempt to fix this.

   
http://bazaar.launchpad.net/~soren/debconf/dpkg-trigger-bug-198421/revision/618?remember=616compare_revid=616

The bzr branch is at:

   https://code.launchpad.net/~soren/debconf/dpkg-trigger-bug-198421

-- 
Soren Hansen
Ubuntu Developer
http://www.ubuntu.com/


signature.asc
Description: Digital signature


Bug#560317: dpkg-trigger complains at dpkg-reconfigure time

2009-12-11 Thread Guillem Jover
Hi!

On Fri, 2009-12-11 at 08:31:26 +0100, Raphael Hertzog wrote:
 On Thu, 10 Dec 2009, Joey Hess wrote:
  Raphael Hertzog wrote:
   Because the postinst is called by dpkg-reconfigure (of debconf) and it
   doesn't set the same environment variables that dpkg does set when
   it calls the postinst by itself. In particular DPKG_MAINTSCRIPT_PACKAGE
   is missing.
   
   (dpkg does also set DPKG_MAINTSCRIPT_ARCH and DPKG_RUNNING_VERSION)
   
   It's a bug in dpkg-reconfigure, please file it or reassign.
  
  Does it actually make sense for dpkg-trigger to see those environment
  variables when the postinst is not being run by dpkg?

Well I guess ideally no one but dpkg should be running the maintainer
scripts. Meanwhile, I'd say yes, although it does not seem appropriate
for anyone except dpkg itself to set DPKG_RUNNING_VERSION, the others
seem perfectly fine to me. OTOH dpkg-reconfigure is doing stuff that
dpkg itself should be doing somehow, but until it does we might want
to consider it part of dpkg.

This gives me even more reasons to think that at some point in the
future we should really move dpkg-reconfigure into dpkg.

  Seems possible that any deferred trigger processing it then sets up
  will not take effect until the next dpkg run, which could be well
  after dpkg-reconfigure finishes.
 
 Right.
 
  Perhaps dpkg-reconfigure needs to call dpkg --configure --pending ?
 
 Indeed, it's probably a good idea. Or maybe: dpkg --triggers-only
 --pending (but reading the doc I'm not sure if --configure is not
 better).
 
 Guillem, does --triggers-only bring the package back to configured
 if they were in that state before the trigger registration ?

“--triggers-only --pending” might leave packages in triggers states,
so yes just “--configure --pending” should do it. BTW, this is
documented in dpkg(1).

regards,
guillem



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#560317: dpkg-trigger complains at dpkg-reconfigure time

2009-12-11 Thread Joey Hess
Raphael Hertzog wrote:
  Does it actually make sense for dpkg-trigger to see those environment
  variables when the postinst is not being run by dpkg? Seems possible that
  any deferred trigger processing it then sets up will not take effect until
  the next dpkg run, which could be well after dpkg-reconfigure finishes.
 
 Right.
 
  Perhaps dpkg-reconfigure needs to call dpkg --configure --pending ?
 
 Indeed, it's probably a good idea. Or maybe: dpkg --triggers-only
 --pending (but reading the doc I'm not sure if --configure is not
 better).

Of course this will lead to the problem that dpkg-reconfigure could
start doing all sorts of things unrelated to what it was asked to do,
including configuring many unrelated packages if used after a failed apt
run, for example.

-- 
see shy jo


signature.asc
Description: Digital signature


Bug#560317: dpkg-trigger complains at dpkg-reconfigure time

2009-12-10 Thread Norbert Preining
Dear all,

I have a question for sure stemming from my misunderstanding of triggers.
tex-common ships dh_installtex which makes installation of fonts etc
for TeX system easy, and it is used in quite some packages. We use
triggers (on popolar demand) since the most expensive operation is
the update of the font maps (calling updmap-sys), which is handled
by triggers.

Now in the generated postinst snippets we have some down there
update-texmf-config updmap
which in turn calls 
dpkg-trigger texmf-updmap

Now when doing 
dpkg-reconfigure one-of-the-font-packages
I get
dpkg-trigger: dpkg-trigger must be called from a maintainer script (or 
with a --by-package option)

I though well, yes, it is called from a maintainer script (postinst configure)
and the package should be clear. But why does dpkg-trigger complain?

Thanks for any explanation

Norbert

Norbert Preiningprein...@{jaist.ac.jp, logic.at, debian.org}
JAIST, JapanTU Wien, Austria   Debian TeX Task Force
DSA: 0x09C5B094   fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094

DUNBAR (n.)
A highly specialised fiscal term used solely by turnstile
operatives at Regnet's Part zoo. It refers to the variable amount of
increase in the variable gate takings on a Sunday afternoon, caused by
persons going to the zoo because they are in love and believe that the
feeling of romance will be somehow enhanced by the smell of panther
sweat and rank incontinence in the reptile house.
--- Douglas Adams, The Meaning of Liff



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#560317: dpkg-trigger complains at dpkg-reconfigure time

2009-12-10 Thread Steve Langasek
On Thu, Dec 10, 2009 at 04:05:25PM +0100, Norbert Preining wrote:

 I have a question for sure stemming from my misunderstanding of triggers.
 tex-common ships dh_installtex which makes installation of fonts etc
 for TeX system easy, and it is used in quite some packages. We use
 triggers (on popolar demand) since the most expensive operation is
 the update of the font maps (calling updmap-sys), which is handled
 by triggers.

 Now in the generated postinst snippets we have some down there
   update-texmf-config updmap
 which in turn calls 
   dpkg-trigger texmf-updmap

 Now when doing 
   dpkg-reconfigure one-of-the-font-packages
 I get
   dpkg-trigger: dpkg-trigger must be called from a maintainer script (or 
 with a --by-package option)

 I though well, yes, it is called from a maintainer script (postinst configure)
 and the package should be clear. But why does dpkg-trigger complain?

 Thanks for any explanation

Because dpkg-reconfigure calls the maintainer scripts directly, not by way
of dpkg, and as a result the DPKG_MAINTSCRIPT_PACKAGE variable is not set.

I think this should be regarded as a bug in dpkg-reconfigure.

-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
Ubuntu Developerhttp://www.debian.org/
slanga...@ubuntu.com vor...@debian.org


signature.asc
Description: Digital signature


Bug#560317: dpkg-trigger complains at dpkg-reconfigure time

2009-12-10 Thread Raphael Hertzog
On Thu, 10 Dec 2009, Norbert Preining wrote:
 I though well, yes, it is called from a maintainer script (postinst configure)
 and the package should be clear. But why does dpkg-trigger complain?

Because the postinst is called by dpkg-reconfigure (of debconf) and it
doesn't set the same environment variables that dpkg does set when
it calls the postinst by itself. In particular DPKG_MAINTSCRIPT_PACKAGE
is missing.

(dpkg does also set DPKG_MAINTSCRIPT_ARCH and DPKG_RUNNING_VERSION)

It's a bug in dpkg-reconfigure, please file it or reassign.

Cheers,
-- 
Raphaël Hertzog



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#560317: dpkg-trigger complains at dpkg-reconfigure time

2009-12-10 Thread Norbert Preining
reassign 560317 dpkg
retitle 560317 dpkg-reconfigure does not set DPKG_MAINTSCRIPT_PACKAGE (et al)
thanks

On Do, 10 Dez 2009, Steve Langasek wrote:
 I think this should be regarded as a bug in dpkg-reconfigure.

On Do, 10 Dez 2009, Raphael Hertzog wrote:
 It's a bug in dpkg-reconfigure, please file it or reassign.


Ok, thanks, reassigned and retitled. Thanks for the quick answer.

Best wishes

Norbert

Norbert Preiningprein...@{jaist.ac.jp, logic.at, debian.org}
JAIST, JapanTU Wien, Austria   Debian TeX Task Force
DSA: 0x09C5B094   fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094

WETWANG (n.)
A moist penis.
--- Douglas Adams, The Meaning of Liff



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#560317: dpkg-trigger complains at dpkg-reconfigure time

2009-12-10 Thread Steve Langasek
reassign 560317 debconf
thanks

On Thu, Dec 10, 2009 at 04:27:28PM +0100, Norbert Preining wrote:
 reassign 560317 dpkg
 retitle 560317 dpkg-reconfigure does not set DPKG_MAINTSCRIPT_PACKAGE (et al)
 thanks

 On Do, 10 Dez 2009, Steve Langasek wrote:
  I think this should be regarded as a bug in dpkg-reconfigure.

 On Do, 10 Dez 2009, Raphael Hertzog wrote:
  It's a bug in dpkg-reconfigure, please file it or reassign.

 Ok, thanks, reassigned and retitled. Thanks for the quick answer.

Er, as stated, dpkg-reconfigure is not from dpkg.  Reassigning.

-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
Ubuntu Developerhttp://www.debian.org/
slanga...@ubuntu.com vor...@debian.org


signature.asc
Description: Digital signature


Bug#560317: dpkg-trigger complains at dpkg-reconfigure time

2009-12-10 Thread Joey Hess
Raphael Hertzog wrote:
 Because the postinst is called by dpkg-reconfigure (of debconf) and it
 doesn't set the same environment variables that dpkg does set when
 it calls the postinst by itself. In particular DPKG_MAINTSCRIPT_PACKAGE
 is missing.
 
 (dpkg does also set DPKG_MAINTSCRIPT_ARCH and DPKG_RUNNING_VERSION)
 
 It's a bug in dpkg-reconfigure, please file it or reassign.

Does it actually make sense for dpkg-trigger to see those environment
variables when the postinst is not being run by dpkg? Seems possible that
any deferred trigger processing it then sets up will not take effect until
the next dpkg run, which could be well after dpkg-reconfigure finishes.

Perhaps dpkg-reconfigure needs to call dpkg --configure --pending ?

-- 
see shy jo


signature.asc
Description: Digital signature


Bug#560317: dpkg-trigger complains at dpkg-reconfigure time

2009-12-10 Thread Raphael Hertzog
On Thu, 10 Dec 2009, Joey Hess wrote:
 Raphael Hertzog wrote:
  Because the postinst is called by dpkg-reconfigure (of debconf) and it
  doesn't set the same environment variables that dpkg does set when
  it calls the postinst by itself. In particular DPKG_MAINTSCRIPT_PACKAGE
  is missing.
  
  (dpkg does also set DPKG_MAINTSCRIPT_ARCH and DPKG_RUNNING_VERSION)
  
  It's a bug in dpkg-reconfigure, please file it or reassign.
 
 Does it actually make sense for dpkg-trigger to see those environment
 variables when the postinst is not being run by dpkg? Seems possible that
 any deferred trigger processing it then sets up will not take effect until
 the next dpkg run, which could be well after dpkg-reconfigure finishes.

Right.

 Perhaps dpkg-reconfigure needs to call dpkg --configure --pending ?

Indeed, it's probably a good idea. Or maybe: dpkg --triggers-only
--pending (but reading the doc I'm not sure if --configure is not
better).

Guillem, does --triggers-only bring the package back to configured
if they were in that state before the trigger registration ?

Cheers,
-- 
Raphaël Hertzog



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org