utils: Use 'scandir' instead of custom 'for-each-file'

* src/mcron/utils.scm (for-each-file): Delete.
* src/mcron/scripts/cron.scm (process-files-in-system-directory): Use
'scandir' which has the benefit of being deterministic.
* src/mcron/scripts/mcron.scm (process-files-in-user-directory):
Likewise.
* tests/schedule.sh: Update expected output which is now more reliable.
* NEWS: Update.

Suggested-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Mathieu Lirzin 2018-03-20 14:44:54 +01:00
commit f908c5395c
No known key found for this signature in database
GPG key ID: 0ADEE10094604D37
5 changed files with 26 additions and 36 deletions

View file

@ -41,14 +41,10 @@ EOF
cat > expected <<EOF
Thu Jan 1 00:00:01 1970 +0000
(display foo
(display bar
)
Thu Jan 1 00:00:01 1970 +0000
(display bar
)
Thu Jan 1 00:00:02 1970 +0000
(display foo
)
@ -56,7 +52,7 @@ Thu Jan 1 00:00:02 1970 +0000
(display bar
)
Thu Jan 1 00:00:03 1970 +0000
Thu Jan 1 00:00:02 1970 +0000
(display foo
)
@ -64,7 +60,7 @@ Thu Jan 1 00:00:03 1970 +0000
(display bar
)
Thu Jan 1 00:00:04 1970 +0000
Thu Jan 1 00:00:03 1970 +0000
(display foo
)
@ -72,7 +68,7 @@ Thu Jan 1 00:00:04 1970 +0000
(display bar
)
Thu Jan 1 00:00:05 1970 +0000
Thu Jan 1 00:00:04 1970 +0000
(display foo
)
@ -80,7 +76,7 @@ Thu Jan 1 00:00:05 1970 +0000
(display bar
)
Thu Jan 1 00:00:06 1970 +0000
Thu Jan 1 00:00:05 1970 +0000
(display foo
)
@ -88,7 +84,7 @@ Thu Jan 1 00:00:06 1970 +0000
(display bar
)
Thu Jan 1 00:00:07 1970 +0000
Thu Jan 1 00:00:06 1970 +0000
(display foo
)
@ -96,7 +92,7 @@ Thu Jan 1 00:00:07 1970 +0000
(display bar
)
Thu Jan 1 00:00:08 1970 +0000
Thu Jan 1 00:00:07 1970 +0000
(display foo
)
@ -104,7 +100,7 @@ Thu Jan 1 00:00:08 1970 +0000
(display bar
)
Thu Jan 1 00:00:09 1970 +0000
Thu Jan 1 00:00:08 1970 +0000
(display foo
)
@ -112,7 +108,7 @@ Thu Jan 1 00:00:09 1970 +0000
(display bar
)
Thu Jan 1 00:00:10 1970 +0000
Thu Jan 1 00:00:09 1970 +0000
(display foo
)
@ -120,6 +116,10 @@ Thu Jan 1 00:00:10 1970 +0000
(display bar
)
Thu Jan 1 00:00:10 1970 +0000
(display foo
)
EOF
mcron --schedule=10 > output