bc092b9
From b43b8cacc813c2c15347de1e35cc88d9aa912d22 Mon Sep 17 00:00:00 2001
bc092b9
From: Vladimir Serbinenko <phcoder@gmail.com>
bc092b9
Date: Mon, 23 Jan 2017 14:31:36 +0300
6f1e3d5
Subject: [PATCH 004/198] support busybox date.
bc092b9
bc092b9
Busybox date doesn't understand weekdays in -d input,
bc092b9
so strip them beforehand.
bc092b9
---
bc092b9
 tests/grub_cmd_date.in  | 2 +-
bc092b9
 tests/grub_cmd_sleep.in | 4 ++--
bc092b9
 2 files changed, 3 insertions(+), 3 deletions(-)
bc092b9
bc092b9
diff --git a/tests/grub_cmd_date.in b/tests/grub_cmd_date.in
bc092b9
index 0d8162e98..60f039ebc 100644
bc092b9
--- a/tests/grub_cmd_date.in
bc092b9
+++ b/tests/grub_cmd_date.in
bc092b9
@@ -9,7 +9,7 @@ if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = sparc64-ieee1275 ];
bc092b9
 fi
bc092b9
 
bc092b9
 pdt="$(date -u +%s)"
bc092b9
-dt=`echo date | @builddir@/grub-shell`
bc092b9
+dt=`echo date | @builddir@/grub-shell | sed 's, [A-Z][a-z]*$,,'`
bc092b9
 dtg="$(date -u -d "$dt" +%s)"
bc092b9
 ndt="$(date -u +%s)"
bc092b9
 
bc092b9
diff --git a/tests/grub_cmd_sleep.in b/tests/grub_cmd_sleep.in
bc092b9
index 05b8f6b73..ac51d4209 100644
bc092b9
--- a/tests/grub_cmd_sleep.in
bc092b9
+++ b/tests/grub_cmd_sleep.in
bc092b9
@@ -11,8 +11,8 @@ fi
bc092b9
 # Compare RTC with interval timer.
bc092b9
 # Not 100% proper but should check that timer is running ok
bc092b9
 dt=`echo 'date; sleep 10; date' | @builddir@/grub-shell`
bc092b9
-dt1="$(date -u -d "$(echo "$dt" | head -n 1)" +%s)"
bc092b9
-dt2="$(date -u -d "$(echo "$dt" | tail -n 1)" +%s)"
bc092b9
+dt1="$(date -u -d "$(echo "$dt" | head -n 1 | sed 's, [A-Z][a-z]*$,,')" +%s)"
bc092b9
+dt2="$(date -u -d "$(echo "$dt" | tail -n 1 | sed 's, [A-Z][a-z]*$,,')" +%s)"
bc092b9
 
bc092b9
 # Ignore QEMU bug
bc092b9
 if [ "${grub_modinfo_target_cpu}" = arm ] && [ $((dt2 - dt1)) -ge 15 ] && [ $((dt2 - dt1)) -le 17 ]; then
bc092b9
-- 
da63b36
2.14.3
bc092b9