Hi Marc On Tue, Jul 31, 2007 at 11:14:37PM +0200, Marc Haber wrote: > Package: cron-apt > Version: 0.4.14 > Severity: wishlist > Tags: patch > > The attached patch modifies config.d semantics so that variables set > in config.d are only honored for the corresponding action.d item while > returning to the default read in from the config file for the next > action.d item. > > This feels much more natural, to me at least.
Hmm yes maybe. The problem however is that you can actually change any variable in the config script... Should we store all found in env and restore them after? > --- cron-apt.orig 2007-07-31 23:02:57.000000000 +0200 > +++ cron-apt 2007-07-31 23:09:48.000000000 +0200 > @@ -459,6 +459,12 @@ > # Always run onexit before exit. > > for ACTION in $(run_parts "$ACTIONDIR") ; do > + SAVE_SYSLOGON="$SYSLOGON" > + SAVE_MAILON="$MAILON" > + SAVE_DEBUG="$DEBUG" > + SAVE_EXITON="$EXITON" > + SAVE_DIFFIGNORE="$DIFFIGNORE" > + SAVE_DIFFONCHANGES="$DIFFONCHANGES" > ACTIONF=$(echo $ACTION | sed "s|$ACTIONDIR/||") > if [ -f "$ACTIONCONFDIR/$ACTIONF" ] ; then > . "$ACTIONCONFDIR/$ACTIONF" > @@ -606,6 +612,12 @@ > fi > rm -f "$STATUS" > fi > + SYSLOGON="$SAVE_SYSLOGON" > + MAILON="$SAVE_MAILON" > + DEBUG="$SAVE_DEBUG" > + EXITON="$SAVE_EXITON" > + DIFFIGNORE="$SAVE_DIFFIGNORE" > + DIFFONCHANGES="$SAVE_DIFFONCHANGES" > done > > onexit > > > A different way to implement would mean having suffixes for the > variable name in config.d, either FOO_FROMHERE to replace FOO's value > for the rest of the cron-apt run, or FOO_HERE to only replace FOO's > value for thi action.d item. That would be one way, but it seems rather complicated. I think we should do something that is backwards compatible as well. :) > Please indicate which way you'd prefer, and I'll send a modified > patch. I do think that the patch listed above is the easiest one. I'm not sure what I prefer. :) Maybe I prefer the _HERE approach, but keep the old way that is if you change SYSLOGON that is actually changed. So when restoring you actually need to check if that the corresponding _HERE value actually contain something. Best regards, // Ola > Greetings > Marc > > -- --------------------- Ola Lundqvist --------------------------- / [EMAIL PROTECTED] Annebergsslingan 37 \ | [EMAIL PROTECTED] 654 65 KARLSTAD | | http://opalsys.net/ +46 (0)70-332 1551 | \ gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9 / --------------------------------------------------------------- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]