-
Notifications
You must be signed in to change notification settings - Fork 9
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
deepin-ci-robot
merged 1 commit into
deepin-community:master
from
hudeng-go:obs-changelog
Apr 26, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
41 changes: 41 additions & 0 deletions
41
services/obs/src/patches/0006-feat-commit-version-update-timestamp.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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