After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 660590 - Feature request: support for FreeBSD atq output
Feature request: support for FreeBSD atq output
Status: RESOLVED FIXED
Product: gnome-schedule
Classification: Other
Component: general
2.1.5
Other FreeBSD
: Normal normal
: ---
Assigned To: GNOME Schedule Maintainers
GNOME Schedule Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-09-30 19:59 UTC by Ruslan Makhmatkhanov
Modified: 2011-10-12 13:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
freebsd regexp test (803 bytes, text/plain)
2011-10-03 15:15 UTC, Gaute Hope
Details
at tomorrow output (38 bytes, text/plain)
2011-10-04 21:50 UTC, Ruslan Makhmatkhanov
Details
atq output (126 bytes, text/plain)
2011-10-04 21:52 UTC, Ruslan Makhmatkhanov
Details

Description Ruslan Makhmatkhanov 2011-09-30 19:59:43 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.
Comment 1 Gaute Hope 2011-10-03 15:14:06 UTC
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
Comment 2 Gaute Hope 2011-10-03 15:15:02 UTC
Created attachment 198107 [details]
freebsd regexp test
Comment 3 Gaute Hope 2011-10-03 16:13:07 UTC
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
Comment 4 Ruslan Makhmatkhanov 2011-10-04 04:41:29 UTC
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
"""
Comment 5 Gaute Hope 2011-10-04 09:14:25 UTC
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
Comment 6 Ruslan Makhmatkhanov 2011-10-04 11:06:09 UTC
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.
Comment 7 Ruslan Makhmatkhanov 2011-10-04 11:21:10 UTC
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.
Comment 8 Gaute Hope 2011-10-04 14:57:09 UTC
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
Comment 9 Ruslan Makhmatkhanov 2011-10-04 19:29:16 UTC
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.
Comment 10 Gaute Hope 2011-10-04 21:26:29 UTC
(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
Comment 11 Ruslan Makhmatkhanov 2011-10-04 21:50:25 UTC
Created attachment 198265 [details]
at tomorrow output
Comment 12 Ruslan Makhmatkhanov 2011-10-04 21:51:47 UTC
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):
  • File "/tmp/gnome-schedule/src/atEditor.py", line 612 in on_button_save_clicked
    self.ParentClass.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 0x85 in position 50: invalid start byte
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.
Comment 13 Ruslan Makhmatkhanov 2011-10-04 21:52:26 UTC
Created attachment 198266 [details]
atq output
Comment 14 Ruslan Makhmatkhanov 2011-10-05 08:00:05 UTC
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
"""
Comment 15 Gaute Hope 2011-10-11 21:10:17 UTC
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
Comment 16 Ruslan Makhmatkhanov 2011-10-12 09:59:41 UTC
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.
Comment 17 Gaute Hope 2011-10-12 12:05:35 UTC
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
Comment 18 Ruslan Makhmatkhanov 2011-10-12 12:23:42 UTC
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?
Comment 19 Gaute Hope 2011-10-12 12:39:13 UTC
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
Comment 20 Ruslan Makhmatkhanov 2011-10-12 12:53:25 UTC
> 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.
Comment 21 Gaute Hope 2011-10-12 12:58:39 UTC
(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.
Comment 22 Ruslan Makhmatkhanov 2011-10-12 13:06:30 UTC
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.
Comment 23 Gaute Hope 2011-10-12 13:10:35 UTC
(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