Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 38854 - lesspipe enchancments + cannot see some files with spaces
Summary: lesspipe enchancments + cannot see some files with spaces
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-20 15:39 UTC by Elan Ruusamäe
Modified: 2004-06-16 17:03 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elan Ruusamäe 2004-01-20 15:39:11 UTC
this one adds --changelog for 'viewing' rpm files (very convinient!)
and adds support for viewing contents of rar files

--- /usr/bin/lesspipe.sh~    2004-01-21 01:29:44.000000000 +0200
+++ /usr/bin/lesspipe.sh    2004-01-21 01:31:13.000000000 +0200
@@ -19,7 +19,8 @@
   *.z) gzip -dc $1  2>/dev/null ;;
   *.Z) gzip -dc $1  2>/dev/null ;;
   *.zip) unzip -l $1 2>/dev/null ;;
-  *.rpm) rpm -qilp "$1" 2>/dev/null ;;
+  *.rpm) rpm -qilp --changelog "$1" 2>/dev/null ;;
+  *.rar) unrar l "$1" 2>/dev/null ;;
   *.[1-9] | *.n | *.man)
     [ "$(file -L $1 | cut -d ' ' -f 2)" = "troff" -o \
     "$(file -L $1 | cut -d ' ' -f 2)" = "ASCII" ] &&


i see varying usage of $1, once quoted, once not, but imho all uses of $1 must be quoted otherwise you cannot see files with spaces.

# date |gzip  > 'hmm 123.gz'
# less hmm\ 123.gz
"hmm\ 123.gz" may be a binary file.  See it anyway?
# date |gzip  > 'hmm_123.gz'
# less hmm_123.gz
Wed Jan 21 01:34:07 EET 2004
hmm_123.gz (END)


and please, if you fix the quotes issue, post it to upstream too (wherever you got the original?) since i see this issue in too many distros ;(



Reproducible: Always
Steps to Reproduce:
Comment 1 Aron Griffis (RETIRED) gentoo-dev 2004-06-15 13:01:56 UTC
Fixed in less-382-r1, thanks!
Comment 2 Elan Ruusamäe 2004-06-15 16:04:35 UTC
nice!


me being impatient, synced portage and looked lesspipe.sh-r2, and I think this $F needs also quoting:

--
strings $F
--


also it happens with #!/bin/bash, that you get PIPE error when quiting from viewer:
--
line 41: 23247 Broken pipe             strings $F
--

to reproduce this, do less /bin/ls and hit 'q'

this could be silently overcome by sth like this:
--
trap 'exit 0' PIPE
--

ps: should i reopen bug or just add agriffis@gentoo.org to cc list to get back on this issue? or just posting comment is ok?
Comment 3 Aron Griffis (RETIRED) gentoo-dev 2004-06-16 17:03:36 UTC
Ok, I fixed those issues and bumped the revision of the ebuild to -r2 to push out the changes.  Thanks!