From a4a4a2e1b6cd59dbfe150f67fc665ba226656b1c Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Mon, 8 Jun 2020 18:32:52 +0200 Subject: [PATCH] __fish_print_packages: Fix apt On my system this printed just "Description:" without any additional characters, so this awkward `sed` didn't match and produced *all packages on one line*. Tbh this should probably be rewritten, but first we'd have to find a way to get proper output here. --- share/functions/__fish_print_packages.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/functions/__fish_print_packages.fish b/share/functions/__fish_print_packages.fish index 07e7dfcc1..b0b26bb13 100644 --- a/share/functions/__fish_print_packages.fish +++ b/share/functions/__fish_print_packages.fish @@ -23,11 +23,11 @@ function __fish_print_packages # (It is safe to use `sed -r` here as we are guaranteed to be on a GNU platform # if apt-cache was found. Using unicode reserved range in `fish/tr` and the # little-endian bytecode equivalent in `sed`. Supports localization.) - apt-cache --no-generate show '.*'(commandline -ct)'.*' 2>/dev/null | sed -r '/^(Package|Description-[a-z]{2}):/!d;s/Package: (.*)/\1\t/g;s/Description-.*: (.*)/\1\xee\x80\x80\x0a/g' | tr -d \n | tr -s \uE000 \n | uniq + apt-cache --no-generate show '.*'(commandline -ct)'.*' 2>/dev/null | sed -r '/^(Package|Description-?[a-z]{0,2}):/!d;s/Package: (.*)/\1\t/g;s/Description-?[^:]*: (.*)/\1\xee\x80\x80\x0a/g' | tr -d \n | tr -s \uE000 \n | uniq return else set -l packages (dpkg --get-selections | string replace -fr '(\S+)\s+install' "\$1" | string match -e (commandline -ct)) - apt-cache --no-generate show $packages 2>/dev/null | sed -r '/^(Package|Description-[a-z]{2}):/!d;s/Package: (.*)/\1\t/g;s/Description-.*: (.*)/\1\xee\x80\x80\x0a/g' | tr -d \n | tr -s \uE000 \n | uniq + apt-cache --no-generate show $packages 2>/dev/null | sed -r '/^(Package|Description-?[a-z]{0,2}):/!d;s/Package: (.*)/\1\t/g;s/Description-?[^:]*: (.*)/\1\xee\x80\x80\x0a/g' | tr -d \n | tr -s \uE000 \n | uniq return end