GNOME Bugzilla – Bug 660590
Feature request: support for FreeBSD atq output
Last modified: 2011-10-12 13:10:35 UTC
Good day. Right now there is a problem on FreeBSD when someone creates an one-time task. It will be created and executed correctly but never will be listed in gnome-schedule's task list because of "Warning: a line in atq's output didn't parse". It's because of FreeBSD's atq has output like this: """ Date Owner Queue Job# Fri Sep 30 23:40:00 MSK 2011 rm c 2 """ It would be great if this will be supported too. Thanks.
Hi, I've tested a bit, but don't have a FreeBSD machine available at the moment; could you perhaps test the following script. I am having some problems with time zones, but this might be supported on FreeBSD. Could you please test the attached script and post the output; run it with python2: $ python2 regextest.py Also I need the output you get when you have scheduled a task manually: $ at tomorrow ls Ctrl+D [post the response]. Thanks, Gaute
Created attachment 198107 [details] freebsd regexp test
I have pushed a candidate fix for this to latest master; could you please check out the latest code and test if this works, to test latest master do: $ git clone git://git.gnome.org/git/gnome-schedule $ cd gnome-schedule $ ./autogen.sh $ make $ cd src/ $ python2 gnome-schedule.py --debug Regards, Gaute
Good day, Gaute. Thank you for the fast response. Here is an output of your script: """ [rm@smeshariki3 Books]> python regr Fri Sep 30 23:40:00 MSK 2011 rm c 2 ('Fri Sep 30', '23:40:00', 'MSK', '2011', 'rm ', 'c', '2') 2 2 time.struct_time(tm_year=2001, tm_mon=6, tm_mday=28, tm_hour=13, tm_min=45, tm_sec=23, tm_wday=3, tm_yday=179, tm_isdst=0) time.struct_time(tm_year=2011, tm_mon=9, tm_mday=30, tm_hour=23, tm_min=40, tm_sec=0, tm_wday=4, tm_yday=273, tm_isdst=-1) """ Here is an output of `at tomorrow`: """ [rm@smeshariki3 Books]> at tomorrow ls Job 5 will be executed using /bin/sh """ Unfortunally i wasn't able to clone, because there seems no git-daemon listening. I'm tried from three different ipaddrs and with the same result: """ [rm@smeshariki3 /tmp]> git clone git://git.gnome.org/git/gnome-schedule Cloning into gnome-schedule... fatal: The remote end hung up unexpectedly """
Hi, sorry about that; the anonymous git access should use this url: http://git.gnome.org/browse/gnome-schedule I am currently ignoring timezone info, simply hoping it will work itself out in the end. Tasks should now pop up as soon as they are added. Please try again with the new url. - Gaute
I'm sorry but it still doesn't work to me (with "Warning: a line in atq's output didn't parse"). To make sure that all is allright i deinstalled 2.1.5 version of gnome-schedule, installed from FreeBSD ports repository. I also removed directory ~/.gnome/gnome-schedule. Then i do: $ git clone http://git.gnome.org/git/gnome-schedule (last revision is "Support FreeBSD output after adding task") $ cd gnome-schedule $ ./autogen.sh (installed gnome-common package previously) $ gmake $ cd src/ $ python gnome-schedule.py --debug (also tried `/bin/sh gnome-schedule --debug` with fixed path to gnome-schedule.py) And when i add one-time task i still get "Warning: a line in atq's output didn't parse" and this task is missed in task list. Thanks.
I checked if it use correct branch in if loop: >>> os.uname()[0] 'FreeBSD' Yes, all it does, so it seems something wrong with regex.
I moved the new code to a separate branch: freebsd and reverted master for the while being, I will merge it back when it is finished. To get this code do (I don't know if you know git?): $ git pull # to get latest changes, do this again to update later.. $ git checkout freebsd This just prints a bit of debug information, could you please post that and explain as you did earlier what you are doing. Could you save the output from 'at' and 'atq' in a text file and attach them here so that I can get proper copies of tab-chars and stuff like that: $ atq > atq_output.txt 2>&1 $ echo ls | at tomorrow > at_tomorrow_output.txt 2>&1 - Gaute
I previously cloned to /tmp, that automatically cleaned out after reboot. If i trying to clone again, i get this: [rm@smeshariki3 /tmp]> git clone http://git.gnome.org/git/gnome-schedule Cloning into gnome-schedule... fatal: http://git.gnome.org/git/gnome-schedule/info/refs not found: did you run git update-server-info on the server? As far i understand, post-merge and/or post-update hooks should be made executable to not expect this in future.
(In reply to comment #9) > I previously cloned to /tmp, that automatically cleaned out after reboot. If i > trying to clone again, i get this: > > [rm@smeshariki3 /tmp]> git clone http://git.gnome.org/git/gnome-schedule > Cloning into gnome-schedule... > fatal: http://git.gnome.org/git/gnome-schedule/info/refs not found: did you run > git update-server-info on the server? > > As far i understand, post-merge and/or post-update hooks should be made > executable to not expect this in future. Yes, that is a wrong url - the correct one is this: http://git.gnome.org/browse/gnome-schedule Which also has a web interface at the same url. - Gaute
Created attachment 198265 [details] at tomorrow output
Ok. i cloned the repo, switched to freebsd branch, then run autogen.sh, gmake. then `cd src; python gnome-schedule.py --debug`. When adding one-time task, i get following: """ [rm@smeshariki3 src]> python gnome-schedule.py --debug [AT] FreeBSD. Warning: a line in atq's output didn't parse: Date Owner Queue Job# Traceback (most recent call last):
+ Trace 228683
self.ParentClass.schedule_reload ()
data = self.at.read ()
print _("Warning: a line in atq's output didn't parse: %s") % line
Warning: a line in atq's output didn't parse: Date Owner Queue Job# Traceback (most recent call last): File "/tmp/gnome-schedule/src/mainWindow.py", line 273, in update_schedule self.schedule_reload () File "/tmp/gnome-schedule/src/mainWindow.py", line 308, in schedule_reload data = self.at.read () File "/tmp/gnome-schedule/src/at.py", line 552, in read print _("Warning: a line in atq's output didn't parse: %s") % line UnicodeDecodeError: 'utf8' codec can't decode byte 0xb4 in position 50: invalid start byte """ Looks like my locale (ru_RU.UTF-8) issue. I switched to C locale and add one-time task again. Added fine, but still not in the task list. I see this messages: """ Warning: a line in atq's output didn't parse: Date Owner Queue Job# Warning: a line in atq's output didn't parse: Wed Oct 5 02:40:00 MSK 2011 rm c 14 Warning: a line in atq's output didn't parse: Date Owner Queue Job# Warning: a line in atq's output didn't parse: Wed Oct 5 02:40:00 MSK 2011 rm c 14 """ Files, that you requested, are attached.
Created attachment 198266 [details] atq output
Hi, Gaute. Ok, with your latest commits i can't reproduce this locale related traceback anymore. But original problem is still here, and since it doesn't try to parse atq output header, it only warns on actual at records. Just FYI. Thanks. """ Warning: a line in atq's output didn't parse. Wed Oct 5 12:49:00 MSK 2011 rm c 20 """
Finally got around to set up a FreeBSD virtual machine, latest 'master' and 'freebsd' (currently identical) are now working on FreeBSD 8.2. Could you please check that out and confirm that it works. - Gaute
Hi Gaute. Thanks a lot for this! I'm sorry that i wasn't able to help, so you was forced to install FreeBSD for tests. All is now fine, but only with 'C' locale. If you set locale to ru_RU.UTF-8, then you''ll get something like this when trying to create one-time task: """ Warning: a line in atq's output didn't parse: среда, 12 октября 2011 г. 14:55:00 (M�濿�濿 rm c 23 """ Most of strings didn't translated in ru.po, so you should not expect any problems with checking this with ru locale.
Hi again, Please try again; I am now forcing the C locale when executing at tasks and it works on my locale nn_NO.UTF-8 as well as what I have tested with the ru_RU.UTF-8 locale. Hopefully the timezone mess will clear it self out in the end as I am completely ignoring it in all steps now. - Gaute
Yes, now it works fine, thank you much! As far i understand this will be included into 2.1.6. Do you have any plans release in near time?
Great, yes that should be included.. just realized that this might cause un-expected behavior, since the locale for commands executed in the at script will be changed.. I'll try to fix that and then I should be able to make a new release when translations have had the time to catch up. I might ask you to test again when I have something working.. - Gaute
> I might ask you to test again when I have something working.. Ok, feel free to do so. Btw, i'll also try to actualize russian translation, since it seems much outdated. I'll add single bug-report about it. Thank you again.
(In reply to comment #19) > I might ask you to test again when I have something working.. and.. that should be fixed now, there might be some issues with people having setups where not all LC_* are the same. It seems FreeBSD resets all other when setting LC_ALL.
May be you are right. But i always only set LANG variable, doesn't actually touching any LC_* variables. If i understand correctly setting just LANG implies on setting all the LC_* to their correct values. I just checked your latest revision ("Reset LC_ALL after forcing locale in at") and all is working fine to me.
(In reply to comment #22) > May be you are right. But i always only set LANG variable, doesn't actually > touching any LC_* variables. If i understand correctly setting just LANG > implies on setting all the LC_* to their correct values. > > I just checked your latest revision ("Reset LC_ALL after forcing locale in at") > and all is working fine to me. Ok, then I am gonna go for this solution until it becomes a problem. Great if you have time to help out with translations, send me a patch or commit it yourself if you have access! - Gaute