Skip to content

Commit f19820c

Browse files
Merge branch 'master' into master
2 parents 726ab24 + c658d80 commit f19820c

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

build

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,11 +852,23 @@ query_dirassets() {
852852
esac
853853
}
854854

855+
get_commit_ts_from_obsinfo() {
856+
local line ts
857+
while read line ; do
858+
case $line in
859+
mtime:\ *[^0-9]*) ;;
860+
mtime:\ [0-9]*) ts=${line#mtime: } ;;
861+
esac
862+
done < "$1"
863+
test -n "$ts" && echo $ts
864+
}
865+
855866
copy_sources() {
856867
local image_mode i
857868
if test "$BUILDTYPE" = kiwi -o "$BUILDTYPE" = docker -o "$BUILDTYPE" = fissile -o "$BUILDTYPE" = podman -o "$BUILDTYPE" = productcompose ; then
858869
image_mode=true
859870
fi
871+
local set_mtime
860872
if test -n "$RUNNING_IN_VM" -o -n "$COPY_SOURCES_ASIS" -o -n "$RPM_BUILD_IN_PLACE" ; then
861873
image_mode=
862874
( shopt -s nullglob ; cp -pRd "$1/".[^.]* "$1/"..?* "$1"/* "$2" )
@@ -867,6 +879,8 @@ copy_sources() {
867879
test -n "$dirassets" && dirassets="/${dirassets// /\\/}/"
868880
# check which directory belongs to the git repository and only copy those and the dir assets
869881
type -p git >& /dev/null || cleanup_and_exit 1 "need git to check file status"
882+
# get commit timestamp
883+
set_mtime=$(git -C "$1" log -n1 --date=format:%Y%m%d --no-show-signature --pretty=format:%ct)
870884
for i in "$1/".* "$1"/* ; do
871885
local ii="${i##*/}"
872886
test "$ii" = . -o "$ii" = .. -o "$ii" = .git && continue
@@ -890,7 +904,11 @@ copy_sources() {
890904
$BUILD_DIR/export_debian_orig_from_git "$1" "$2/build.origtar" || cleanup_and_exit 1 "export_debian_orig_from_git failed"
891905
fi
892906
else
907+
# check if there is a _scmsync.obsinfo file and get the commit timestamp
893908
# query recipe for directories to copy
909+
if test -s "$1/_scmsync.obsinfo" ; then
910+
set_mtime=$(get_commit_ts_from_obsinfo "$1/_scmsync.obsinfo")
911+
fi
894912
local dirassets
895913
dirassets=$(query_dirassets "$1/$RECIPEFILE")
896914
test -n "$dirassets" && dirassets="/${dirassets// /\\/}/"
@@ -908,6 +926,10 @@ copy_sources() {
908926
cp -p "$1"/* "$2"
909927
fi
910928
fi
929+
if test -n "$set_mtime" ; then
930+
echo "setting source mtime to $set_mtime"
931+
find "$2" -depth -type d -print0 -o -links 1 -print0 | xargs -0 --no-run-if-empty touch -d "@$set_mtime"
932+
fi
911933
if test -n "$image_mode" ; then
912934
rm -rf "$2/repos" "$2/containers"
913935
if test -z "$REPOS_DIRECTORY" ; then

dist/build.changes

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
-------------------------------------------------------------------
2+
Fri Aug 29 06:38:57 UTC 2025 - Adrian Schröter <[email protected]>
3+
4+
- Set the source mtime to the commit timestamp for git (boo#1248776)
5+
- calculate goname for fedora assets
6+
- Make spec2changelog more resiliant to 3rd party spefiles
7+
- pbuild:
8+
* Fix url construction in remoteurl handling
9+
* Fix xz decompression
10+
- rpm:
11+
* Allow to set extra macros when parsing a specfile
12+
* genbuildrequs: set HOME before querying the specfile
13+
114
-------------------------------------------------------------------
215
Wed Aug 20 11:09:13 UTC 2025 - Mohamed Rekiba <[email protected]>
316

0 commit comments

Comments
 (0)