浏览代码

debianize: use date of the most recent file instead of "now"

The changelog generated by Isar would use the current date/time
causing each build to be different. Use the date/time of the
most recent file to achieve reproducible builds (assuming files
contained in the payload have the same contents and timestamps).
In the event where the package is not shipping any files, Isar
will default to the current date/time.

Signed-off-by: Cedric Hombourger <Cedric_Hombourger@mentor.com>
Cedric Hombourger 6 年之前
父节点
当前提交
92af307cd3
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      meta/classes/debianize.bbclass

+ 6 - 1
meta/classes/debianize.bbclass

@@ -6,7 +6,12 @@
 CHANGELOG_V ?= "${PV}"
 
 deb_add_changelog() {
-	date=$( LANG=C date -R )
+	timestamp=$(find ${S}/ -type f -not -path "${S}/debian/*" -printf "%T@\n"|sort -n -r|head -n 1)
+	if [ -n "${timestamp}" ]; then
+		date=$(LANG=C date -R -d @${timestamp})
+	else
+		date=$(LANG=C date -R)
+	fi
 	cat <<EOF > ${S}/debian/changelog
 ${PN} (${CHANGELOG_V}) UNRELEASED; urgency=low