Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

obs: obs changelog update timestamp with commit version #122

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: It's generally not useful to have the filename in the file

# RUN patch -p3 -d /usr/lib/obs/server < /patches/0002-feat-Add-linglong-build-support.patch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?)

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
Loading