MSYS2-packages/pacman/0013-Change-the-epoch-separator.patch
Christoph Reiter 1915a138c0 pacman: Update to 6.1.0 (v2)
Same as #4584 but with an additional backport:
https://github.com/msys2/msys2-pacman/pull/49

Old message:

See msys2/msys2-pacman#45

makepkg.conf synced with the upstream version:
https://gitlab.archlinux.org/pacman/pacman/-/blob/v6.1.0/etc/makepkg.conf.in

Skip patches only changing CI configs
2024-05-09 09:45:39 +02:00

53 lines
1.7 KiB
Diff

From c31dc64bc2bd37db66b5f44ba1659ebfafe076fa Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Fri, 21 May 2021 22:54:23 +0200
Subject: [PATCH 13/N] Change the epoch separator
---
lib/libalpm/version.c | 6 +++++-
scripts/libmakepkg/util/pkgbuild.sh.in | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/lib/libalpm/version.c b/lib/libalpm/version.c
index 3f0de8d..a58d9de 100644
--- a/lib/libalpm/version.c
+++ b/lib/libalpm/version.c
@@ -50,7 +50,11 @@ static void parseEVR(char *evr, const char **ep, const char **vp,
/* se points to version terminator */
se = strrchr(s, '-');
+#ifdef __MSYS__
+ if(*s == '~') {
+#else
if(*s == ':') {
+#endif
epoch = evr;
*s++ = '\0';
version = s;
@@ -236,7 +240,7 @@ int SYMEXPORT alpm_pkg_vercmp(const char *a, const char *b)
return 0;
}
- /* Parse both versions into [epoch:]version[-release] triplets. We probably
+ /* Parse both versions into [epoch:|~]version[-release] triplets. We probably
* don't need epoch and release to support all the same magic, but it is
* easier to just run it all through the same code. */
full1 = strdup(a);
diff --git a/scripts/libmakepkg/util/pkgbuild.sh.in b/scripts/libmakepkg/util/pkgbuild.sh.in
index 9d9e59b..1fd903b 100644
--- a/scripts/libmakepkg/util/pkgbuild.sh.in
+++ b/scripts/libmakepkg/util/pkgbuild.sh.in
@@ -166,7 +166,11 @@ get_pkgbuild_all_split_attributes() {
##
get_full_version() {
if (( epoch > 0 )); then
- printf "%s\n" "$epoch:$pkgver-$pkgrel"
+ if [[ -n $MSYSTEM ]]; then
+ printf "%s\n" "${epoch}~${pkgver}-${pkgrel}"
+ else
+ printf "%s\n" "$epoch:$pkgver-$pkgrel"
+ fi
else
printf "%s\n" "$pkgver-$pkgrel"
fi