Adium

Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#10747 closed defect (fixed)

%_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 (1)

uptime-bug.png (4.2 KB) - added by Skyrazer 11 years ago.

Download all attachments as: .zip

Change History (11)

Changed 11 years ago by Skyrazer

comment:1 in reply to: ↑ description Changed 11 years 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

comment:2 Changed 11 years ago by jas8522

  • Component changed from Adium Core to Internal Scripts / Build Process
  • Milestone set to Adium 1.3.x
  • Owner nobody deleted

comment:3 Changed 11 years 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.

comment:4 Changed 11 years 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

comment:5 Changed 11 years 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.

comment:6 Changed 11 years ago by cbarrett

  • Component changed from Internal Scripts / Build Process to Adium Core
  • Owner set to nobody

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

comment:7 Changed 11 years ago by Robby

  • Milestone changed from Adium 1.3.3 to Adium bugs

comment:8 Changed 10 years ago by Stephen Holt <sholt@…>

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:9 Changed 10 years ago by Stephen Holt <sholt@…>

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

comment:10 Changed 10 years ago by earthmkii

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