File: reproducible-examples.patch

package info (click to toggle)
awesome 4.3-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,460 kB
  • sloc: ansic: 14,508; sh: 526; makefile: 46
file content (49 lines) | stat: -rw-r--r-- 1,924 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Date: Mon, 28 Jan 2019 21:00:44 +0100
Subject: [PATCH] Use reproducible timestamps in more doc examples
Origin: upstream, https://github.com/awesomeWM/awesome/pull/2626

This adds require("_date") to some example tests that use the current
date via os.date. This allows reproducibility by replacing os.date()
with a function that uses a static date from $SOURCE_DATE_EPOCH. See
commit 9d7eaf0 for more details.

Signed-off-by: Uli Schlachter <psychon@znc.in>

--- a/tests/examples/awful/popup/wiboxtypes.lua
+++ b/tests/examples/awful/popup/wiboxtypes.lua
@@ -1,6 +1,7 @@
 --DOC_GEN_IMAGE
 --DOC_HIDE_ALL
 --DOC_NO_USAGE
+require("_date")
 local awful     = require("awful")
 local gears     = require("gears")
 local wibox     = require("wibox")
--- a/tests/examples/awful/tooltip/textclock.lua
+++ b/tests/examples/awful/tooltip/textclock.lua
@@ -1,5 +1,6 @@
 --DOC_GEN_IMAGE
 --DOC_NO_USAGE
+require("_date") --DOC_HIDE
 screen[1]._resize {width = 300, height = 75} --DOC_HIDE
 local awful = {tooltip = require("awful.tooltip"), wibar = require("awful.wibar")} --DOC_HIDE
 local wibox = { widget = { textclock = require("wibox.widget.textclock") }, --DOC_HIDE
--- a/tests/examples/awful/tooltip/textclock2.lua
+++ b/tests/examples/awful/tooltip/textclock2.lua
@@ -1,5 +1,6 @@
 --DOC_GEN_IMAGE
 --DOC_NO_USAGE
+require("_date") --DOC_HIDE
 screen[1]._resize {width = 300, height = 75} --DOC_HIDE
 local awful = {tooltip = require("awful.tooltip"), wibar = require("awful.wibar")} --DOC_HIDE
 local wibox = { widget = { textclock = require("wibox.widget.textclock") }, --DOC_HIDE
--- a/tests/examples/awful/widget/layoutlist/wibar.lua
+++ b/tests/examples/awful/widget/layoutlist/wibar.lua
@@ -1,6 +1,7 @@
 --DOC_NO_USAGE --DOC_GEN_IMAGE
 local awful     = require("awful") --DOC_HIDE
 local wibox     = require("wibox") --DOC_HIDE
+require("_date") --DOC_HIDE
 
 screen[1]._resize {width = 480, height = 100} --DOC_HIDE