Adium

Ticket #10747 (closed defect: fixed)

Opened 19 months ago

Last modified 7 months ago

%_uptime: Output differs depending on number of users logged in

Reported by: Skyrazer Owned by: nobody
Milestone: Adium 1.4 Component: Adium Core
Version: 1.3b11 Severity: normal
Keywords: uptime script users Cc:
Patch Status:

Description

The output of the script %_uptime works quite strange. When only 1 user is logged in it outputs something like this:

4 days,  1:23, 1 user, load averages: 0.06 0.11 0.10

else it outputs

4 days,  1:23

Attachments

uptime-bug.png (4.2 KB) - added by Skyrazer 19 months ago.

Change History

Changed 19 months ago by Skyrazer

in reply to: ↑ description   Changed 19 months ago by zevlag

The bug is in the uptime script, it runs this command: "/usr/bin/uptime | /usr/bin/awk -F'up[ ]+|, [0-9]+ users' '{print $2}'"

The issue is with the awk parsing, it is looking for "users", when there is only one, it says "user". I have to run, I'll see if I can test a fix later.

Replying to Skyrazer:

The output of the script %_uptime works quite strange. When only 1 user is logged in it outputs something like this: {{{ 4 days, 1:23, 1 user, load averages: 0.06 0.11 0.10 }}} else it outputs {{{ 4 days, 1:23 }}}

  Changed 19 months ago by jas8522

  • owner nobody deleted
  • component changed from Adium Core to Internal Scripts / Build Process
  • milestone set to Adium 1.3.x

  Changed 19 months ago by cbarrett

Is this really the right component for this? Seems like this is for build scripts or helper scripts, not things like %_uptime.

  Changed 19 months ago by zevlag

This should be the code in the uptime script. It will solve the problem. I fixed it, then searched around and found it had also been fixed in the Uptime.3.scpt of ticket #2734. But never applied to the release versions.

	return do shell script "/usr/bin/uptime | /usr/bin/awk -F'up[ ]+|, [0-9]+ user[s]*' '{print $2}'" as string

  Changed 19 months ago by jas8522

  • milestone changed from Adium 1.3.x to Adium 1.3.3

cbarrett: I thought it might be more specific than something like "Adium Core" in order to help identify what the ticket refers to when glancing at a milestone. Technically it is an internal script, but I can see what you mean. Perhaps those should be separate components - Build Process and Internal Scripts.

  Changed 19 months ago by cbarrett

  • owner set to nobody
  • component changed from Internal Scripts / Build Process to Adium Core

jas8522: I think internal in this case means not part of Adium but internal to the Adium project.

  Changed 17 months ago by Robby

  • milestone changed from Adium 1.3.3 to Adium bugs

  Changed 7 months ago by Stephen Holt <sholt@…>

  • status changed from new to closed
  • resolution set to fixed

(In  49e9f62a5292) Correcting awk regexp for single users. Fixes #10747. (transplanted from d063b5446352c580bb0ba9eda3e033136b56e4d7)

  Changed 7 months ago by Stephen Holt <sholt@…>

(In  d063b5446352) Correcting awk regexp for single users. Fixes #10747.

  Changed 7 months ago by earthmkii

  • milestone changed from Adium bugs to Adium 1.4
Note: See TracTickets for help on using tickets.