From 60a7f054b32eab79b0255e4eade0d0bf1a27cbae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Sun, 23 Sep 2018 09:41:55 +0200 Subject: [PATCH 1/3] appveyor: clone_depth is unnecessary if shallow_clone is used --- appveyor.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 5aa9f8f..aae49e8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,5 @@ max_jobs: 1 -# Are both necessary? shallow_clone: true -clone_depth: 1 image: Visual Studio 2015 From 6f5522bdcb8ae697719b419bbfead214d64ffa93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Fri, 31 Aug 2018 09:36:04 +0200 Subject: [PATCH 2/3] Installed datefudge on Appveyor via Cygwin --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index aae49e8..f685024 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -22,7 +22,7 @@ install: - cmd: cd .. - cmd: set PATH=%cd%\gdisk\;%PATH% # mkisofs,zip,ImageMagick - - cmd: C:\cygwin\setup-x86.exe --no-replaceonreboot --no-shortcuts --quiet-mode --root c:\cygwin --packages mkisofs,genisoimage,zip,ImageMagick,xorg-server-extra + - cmd: C:\cygwin\setup-x86.exe --no-replaceonreboot --no-shortcuts --quiet-mode --root c:\cygwin --packages mkisofs,genisoimage,zip,ImageMagick,xorg-server-extra,datefudge - cmd: C:\cygwin\bin\find C:\cygwin -iname "import*" - cmd: C:\cygwin\bin\find C:\cygwin -iname "convert*" # mtools From 76ef64b5be2231ef49bb8affca809e785f9d83be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Sat, 1 Sep 2018 00:16:40 +0200 Subject: [PATCH 3/3] Use faketime or datefudge if the former is not installed --- Makefile | 10 +++++----- utils/faketime.sh | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 5 deletions(-) create mode 100755 utils/faketime.sh diff --git a/Makefile b/Makefile index 708dbe8..c0e7cfe 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ define date_command fi endef commit_timestamp = "$$(${call date_command,"${COMMIT_TIMESTAMP_ISO_8601}",'+%Y%m%d%H%m.%S'})" -commit_faketime = "$$(${call date_command,"${COMMIT_TIMESTAMP_ISO_8601}",'+%Y-%m-%d %H:%m:%S'})" +commit_timestamp_iso_8601 = ${COMMIT_TIMESTAMP_ISO_8601} offset_names = bytes_os_size \ bytes_mbr_start \ @@ -222,7 +222,7 @@ ${bld}/os.iso: ${bld}/iso_files/os.zip ${bld}/iso_files/boot/iso_boot.sys ./util ! test -d ${bld}/iso_files.tmp cp -a ${cp_T_option} -- ${bld}/iso_files ${bld}/iso_files.tmp find ${bld}/iso_files.tmp -depth -exec touch -t ${commit_timestamp} '{}' ';' - UTILS="$$PWD/utils" (cd ./${bld}/iso_files.tmp/ && faketime -f ${commit_faketime} $$UTILS/mkisofs \ + UTILS="$$PWD/utils" ./utils/faketime.sh ${commit_timestamp_iso_8601} sh -c '(cd ./${bld}/iso_files.tmp/ && "$$UTILS/mkisofs" \ --input-charset utf-8 \ -rock \ -joliet \ @@ -232,7 +232,7 @@ ${bld}/os.iso: ${bld}/iso_files/os.zip ${bld}/iso_files/boot/iso_boot.sys ./util -boot-load-size 4 \ -pad \ -output ../os.iso \ - .) + .)' rm -- ${bld}/iso_files.tmp/os.zip \ ${bld}/iso_files.tmp/boot/iso_boot.sys rmdir ${bld}/iso_files.tmp/boot/ @@ -301,12 +301,12 @@ os_fat12_partition = "$@@@${bytes_fat12_start}" ${bld}/os.fat12: ${bld}/os.zip ${dep_bytes_fat12_size} ${dep_bytes_fat12_start} ${dep_sectors_os_size} \ ./utils/mformat ./utils/mcopy ${bld}/check_makefile set -x; dd if=/dev/zero bs=${sector_size} count=${sectors_os_size} of=$@ - faketime -f ${commit_faketime} ./utils/mformat -v "Example OS" \ + ./utils/faketime.sh ${commit_timestamp_iso_8601} ./utils/mformat -v "Example OS" \ -T ${sectors_fat12_size} \ -h ${os_floppy_chs_h} \ -s ${os_floppy_chs_s} \ -i ${os_fat12_partition} - faketime -f ${commit_faketime} ./utils/mcopy -i ${os_fat12_partition} $< "::os.zip" + ./utils/faketime.sh ${commit_timestamp_iso_8601} ./utils/mcopy -i ${os_fat12_partition} $< "::os.zip" ${bld}/iso_files/os.zip: ${bld}/os.zip ${bld}/check_makefile # TODO: make it so that the various file formats are mutual quines: diff --git a/utils/faketime.sh b/utils/faketime.sh new file mode 100755 index 0000000..d36740c --- /dev/null +++ b/utils/faketime.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -euET -o pipefail + +timestamp_iso_8601="$1" +shift + +date_command() { + # TODO: substring or case … in Darwin*) + if test "$(uname -s)" = Darwin; then + date -j -f '%Y-%m-%dT%H:%M:%S' "$(echo "${1}" | cut -c 1-19)" "${2}"; + else + date -d "${1}" "${2}"; + fi +} + +if which faketime >/dev/null; then + ( set -x; faketime -f "$(date_command "${timestamp_iso_8601}" '+%Y-%m-%d %H:%m:%S')" "$@"; ) +elif which datefudge >/dev/null; then + ( set -x; datefudge --static "${timestamp_iso_8601}" "$@"; ) +else + echo "ERROR: command faketime or datefudge not found. Please install either command." + exit 1 +fi