- patches master
authorMarcin Krol <hawk@tld-linux.org>
Sun, 27 Feb 2022 00:28:30 +0000 (01:28 +0100)
committerMarcin Krol <hawk@tld-linux.org>
Sun, 27 Feb 2022 00:28:30 +0000 (01:28 +0100)
bash-completion-ip_addresses.patch [new file with mode: 0644]
bash-completion-no_mtr.patch [new file with mode: 0644]
bash-completion-rpm-cache.patch
bash-completion.spec
builder.bash-completion

diff --git a/bash-completion-ip_addresses.patch b/bash-completion-ip_addresses.patch
new file mode 100644 (file)
index 0000000..720be3b
--- /dev/null
@@ -0,0 +1,18 @@
+--- bash-completion-2.11/bash_completion.orig  2021-03-06 22:21:09.007031994 +0100
++++ bash-completion-2.11/bash_completion       2021-03-06 22:24:28.382618551 +0100
+@@ -981,11 +981,10 @@ _ip_addresses()
+         *) n= ;;
+     esac
+     local PATH=$PATH:/sbin
+-    local addrs=$({
+-        LC_ALL=C ifconfig -a || ip addr show
+-    } 2>/dev/null |
+-        command sed -e 's/[[:space:]]addr:/ /' -ne \
+-            "s|.*inet${n}[[:space:]]\{1,\}\([^[:space:]/]*\).*|\1|p")
++    local addrs=$(
++        LC_ALL=C ip -o addr show \
++    2>/dev/null | \
++      command awk '{ gsub(/\/.*$/, "", $4); print $4 }' | sort)
+     COMPREPLY+=($(compgen -W "$addrs" -- "${cur-}"))
+ }
diff --git a/bash-completion-no_mtr.patch b/bash-completion-no_mtr.patch
new file mode 100644 (file)
index 0000000..174a16a
--- /dev/null
@@ -0,0 +1,11 @@
+--- bash-completion-2.11/bash_completion.orig  2021-03-06 22:24:43.862534689 +0100
++++ bash-completion-2.11/bash_completion       2021-03-07 06:44:50.513308049 +0100
+@@ -1801,7 +1801,7 @@ _known_hosts_real()
+ } # _known_hosts_real()
+ complete -F _known_hosts traceroute traceroute6 \
+-    fping fping6 telnet rsh rlogin ftp dig mtr ssh-installkeys showmount
++    fping fping6 telnet rsh rlogin ftp dig ssh-installkeys showmount
+ # This meta-cd function observes the CDPATH variable, so that cd additionally
+ # completes on directories under those specified in CDPATH.
index 9c9d4014e2203267c5a603b1c2bde00cd9d1e8b7..965b938d4ebd217c43987575d720318a6d972cc1 100644 (file)
@@ -1,22 +1,24 @@
-Support rpm (jbj rpm 4.4.7+) hrmib exports for rpm -qa filter (via %_hrmib_path /var/cache/hrmib)
-
-Not accepted upstream.
-
---
-Signed-off-by: Elan Ruusamäe <glen@delfi.ee>
-
---- bash-completion-2.0/completions/rpm.orig   2012-01-07 23:44:41.000000000 +0100
-+++ bash-completion-2.0/completions/rpm        2012-07-28 07:21:12.033708931 +0200
-@@ -4,6 +4,12 @@
+--- bash-completion-2.11/completions/rpm.orig  2020-07-25 13:49:49.000000000 +0200
++++ bash-completion-2.11/completions/rpm       2021-11-17 00:01:41.257388895 +0100
+@@ -5,17 +5,16 @@
  _rpm_installed_packages()
  {
-+    # if rpm (4.4.7+) is configured to export it's rpmdb to /var/cache/hrmib (%_hrmib_path)
-+    if [ -d /var/cache/hrmib -a -r /var/cache/hrmib ]; then
-+        COMPREPLY=( $( LC_ALL=C command ls -1 /var/cache/hrmib | sed -ne '/^'$cur'/p') )
-+        return
-+    fi
-+
      if [[ -r /var/log/rpmpkgs && \
-         /var/log/rpmpkgs -nt /var/lib/rpm/Packages ]]; then
-         # using RHL 7.2 or later - this is quicker than querying the DB
+-        /var/log/rpmpkgs -nt /var/lib/rpm/Packages ]]; then
+-        # using RHL 7.2 or later - this is quicker than querying the DB
+-        COMPREPLY=($(compgen -W "$(command sed -ne \
+-            's|^\([^[:space:]]\{1,\}\)-[^[:space:]-]\{1,\}-[^[:space:]-]\{1,\}\.rpm$|\1|p' \
++        /var/log/rpmpkgs -nt /var/lib/rpm/rpmdb.sqlite ]]; then
++        # simple list generated by 'rpm -qa' command
++        COMPREPLY=($(compgen -W "$(command cat -ne \
+             /var/log/rpmpkgs)" -- "$cur"))
+     elif type rpmqpack &>/dev/null; then
+         # SUSE's rpmqpack is faster than rpm -qa
+         COMPREPLY=($(compgen -W '$(rpmqpack)' -- "$cur"))
+     else
+         COMPREPLY=($(${1:-rpm} -qa --nodigest --nosignature \
+-            --queryformat='%{NAME} ' "$cur*" 2>/dev/null))
++            --queryformat='%{NAME}-%{VERSION}-%{RELEASE}\n' 2>/dev/null | while read x ; do [[ "$x" == "$cur"* ]] && echo $x ; done))
+     fi
+ }
index 5ba1c44d6c00ca773cde4db77b58940889a3d630..536974a1f7a31af8ae98e7cbc98b77aa5c2ac5e0 100644 (file)
@@ -5,24 +5,27 @@
 Summary:       bash-completion offers programmable completion for bash
 Summary(pl.UTF-8):     Programowalne uzupełnianie nazw dla basha
 Name:          bash-completion
-Version:       2.1
-Release:       5
+Version:       2.11
+Release:       2
 Epoch:         1
 License:       GPL v2+
 Group:         Applications/Shells
-Source0:       http://bash-completion.alioth.debian.org/files/%{name}-%{version}.tar.bz2
-# Source0-md5: 4e2a9f11a4042a38ee79ddcd048e8b9e
+#Source0Download: https://github.com/scop/bash-completion/releases
+Source0:       https://github.com/scop/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz
+# Source0-md5: 2514c6772d0de6254758b98c53f91861
 Source1:       %{name}-poldek.sh
 # https://bugs.launchpad.net/ubuntu/+source/mysql-dfsg-5.0/+bug/106975
 Source3:       http://launchpadlibrarian.net/19164189/mysqldump
 # Source3-md5: 09e4885be92e032400ed702f39925d85
-Source4:       pear
+Source4:       http://svn.php.net/viewvc/pear2/sandbox/PEAR_BashCompletion/trunk/pear?revision=285425&view=co?/pear
 # Source4-md5: 8ce77e4459e2c45e2096da8d03c8f43d
 Patch0:                %{name}-rpm-cache.patch
 Patch1:                pear.patch
-URL:           http://bash-completion.alioth.debian.org/
+Patch2:                %{name}-ip_addresses.patch
+Patch3:                %{name}-no_mtr.patch
+URL:           https://github.com/scop/bash-completion
 BuildRequires: sed >= 4.0
-Requires(triggerpostun):       sed >= 4.0
+Requires(post):        sed >= 4.0
 Requires:      bash >= 4.1
 Requires:      issue >= 2013.01
 Obsoletes:     bash-completion-rpm-cache
@@ -39,11 +42,26 @@ bash-completion jest kolekcją funkcji shella, które opierają się na
 wbudowanych rozszerzeniach basha 4.1 lub późniejszego umożliwiającego
 dopełnianie parametrów linii poleceń.
 
+%package devel
+Summary:       Development files for bash-completion
+Summary(pl.UTF-8):     Pliki programistyczne do pakietu bash-completion
+Group:         Development/Tools
+# doesn't require base: it just contain paths configuration
+Conflicts:     bash-completion < 1:2.11
+
+%description devel
+pkg-config and cmake files for bash-completion packages development.
+
+%description devel -l pl.UTF-8
+Pliki pkg-configa i cmake'a do tworzenia pakietów bash-completion.
+
 %prep
 %setup -q
 cp -p '%{SOURCE4}' completions/pear
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
+%patch3 -p1
 
 # cleanup backups after patching
 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
@@ -68,20 +86,15 @@ cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/%{name}/completions/poldek
 cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_datadir}/%{name}/completions/mysqldump
 cp -p completions/pear $RPM_BUILD_ROOT%{_datadir}/%{name}/completions
 
-# util-linux
-%{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/completions/{cal,chsh,dmesg,eject,hexdump,hwclock,ionice,look,newgrp,renice,rtcwake,su}
 # No package matches '*/apache2ctl'
 %{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/completions/apache2ctl
-# No TLD package or no such binary to complete on
+# No PLD package or no such binary to complete on
 %{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/completions/{larch,lisp,monodevelop,[pg]4,cowsay,cowthink,cpan2dist}
 %{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/completions/{mkinitrd,rpmcheck}
 # FreeBSD stuff
 %{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/completions/{kldload,portupgrade}
 # Debian stuff
-%{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/completions/{apt-build,dselect,reportbug,alternatives,update-alternatives,lintian,lintian-info}
-# NetworkManager stuff
-%{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/completions/nmcli
-
+%{__rm} $RPM_BUILD_ROOT%{_datadir}/%{name}/completions/{apt-build,bts,dselect,reportbug,alternatives,update-alternatives,lintian,lintian-info}
 
 # do not generate autodeps
 chmod a-x $RPM_BUILD_ROOT%{_datadir}/%{name}/helpers/perl
@@ -94,7 +107,7 @@ sed -i -e '/^# START bash completion/,/^# END bash completion/d' /etc/bashrc
 
 %files
 %defattr(644,root,root,755)
-%doc AUTHORS CHANGES README
+%doc AUTHORS CHANGES README.md
 /etc/shrc.d/bash_completion.sh
 %dir %{_sysconfdir}/bash_completion.d
 %dir %{_datadir}/%{name}
@@ -103,4 +116,9 @@ sed -i -e '/^# START bash completion/,/^# END bash completion/d' /etc/bashrc
 %{_datadir}/%{name}/completions/*
 %dir %{_datadir}/%{name}/helpers
 %attr(755,root,root) %{_datadir}/%{name}/helpers/perl
+%attr(755,root,root) %{_datadir}/%{name}/helpers/python
+
+%files devel
+%defattr(644,root,root,755)
 %{_npkgconfigdir}/bash-completion.pc
+%{_datadir}/cmake/bash-completion
index 623683f83aba7a99845b18efa2e76e8eb56c8cb1..0b081c8d960d8741494c83103cfbbf196c64b3c0 100644 (file)
@@ -1,4 +1,4 @@
-# TLD Linux builder(1) script completion
+# PLD Linux builder(1) script completion
 
 # get active spec file from commandline
 # caller should make $spec local variable