From: git@ipfire.org
To: ipfire-scm@lists.ipfire.org
Subject: [git.ipfire.org] IPFire 2.x development tree branch, fifteen, updated. 1dc44471365cccef7ab2b3ec766c0d0c26f86475
Date: Sun, 05 Jan 2014 02:44:47 +0100 [thread overview]
Message-ID: <20140105014448.4CC5E21E2F@argus.ipfire.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 11096 bytes --]
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".
The branch, fifteen has been updated
via 1dc44471365cccef7ab2b3ec766c0d0c26f86475 (commit)
from 63e3da5935ee846b9e1e29f624bd299518194d35 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 1dc44471365cccef7ab2b3ec766c0d0c26f86475
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date: Sun Jan 5 02:42:21 2014 +0100
general-functions.pl: Format output of age().
The output of the age() function was a bit messy with
some translations. It was now much simplified and it
now shows the time in a standardized format.
-----------------------------------------------------------------------
Summary of changes:
config/cfgroot/general-functions.pl | 72 +++++++++++--------------------------
doc/language_issues.de | 5 +++
doc/language_issues.en | 5 +++
doc/language_issues.es | 5 ---
doc/language_issues.fr | 5 ---
doc/language_issues.nl | 5 ---
doc/language_issues.pl | 5 ---
doc/language_issues.ru | 5 ---
doc/language_issues.tr | 5 +++
langs/en/cgi-bin/en.pl | 2 +-
10 files changed, 36 insertions(+), 78 deletions(-)
Difference in files:
diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl
index 9d9ee5d..9a5e671 100644
--- a/config/cfgroot/general-functions.pl
+++ b/config/cfgroot/general-functions.pl
@@ -229,68 +229,36 @@ sub writehashpart
close FILE;
}
-sub age
-{
+sub age {
my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size,
- $atime, $mtime, $ctime, $blksize, $blocks) = stat $_[0];
- my $now = time;
- my $timestring = '';
- my $dset = 0; # Day is set, when > 0
- my $hset = 0; # Hour is set, when > 0
- my $mset = 0; # Minute is set, when > 0
-
- my $totalsecs = $now - $mtime;
- my $days = int($totalsecs / 86400);
- my $totalhours = int($totalsecs / 3600);
- my $hours = $totalhours % 24;
- my $totalmins = int($totalsecs / 60);
- my $mins = $totalmins % 60;
- my $secs = $totalsecs % 60;
+ $atime, $mtime, $ctime, $blksize, $blocks) = stat $_[0];
+ my $totalsecs = time() - $mtime;
+ my @s = ();
- if ($days > 1) {
- ${timestring} .= ${days}.' '.$Lang::tr{'days'}.', ';
- $dset = 1;
- }
- elsif ($days == 1) {
- ${timestring} .= ${days}.' '.$Lang::tr{'day'}.', ';
- $dset = 1;
+ my $secs = $totalsecs % 60;
+ $totalsecs /= 60;
+ if ($secs > 0) {
+ push(@s, "${secs}s");
}
- if (($hours > 1) && !($dset)) {
- ${timestring} .= ${hours}.' '.$Lang::tr{'hours'}.', ';
- $hset = 1;
- }
- elsif (($hours == 1) && !($dset)) {
- ${timestring} .= ${hours}.' '.$Lang::tr{'hour'}.', ';
- $hset = 1;
- }
- elsif ($dset) {
- ${timestring} .= ${hours}.' '.$Lang::tr{'age shour'}.', ';
- $hset = 1;
+ my $min = $totalsecs % 60;
+ $totalsecs /= 60;
+ if ($min > 0) {
+ push(@s, "${min}m");
}
- if ((($mins > 1) || ($mins == 0)) && !($dset || $hset)) {
- ${timestring} .= ${mins}.' '.$Lang::tr{'minutes'}.', ';
- $mset = 1;
- }
- elsif (($mins == 1) && !($dset || $hset)) {
- ${timestring} .= ${mins}.' '.$Lang::tr{'minute'}.', ';
- $mset = 1;
- }
- else {
- ${timestring} .= ${mins}.' '.$Lang::tr{'age sminute'}.', ';
- $mset = 1;
+ my $hrs = $totalsecs % 24;
+ $totalsecs /= 24;
+ if ($hrs > 0) {
+ push(@s, "${hrs}h");
}
- if ((($secs > 1) || ($secs == 0)) && !($dset || $hset || $mset)) {
- ${timestring} .= ${secs}.' '.$Lang::tr{'age seconds'};
- }
- elsif (($secs == 1) && !($dset || $hset || $mset)) {
- ${timestring} .= $secs.' '.$Lang::tr{'age second'};
+ my $days = int($totalsecs);
+ if ($days > 0) {
+ push(@s, "${days}d");
}
- else { ${timestring} .= $secs.' '.$Lang::tr{'age ssecond'}; }
- return ${timestring};
+ return join(" ", reverse(@s));
}
sub validip
diff --git a/doc/language_issues.de b/doc/language_issues.de
index b07ee32..8b46d6f 100644
--- a/doc/language_issues.de
+++ b/doc/language_issues.de
@@ -40,6 +40,11 @@ WARNING: translation string unused: advproxy errmsg password incorrect
WARNING: translation string unused: advproxy no cre groups
WARNING: translation string unused: advproxy ssadvanced proxy
WARNING: translation string unused: advproxy update notification
+WARNING: translation string unused: age second
+WARNING: translation string unused: age seconds
+WARNING: translation string unused: age shour
+WARNING: translation string unused: age sminute
+WARNING: translation string unused: age ssecond
WARNING: translation string unused: alcatelusb help
WARNING: translation string unused: alcatelusb upload
WARNING: translation string unused: all interfaces
diff --git a/doc/language_issues.en b/doc/language_issues.en
index 314643d..d4281e0 100644
--- a/doc/language_issues.en
+++ b/doc/language_issues.en
@@ -41,6 +41,11 @@ WARNING: translation string unused: advproxy no cre groups
WARNING: translation string unused: advproxy ssadvanced proxy
WARNING: translation string unused: advproxy update information
WARNING: translation string unused: advproxy update notification
+WARNING: translation string unused: age second
+WARNING: translation string unused: age seconds
+WARNING: translation string unused: age shour
+WARNING: translation string unused: age sminute
+WARNING: translation string unused: age ssecond
WARNING: translation string unused: alcatelusb help
WARNING: translation string unused: alcatelusb upload
WARNING: translation string unused: all interfaces
diff --git a/doc/language_issues.es b/doc/language_issues.es
index 09ebf81..9ae2c0a 100644
--- a/doc/language_issues.es
+++ b/doc/language_issues.es
@@ -557,11 +557,6 @@ WARNING: untranslated string: advproxy errmsg cache
WARNING: untranslated string: advproxy errmsg invalid upstream proxy
WARNING: untranslated string: advproxy errmsg proxy ports equal
WARNING: untranslated string: advproxy proxy port transparent
-WARNING: untranslated string: age second
-WARNING: untranslated string: age seconds
-WARNING: untranslated string: age shour
-WARNING: untranslated string: age sminute
-WARNING: untranslated string: age ssecond
WARNING: untranslated string: attention
WARNING: untranslated string: bytes
WARNING: untranslated string: ccd add
diff --git a/doc/language_issues.fr b/doc/language_issues.fr
index c37425e..7e5a1f5 100644
--- a/doc/language_issues.fr
+++ b/doc/language_issues.fr
@@ -559,11 +559,6 @@ WARNING: untranslated string: advproxy errmsg cache
WARNING: untranslated string: advproxy errmsg invalid upstream proxy
WARNING: untranslated string: advproxy errmsg proxy ports equal
WARNING: untranslated string: advproxy proxy port transparent
-WARNING: untranslated string: age second
-WARNING: untranslated string: age seconds
-WARNING: untranslated string: age shour
-WARNING: untranslated string: age sminute
-WARNING: untranslated string: age ssecond
WARNING: untranslated string: attention
WARNING: untranslated string: bytes
WARNING: untranslated string: ccd add
diff --git a/doc/language_issues.nl b/doc/language_issues.nl
index 55fd951..10e12db 100644
--- a/doc/language_issues.nl
+++ b/doc/language_issues.nl
@@ -560,11 +560,6 @@ WARNING: untranslated string: Scan for Songs
WARNING: untranslated string: advproxy cache-digest
WARNING: untranslated string: advproxy errmsg proxy ports equal
WARNING: untranslated string: advproxy proxy port transparent
-WARNING: untranslated string: age second
-WARNING: untranslated string: age seconds
-WARNING: untranslated string: age shour
-WARNING: untranslated string: age sminute
-WARNING: untranslated string: age ssecond
WARNING: untranslated string: bytes
WARNING: untranslated string: ccd iroute2
WARNING: untranslated string: default ip
diff --git a/doc/language_issues.pl b/doc/language_issues.pl
index 09ebf81..9ae2c0a 100644
--- a/doc/language_issues.pl
+++ b/doc/language_issues.pl
@@ -557,11 +557,6 @@ WARNING: untranslated string: advproxy errmsg cache
WARNING: untranslated string: advproxy errmsg invalid upstream proxy
WARNING: untranslated string: advproxy errmsg proxy ports equal
WARNING: untranslated string: advproxy proxy port transparent
-WARNING: untranslated string: age second
-WARNING: untranslated string: age seconds
-WARNING: untranslated string: age shour
-WARNING: untranslated string: age sminute
-WARNING: untranslated string: age ssecond
WARNING: untranslated string: attention
WARNING: untranslated string: bytes
WARNING: untranslated string: ccd add
diff --git a/doc/language_issues.ru b/doc/language_issues.ru
index 200ab29..f46ba7a 100644
--- a/doc/language_issues.ru
+++ b/doc/language_issues.ru
@@ -551,11 +551,6 @@ WARNING: untranslated string: advproxy errmsg cache
WARNING: untranslated string: advproxy errmsg invalid upstream proxy
WARNING: untranslated string: advproxy errmsg proxy ports equal
WARNING: untranslated string: advproxy proxy port transparent
-WARNING: untranslated string: age second
-WARNING: untranslated string: age seconds
-WARNING: untranslated string: age shour
-WARNING: untranslated string: age sminute
-WARNING: untranslated string: age ssecond
WARNING: untranslated string: attention
WARNING: untranslated string: bytes
WARNING: untranslated string: ccd add
diff --git a/doc/language_issues.tr b/doc/language_issues.tr
index 30a7a8a..5bd50a0 100644
--- a/doc/language_issues.tr
+++ b/doc/language_issues.tr
@@ -41,6 +41,11 @@ WARNING: translation string unused: advproxy no cre groups
WARNING: translation string unused: advproxy ssadvanced proxy
WARNING: translation string unused: advproxy update information
WARNING: translation string unused: advproxy update notification
+WARNING: translation string unused: age second
+WARNING: translation string unused: age seconds
+WARNING: translation string unused: age shour
+WARNING: translation string unused: age sminute
+WARNING: translation string unused: age ssecond
WARNING: translation string unused: alcatelusb help
WARNING: translation string unused: alcatelusb upload
WARNING: translation string unused: all interfaces
diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl
index 30bf70a..5754c7d 100644
--- a/langs/en/cgi-bin/en.pl
+++ b/langs/en/cgi-bin/en.pl
@@ -1166,7 +1166,7 @@
'hostname not set' => 'Hostname not set.',
'hosts config added' => 'Hosts config added',
'hosts config changed' => 'Hosts config changed',
-'hour' => 'hour',
+'hour' => 'Hour',
'hour-graph' => 'Hour',
'hours' => 'hours',
'hours2' => 'Hours',
hooks/post-receive
--
IPFire 2.x development tree
reply other threads:[~2014-01-05 1:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140105014448.4CC5E21E2F@argus.ipfire.org \
--to=git@ipfire.org \
--cc=ipfire-scm@lists.ipfire.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox