]> git.pld-linux.org Git - packages/fzf.git/commitdiff
package fzf-git.sh as a part of fzf auto/th/fzf-0.34.0-1
authorJan Palus <atler@pld-linux.org>
Thu, 29 Sep 2022 00:25:11 +0000 (02:25 +0200)
committerJan Palus <atler@pld-linux.org>
Thu, 29 Sep 2022 00:25:11 +0000 (02:25 +0200)
fixed hash issue with mawk (see https://github.com/junegunn/fzf-git.sh/issues/17)

fzf-git-awk.patch [new file with mode: 0644]
fzf.spec

diff --git a/fzf-git-awk.patch b/fzf-git-awk.patch
new file mode 100644 (file)
index 0000000..213ba37
--- /dev/null
@@ -0,0 +1,11 @@
+--- fzf-git.sh.orig    2022-09-06 04:47:02.000000000 +0200
++++ fzf-git.sh 2022-09-29 02:21:14.222705635 +0200
+@@ -180,7 +180,7 @@
+     --bind 'ctrl-d:execute:grep -o "[a-f0-9]\{7,\}" <<< {} | head -n 1 | xargs git diff > /dev/tty' \
+     --color hl:underline,hl+:underline \
+     --preview 'grep -o "[a-f0-9]\{7,\}" <<< {} | head -n 1 | xargs git show --color=always' "$@" |
+-  awk 'match($0, /[a-f0-9]{7,}/) { print substr($0, RSTART, RLENGTH) }'
++  awk 'match($0, /[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]*/) { print substr($0, RSTART, RLENGTH) }'
+ }
+ _fzf_git_remotes() {
index b5dd3d1982de43689812c5a4cc853270af6ad21b..5e2f2514aa48414d245433102382d4f386c61eab 100644 (file)
--- a/fzf.spec
+++ b/fzf.spec
@@ -3,6 +3,7 @@
 
 %define                fzfrev          04d0b02
 %define                fzfvimrev       9ceac71
+%define                fzfgitrev       a48b941
 %define                vendor_version  0.34.0
 
 Summary:       A command-line fuzzy finder written in Go
@@ -22,6 +23,9 @@ Source1:      %{name}-vendor-%{vendor_version}.tar.xz
 # Source1-md5: cd1672b3da7985ddc0709862274a007f
 Source2:       https://github.com/junegunn/fzf.vim/archive/%{fzfvimrev}/fzf.vim-%{fzfvimrev}.tar.gz
 # Source2-md5: cf33165a5e500c85838fa994683b2e5d
+Source3:       https://github.com/junegunn/fzf-git.sh/archive/%{fzfgitrev}/fzf-git.sh-%{fzfgitrev}.tar.gz
+# Source3-md5: 672c3efba11c015c5d282562553eac07
+Patch0:                fzf-git-awk.patch
 URL:           https://github.com/junegunn/fzf
 BuildRequires: golang >= 1.13
 BuildRequires: rpm-build >= 4.6
@@ -71,6 +75,21 @@ BuildArch:   noarch
 %description -n zsh-completion-fzf
 zsh-completion for fzf.
 
+%package git-sh
+Summary:       bash and zsh key bindings for Git objects, powered by fzf
+Group:         Applications/Shells
+Requires:      %{name}-tmux
+Requires:      awk
+Requires:      coreutils
+Requires:      git-core
+Requires:      grep
+Requires:      sed
+Suggests:      xdg-utils
+BuildArch:     noarch
+
+%description git-sh
+bash and zsh key bindings for Git objects, powered by fzf.
+
 %package -n vim-plugin-fzf
 Summary:       fzf integration for Vim
 Group:         Applications/Editors/Vim
@@ -96,9 +115,13 @@ BuildArch:  noarch
 Documentation for fzf Vim plugin.
 
 %prep
-%setup -q -a1 -a2
+%setup -q -a1 -a2 -a3
 %{__mv} fzf-%{vendor_version}/vendor .
 %{__mv} fzf.vim-%{fzfvimrev}* fzf.vim
+%{__mv} fzf-git.sh-%{fzfgitrev}* fzf-git
+cd fzf-git
+%patch0
+cd ..
 %{__sed} -i -e "s@let s:bin_dir = .*@let s:bin_dir = '%{_datadir}/fzf/vim/bin/'@" fzf.vim/autoload/fzf/vim.vim
 %{__sed} -i -e '1s,.*env bash,#!/bin/bash,' fzf.vim/bin/preview.sh bin/fzf-tmux
 %{__sed} -i -e '1s,.*env perl,#!%{__perl},' fzf.vim/bin/tags.pl
@@ -121,6 +144,7 @@ cp -p shell/completion.bash $RPM_BUILD_ROOT%{_datadir}/fzf
 cp -p shell/key-bindings.bash $RPM_BUILD_ROOT%{_datadir}/fzf
 cp -p shell/completion.zsh $RPM_BUILD_ROOT%{_datadir}/fzf
 cp -p shell/key-bindings.zsh $RPM_BUILD_ROOT%{_datadir}/fzf
+cp -p fzf-git/fzf-git.sh $RPM_BUILD_ROOT%{_datadir}/fzf
 cp -rp fzf.vim/autoload/fzf $RPM_BUILD_ROOT%{_datadir}/vim/autoload
 cp -p plugin/fzf.vim $RPM_BUILD_ROOT%{_datadir}/vim/plugin/fzf.vim
 cp -p fzf.vim/plugin/fzf.vim $RPM_BUILD_ROOT%{_datadir}/vim/plugin/fzf/fzf.vim
@@ -157,6 +181,11 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/fzf/completion.zsh
 %{_datadir}/fzf/key-bindings.zsh
 
+%files git-sh
+%defattr(644,root,root,755)
+%doc fzf-git/README.md
+%{_datadir}/fzf/fzf-git.sh
+
 %files -n vim-plugin-fzf
 %defattr(644,root,root,755)
 %doc README-VIM.md fzf.vim/README.md
This page took 0.538245 seconds and 4 git commands to generate.