Bug#315731: cron-apt: FILTERCTRLM doesn't work too well with aptitude
Hello On Sat, Oct 01, 2005 at 10:17:38PM +0200, Marc Haber wrote: > On Tue, Sep 06, 2005 at 10:24:01AM +0200, Ola Lundqvist wrote: > > On Tue, Sep 06, 2005 at 05:18:38PM +0900, akira yamada wrote: > > > Hi, > > > > > > Ola Lundqvist wrote: > > > > Have you tried to change it with the patch and determined if it is > > > > working > > > > or not? > > > > > > I tested my patch and I got the following mail: > > > --- > > > CRON-APT RUN [/etc/cron-apt/config]: Tue Sep 6 14:32:06 JST 2005 > > > CRON-APT ACTION: 3-download > > > CRON-APT LINE: dist-upgrade -d -y -o APT::Get::Show-Upgraded=true > > > The following packages will be upgraded: > > > ntp ntp-server ntp-simple ntpdate > > > 4 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded. > > > Need to get 0B/449kB of archives. After unpacking 4096B will be freed. > > > --- > > > > Ok, really good. I'll apply this on next upload. > > Since that upload is now almost a month overdue: Can I have the patch > to try it locally? I have uploaded a package now with that fix. Thanks for the reminder. Regards, // Ola > Greetings > Marc > > -- > - > Marc Haber | "I don't trust Computers. They | Mailadresse im Header > Mannheim, Germany | lose things."Winona Ryder | Fon: *49 621 72739834 > Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835 > -- --- Ola Lundqvist systemkonsult --- M Sc in IT Engineering / [EMAIL PROTECTED] Annebergsslingan 37\ | [EMAIL PROTECTED] 654 65 KARLSTAD| | http://www.opal.dhs.org Mobile: +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]
Bug#315731: cron-apt: FILTERCTRLM doesn't work too well with aptitude
On Tue, Sep 06, 2005 at 10:24:01AM +0200, Ola Lundqvist wrote: > On Tue, Sep 06, 2005 at 05:18:38PM +0900, akira yamada wrote: > > Hi, > > > > Ola Lundqvist wrote: > > > Have you tried to change it with the patch and determined if it is working > > > or not? > > > > I tested my patch and I got the following mail: > > --- > > CRON-APT RUN [/etc/cron-apt/config]: Tue Sep 6 14:32:06 JST 2005 > > CRON-APT ACTION: 3-download > > CRON-APT LINE: dist-upgrade -d -y -o APT::Get::Show-Upgraded=true > > The following packages will be upgraded: > > ntp ntp-server ntp-simple ntpdate > > 4 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded. > > Need to get 0B/449kB of archives. After unpacking 4096B will be freed. > > --- > > Ok, really good. I'll apply this on next upload. Since that upload is now almost a month overdue: Can I have the patch to try it locally? Greetings Marc -- - Marc Haber | "I don't trust Computers. They | Mailadresse im Header Mannheim, Germany | lose things."Winona Ryder | Fon: *49 621 72739834 Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#315731: cron-apt: FILTERCTRLM doesn't work too well with aptitude
tags 315731 + patch thanks On Tue, Sep 06, 2005 at 05:18:38PM +0900, akira yamada wrote: > Hi, > > Ola Lundqvist wrote: > > Have you tried to change it with the patch and determined if it is working > > or not? > > I tested my patch and I got the following mail: > --- > CRON-APT RUN [/etc/cron-apt/config]: Tue Sep 6 14:32:06 JST 2005 > CRON-APT ACTION: 3-download > CRON-APT LINE: dist-upgrade -d -y -o APT::Get::Show-Upgraded=true > The following packages will be upgraded: > ntp ntp-server ntp-simple ntpdate > 4 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded. > Need to get 0B/449kB of archives. After unpacking 4096B will be freed. > --- Ok, really good. I'll apply this on next upload. Regards, // Ola > Thank you. > -- > akira yamada > > P.S. I am sorry. I sent you same mails by mistake. > -- --- Ola Lundqvist systemkonsult --- M Sc in IT Engineering / [EMAIL PROTECTED] Annebergsslingan 37\ | [EMAIL PROTECTED] 654 65 KARLSTAD| | http://www.opal.dhs.org Mobile: +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]
Bug#315731: Re: Bug#315731: cron-apt: FILTERCTRLM doesn't work too well with aptitude
On Sat, Jun 25, 2005 at 01:36:18PM -0600, Bob Proulx wrote: > Marc Haber wrote: > > Please consider this patch which will improve FILTERCTRLM behavior. > > Could you say a word or two describing in what way this change > improves FILTERCTRLM behavior? I am guessing but not really sure what > you are intending. The package as delivered might generate "good" output on the console, but in a pipe one sees pretty well that the progress status messages printed by aptitude still end up in the output: [16/[EMAIL PROTECTED] sarge]:~$ sudo cron-apt -i -s | sed 's/[^[:alnum:]]/g' | head -n 10 CRON_APT_RUN___etc_cron_apt_config___Sun_Jul__3_21_09_56_UTC_2005 CRON_APT_ACTION__0_update CRON_APT_LINE__update__o_quiet_2 _Reading_Package_Lists0___Reading_Package_Lists100___Reading_Package_ListsDone_ _Building_Dependency_Tree0___Building_Dependency_Tree0___Building_Dependency_Tree50___Building_Dependency_Tree50___Building_Dependency_Tree _Reading_extended_state_information0___Reading_extended_state_information0___Reading_extended_state_information___ _Initializing_package_states0Initializing_package_statesDone_ _Writing_extended_state_information0___Writing_extended_state_information0___Writing_extended_state_informationDone_ __0___Working___Hit_http___volatile_debian_net_sarge_volatile_main_Packages __3___Waiting_for_headers___Waiting_for_headers___Connecting_to_web_proxy__192_168__Hit_http___security_debian_org_sarge_updates_main_Packages [18/[EMAIL PROTECTED] sarge]:~$ sudo cron-apt -i -s | head -n 10 CRON-APT RUN [/etc/cron-apt/config]: Sun Jul 3 21:10:17 UTC 2005 CRON-APT ACTION: 0-update CRON-APT LINE: update -o quiet=2 Reading Package Lists... Done Building Dependency Tree Reading extended state information Initializing package states... Done Writing extended state information... Done Hit http://zg.debian.zugschlus.de zg/sarge/main Packages Hit http://volatile.debian.net sarge/volatile/main Packages [19/[EMAIL PROTECTED] sarge]:~$ > > --- cron-apt.orig 2005-06-20 11:51:43.0 +0200 > > +++ /usr/sbin/cron-apt 2005-06-25 14:35:33.0 +0200 > > @@ -430,8 +430,10 @@ > > umask $UMASK_SAVE > > fi > > if [ "$FILTERCTRLM" = "true" ]; then > > - grep -v " > > -" "$TEMP" > "$FILTER" > > + CTRLM="$(echo -e \\r)" > > But 'echo -e' is a bashism and does not work with posix standard > shells. Actually using echo for all but simple strings is amazingly > non-portable. Please consider using 'printf' instead as that is > standard. Also the quotes around the $() are not needed. > > CTRLM=$(printf "\r") Nice idea. > But fortunately that is not needed here at all because sed understands > the escape \r natively. And that is POSIX sed? I though that of a GNU extension. > > + < "$TEMP" sed "s/.*$CTRLM\(.\+\)/\1/" > "$FILTER" > > I think that putting all of the redirections '< "$TEMP"' after the > command to be the most clear and common. In this case no input > redirection is needed. That's a matter of personal style. I think that writing the redirection source in front is much more natural, and providing the input on the binary's stdin instead of the command line makes it easier to put in other commands into the pipe. Since some tools behave differently with stdin input, these behavior changes can make debugging and extension harder. > And something about that sed just bothers me > but I can't quite put my finger on it. For one \+ is a GNU sed > extension. But that is okay. The '.' does not match newlines so I > *think* this following is equivalent and more clear and I believe it > would work with all sed programs and all shells. > > + sed "s/.*\r//" "$TEMP" > "$FILTER" No, that one is as bad as the original, leaving in the status blurb that is eaten by my more complicated regexp. Greetings Marc -- - Marc Haber | "I don't trust Computers. They | Mailadresse im Header Mannheim, Germany | lose things."Winona Ryder | Fon: *49 621 72739834 Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835 -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#315731: cron-apt: FILTERCTRLM doesn't work too well with aptitude
Marc Haber wrote: > Please consider this patch which will improve FILTERCTRLM behavior. Could you say a word or two describing in what way this change improves FILTERCTRLM behavior? I am guessing but not really sure what you are intending. A comment from the "peanut gallery" anyway. > --- cron-apt.orig 2005-06-20 11:51:43.0 +0200 > +++ /usr/sbin/cron-apt2005-06-25 14:35:33.0 +0200 > @@ -430,8 +430,10 @@ > umask $UMASK_SAVE > fi > if [ "$FILTERCTRLM" = "true" ]; then > - grep -v " > -" "$TEMP" > "$FILTER" > + CTRLM="$(echo -e \\r)" But 'echo -e' is a bashism and does not work with posix standard shells. Actually using echo for all but simple strings is amazingly non-portable. Please consider using 'printf' instead as that is standard. Also the quotes around the $() are not needed. CTRLM=$(printf "\r") But fortunately that is not needed here at all because sed understands the escape \r natively. > + < "$TEMP" sed "s/.*$CTRLM\(.\+\)/\1/" > "$FILTER" I think that putting all of the redirections '< "$TEMP"' after the command to be the most clear and common. In this case no input redirection is needed. And something about that sed just bothers me but I can't quite put my finger on it. For one \+ is a GNU sed extension. But that is okay. The '.' does not match newlines so I *think* this following is equivalent and more clear and I believe it would work with all sed programs and all shells. + sed "s/.*\r//" "$TEMP" > "$FILTER" The line that it is matching against might be very, very long. I worry that this might cause a large memory spike in the RE engine. But if I recall correctly .* handles this specially so this is okay. Since I don't know the exact pattern this is matching against I can't say for sure if this sed pattern is correct but it seems to me to be better. > + #grep -v " > +#" "$TEMP" > "$FILTER" > cp "$FILTER" "$TEMP" > fi > if [ $RET -ne 0 ]; then Note that I am not commenting upon the patch itself, just the micro-syntax of 'echo -e' and sed syntax only. Thanks Bob -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#315731: cron-apt: FILTERCTRLM doesn't work too well with aptitude
Package: cron-apt Version: 0.3.0 Severity: normal Tags: patch Please consider this patch which will improve FILTERCTRLM behavior. cron-apt diff handling needs to adapt to aptitude as well, since aptitude update seems to create "Hit" lines out of order. I will investigate. Greetings Marc --- cron-apt.orig 2005-06-20 11:51:43.0 +0200 +++ /usr/sbin/cron-apt 2005-06-25 14:35:33.0 +0200 @@ -430,8 +430,10 @@ umask $UMASK_SAVE fi if [ "$FILTERCTRLM" = "true" ]; then - grep -v " -" "$TEMP" > "$FILTER" + CTRLM="$(echo -e \\r)" + < "$TEMP" sed "s/.*$CTRLM\(.\+\)/\1/" > "$FILTER" + #grep -v " +#" "$TEMP" > "$FILTER" cp "$FILTER" "$TEMP" fi if [ $RET -ne 0 ]; then -- System Information: Debian Release: 3.1 Architecture: i386 (i586) Kernel: Linux 2.4.31-zgfw Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1) Versions of packages cron-apt depends on: ii apt 0.5.28.6Advanced front-end for dpkg ii bash 2.05b-26The GNU Bourne Again SHell ii debianutils 2.8.4 Miscellaneous utilities specific t ii mailx1:8.1.2-0.20040524cvs-4 A simple mail user agent -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]