[systemd-devel] [PATCH 1/5] calendar: semesterly alias for semi-annually
Daniele Medri
dmedri at gmail.com
Thu Oct 30 04:19:11 PDT 2014
---
man/systemd.time.xml | 4 ++--
src/shared/calendarspec.c | 3 ++-
src/test/test-calendarspec.c | 1 +
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/man/systemd.time.xml b/man/systemd.time.xml
index f35ccd7..2342684 100644
--- a/man/systemd.time.xml
+++ b/man/systemd.time.xml
@@ -247,8 +247,8 @@
<literal>monthly</literal>, <literal>weekly</literal>,
<literal>yearly</literal>,
<literal>quarterly</literal>,
- <literal>semiannually</literal> may be used as
- calendar events which refer to
+ <literal>semesterly</literal> or <literal>semiannually</literal>
+ may be used as calendar events which refer to
<literal>*-*-* *:*:00</literal>,
<literal>*-*-* *:00:00</literal>,
<literal>*-*-* 00:00:00</literal>,
diff --git a/src/shared/calendarspec.c b/src/shared/calendarspec.c
index 7efcf7b..3115bba 100644
--- a/src/shared/calendarspec.c
+++ b/src/shared/calendarspec.c
@@ -757,7 +757,8 @@ int calendar_spec_from_string(const char *p, CalendarSpec **spec) {
} else if (strcaseeq(p, "biannually") ||
strcaseeq(p, "bi-annually") ||
strcaseeq(p, "semiannually") ||
- strcaseeq(p, "semi-annually")) {
+ strcaseeq(p, "semi-annually") ||
+ strcaseeq(p, "semesterly")) {
r = const_chain(1, &c->month);
if (r < 0)
diff --git a/src/test/test-calendarspec.c b/src/test/test-calendarspec.c
index 87e1da1..7610cff 100644
--- a/src/test/test-calendarspec.c
+++ b/src/test/test-calendarspec.c
@@ -80,6 +80,7 @@ int main(int argc, char* argv[]) {
test_one("minutely", "*-*-* *:*:00");
test_one("quarterly", "*-01,04,07,10-01 00:00:00");
test_one("semi-annually", "*-01,07-01 00:00:00");
+ test_one("semesterly", "*-01,07-01 00:00:00");
test_one("annually", "*-01-01 00:00:00");
test_one("*:2/3", "*-*-* *:02/3:00");
--
1.9.3
More information about the systemd-devel
mailing list