Skip to content

Commit

Permalink
obs: obs changelog update timestamp with commit version
Browse files Browse the repository at this point in the history
+u00的commit版本更新时间戳
  • Loading branch information
hudeng-go authored and deepin-ci-robot committed Apr 26, 2024
1 parent 1ee5884 commit 6762e86
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions services/obs/src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ COPY src/server /
RUN patch -p2 -d /usr/lib/obs/service/TarSCM/ < /patches/0001-obs-tar-scm.patch
RUN patch -p2 -d /usr/lib/obs/service/TarSCM/ < /patches/0003-chore-remove-dpkg-parsechangelog-warning.patch
RUN patch -p2 -d /usr/lib/obs/service/TarSCM/scm < /patches/0005-fix-cache-dir-lock-file-improper-cleanin.patch
RUN patch -p2 -d /usr/lib/obs/service/TarSCM/ < /patches/0006-feat-commit-version-update-timestamp.patch
# RUN patch -p3 -d /usr/lib/obs/server < /patches/0002-feat-Add-linglong-build-support.patch
RUN tar xf /obs-server.tar -C /usr/lib/obs/; rm /obs-server.tar
RUN patch -p1 -d /usr/lib/obs/server/build/ < /patches/0004-fix-debian-i386-arch-incorrect-excluded-when-build.patch
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
From 272ca221acfe506019d27c1d37795efcc6532599 Mon Sep 17 00:00:00 2001
From: hudeng <[email protected]>
Date: Fri, 26 Apr 2024 05:50:26 +0000
Subject: [PATCH] feat: commit version update timestamp

by add new changelog entry
---
TarSCM/archive.py | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/TarSCM/archive.py b/TarSCM/archive.py
index 144df89..a0677c1 100644
--- a/TarSCM/archive.py
+++ b/TarSCM/archive.py
@@ -364,8 +364,22 @@ class Gbp(BaseArchive):
logging.debug("Setting version to %s", version)
# gbp by default complains about uncommitted changes
command.append("--git-ignore-new")
- lines[0] = re.sub(r'^(.+) \(.+\) (.+)',
- r'\1 (%s) \2' % version, lines[0])
+ if "+u00" in version:
+ import datetime
+ logging.info("commit version: %s, add new changelog entry", version)
+ current_time = datetime.datetime.utcnow().strftime("%a, %d %b %Y %H:%M:%S %z")
+ news = []
+ news.append(re.sub(r'^(.+) \(.+\) (.+)',
+ r'\1 (%s) \2' % version, lines[0]))
+ news.append("\n")
+ news.append(" * commit update")
+ news.append("\n\n")
+ news.append(" -- Deepin Packages Builder <[email protected]> " + current_time)
+ news.append("\n\n")
+ lines = news + lines
+ else:
+ lines[0] = re.sub(r'^(.+) \(.+\) (.+)',
+ r'\1 (%s) \2' % version, lines[0])
cl.write("".join(lines))

logging.debug("Running in %s", scm_object.clone_dir)
--
2.35.3

0 comments on commit 6762e86

Please sign in to comment.