From b4ccc006a8ec0b5fbbb7984a5e2e4e70e5617c36 Mon Sep 17 00:00:00 2001 From: Raboneko <119771935+raboneko@users.noreply.github.com> Date: Fri, 14 Feb 2025 00:45:06 -0800 Subject: [PATCH] [el10] fix(davs2): update logic (#3332) (#3334) * fix(davs2): update logic (#3332) (cherry picked from commit a49f31b6e887ec63a7efa1395c950f1a7afd8ba2) * fix(davs2): rpm conditional syntax (cherry picked from commit 8868186) * fix(davs2): use %nil (cherry picked from commit 629a31b) --------- Co-authored-by: sadlerm4 --- anda/lib/davs2/davs2.spec | 10 +++++----- anda/lib/davs2/update.rhai | 6 +++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/anda/lib/davs2/davs2.spec b/anda/lib/davs2/davs2.spec index 381a723a2f..c89632dde4 100644 --- a/anda/lib/davs2/davs2.spec +++ b/anda/lib/davs2/davs2.spec @@ -1,15 +1,15 @@ %global commit0 b41cf117452e2d73d827f02d3e30aa20f1c721ac %global date 20220903 -%global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) +%global shortcommit %(c=%{commit0}; echo ${c:0:7}) Name: davs2 -Version: 1.6 -Release: 5%{?shortcommit0:.%{date}git%{shortcommit0}}%{?dist} +Version: 1.7 +Release: 1%{?shortcommit:.%{date}git%{shortcommit}}%{?dist} Summary: An open-source decoder of AVS2-P2/IEEE1857.4 video coding standard URL: https://github.com/pkuvcl/%{name} License: GPLv2 -%if "%{?shortcommit0}" +%if %len %{commit0} != 0 Source0: https://github.com/pkuvcl/%{name}/archive/%{commit0}/%{name}-%{commit0}.tar.gz#/%{name}-%{shortcommit0}.tar.gz %else Source0: https://github.com/pkuvcl/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz @@ -44,7 +44,7 @@ This package contains the shared library development files. %prep # Use flat condition or it fails on EPEL 7 -%if "%{?shortcommit0}" +%if %len %{commit0} != 0 %autosetup -n %{name}-%{commit0} %else %autosetup diff --git a/anda/lib/davs2/update.rhai b/anda/lib/davs2/update.rhai index 65d19575fc..eb4ae552ce 100644 --- a/anda/lib/davs2/update.rhai +++ b/anda/lib/davs2/update.rhai @@ -1 +1,5 @@ -rpm.version(gh("pkuvcl/davs2")); +rpm.version(gh_tag("pkuvcl/davs2")); +if rpm.changed() { + rpm.global("commit0", "%nil"); + rpm.release(); +} \ No newline at end of file