diff options
author | Xiao Pan <xyz@flylightning.xyz> | 2025-03-21 23:43:53 -0700 |
---|---|---|
committer | Xiao Pan <xyz@flylightning.xyz> | 2025-03-21 23:43:53 -0700 |
commit | 8058fa47785727cf2ccda375a5bd01677d615ec1 (patch) | |
tree | 9f93f60043402d00b1e66106abdb088b79454a27 | |
parent | 58adb2c02eaed4f65eaf94e2093f3fbd6090c3f9 (diff) |
use patch instead
-rw-r--r-- | any/pass-otp-git/0001-Fix-HOTP-counter-increases.patch | 25 | ||||
-rw-r--r-- | any/pass-otp-git/PKGBUILD (renamed from any/pass-otp_fix-hotp-counter-git/PKGBUILD) | 21 |
2 files changed, 40 insertions, 6 deletions
diff --git a/any/pass-otp-git/0001-Fix-HOTP-counter-increases.patch b/any/pass-otp-git/0001-Fix-HOTP-counter-increases.patch new file mode 100644 index 0000000..897492d --- /dev/null +++ b/any/pass-otp-git/0001-Fix-HOTP-counter-increases.patch @@ -0,0 +1,25 @@ +From 0447ae4fa84def63d6ce97c251ea3fa5af0dcc07 Mon Sep 17 00:00:00 2001 +From: Juan Orti Alcaine <jortialc@redhat.com> +Date: Sat, 5 Nov 2022 07:45:25 +0100 +Subject: [PATCH] Fix HOTP counter increases + +--- + otp.bash | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/otp.bash b/otp.bash +index a0688d2..a58a96c 100755 +--- a/otp.bash ++++ b/otp.bash +@@ -370,7 +370,7 @@ cmd_otp_code() { + + if [[ "$otp_type" == "hotp" ]]; then + # Increment HOTP counter in-place +- local line replaced uri=${otp_uri/&counter=$otp_counter/&counter=$counter} ++ local line replaced uri=${otp_uri/&counter=$otp_counter/"&counter=$counter"} + while IFS= read -r line; do + [[ "$line" == otpauth://* ]] && line="$uri" + [[ -n "$replaced" ]] && replaced+=$'\n' +-- +2.49.0 + diff --git a/any/pass-otp_fix-hotp-counter-git/PKGBUILD b/any/pass-otp-git/PKGBUILD index 0c2897c..6c25e52 100644 --- a/any/pass-otp_fix-hotp-counter-git/PKGBUILD +++ b/any/pass-otp-git/PKGBUILD @@ -1,13 +1,14 @@ # Contibutor: Morten Linderud <foxboron@archlinux.org> # Contibutor: Alexandre Pujol <alexandre@pujol.io> -pkgname='pass-otp_fix-hotp-counter-git' +pkgname='pass-otp-git' +_pkgname=pass-otp pkgver=r136.0447ae4 pkgrel=2 # https://github.com/tadfisher/pass-otp/pull/172 pkgdesc='A pass extension for managing one-time-password (OTP) tokens. With hotp counter fix.' arch=('any') -url='https://github.com/jorti/pass-otp' +url='https://github.com/tadfisher/pass-otp' license=('GPL3') depends=('pass' 'oath-toolkit' @@ -16,15 +17,23 @@ makedepends=('git') optdepends=('perl-pass-otp') provides=('pass-otp') conflicts=('pass-otp') -source=("git+$url.git#branch=fix-hotp-counter") -sha256sums=('SKIP') +# patch from https://github.com/tadfisher/pass-otp/pull/172 +source=("git+$url.git" + '0001-Fix-HOTP-counter-increases.patch') +b2sums=('SKIP' + 'fb97f0b8049bc8349f0dba20ce7b491b280a140aa1ad4f751aba7fb69a8b95986dda83c5ed698540d56ae47c829200bafd653cc4773bb502d095d2baf3861895') pkgver() { - cd "$srcdir/${pkgname%_fix-hotp-counter-git}" + cd "$srcdir/$_pkgname" printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" } +prepare() { + cd "$srcdir/$_pkgname" + patch -p1 -i "$srcdir/0001-Fix-HOTP-counter-increases.patch" +} + package() { - cd "$srcdir/${pkgname%_fix-hotp-counter-git}" + cd "$srcdir/$_pkgname" make PREFIX=/usr DESTDIR="${pkgdir}" install } |