LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-01-2010, 06:21 AM   #1
password636
Member
 
Registered: Jun 2006
Location: Beijing
Posts: 60

Rep: Reputation: 1
not enough hash marks of the -h option of the rpm command


Hi,

This seems a boring question, but I'm just curious. In the rpm manual,
Code:
-h, --hash
              Print 50 hash marks as the package archive is unpacked.  Use with -v|--verbose for a nicer display.
But actually, there're not enough hash marks when I'm installing a package. About 44 hash marks there...

Well, I just want to know where the `50 hash marks' are.
 
Old 08-01-2010, 07:08 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
On my Opensuse box only 43 hashes are printed out. By the way, looking at the source code of RPM, in the function printHash you can see this line of code:
Code:
rpmcliHashesTotal = (isatty (STDOUT_FILENO) ? 44 : 50);
this tells if the condition is true, the value is 44, otherwise 50. The condition is
Code:
isatty (STDOUT_FILENO)
which tests if the file descriptor of the standard output is connected to a terminal. Hence every time you install from a terminal or a virtual console the hashes displayed on the terminal are 44. Instead, if you redirect the output of the rpm command to a file the hashes will be 50. For example:
Code:
$ rpm --test -Uvh package.rpm > file
$ cat file
Preparing...                ##################################################
These are exactly 50. I cannot explain the reason of this behavior... maybe we should ask to the rpm developers!

Moreover, I will not investigate why on my system the hashes displayed on the terminal are 43! Anyway the source code could unlock the mystery as well..
 
1 members found this post helpful.
Old 08-01-2010, 07:16 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
Depends which "man page" you read.
The old 'man rpm' from 1995 was probably never edited.

http://www.nordugrid.org/documents/r...everybody.html
QUOTE :
" h - print progress bar with hash-marks "

( Doesn't matter, if it's 40 or 50.)

Other information, rpm-4.7.0, Changelog line 66816 : ( 1996 )
"take advantage of ARCHIVESIZE (if present) when displaying hash marks"

The code is in a source file as some math expression, I guess.
And in the resultant binary rpm, inside an object ?
..
 
Old 08-01-2010, 07:57 AM   #4
password636
Member
 
Registered: Jun 2006
Location: Beijing
Posts: 60

Original Poster
Rep: Reputation: 1
Wow. Thank you guys. Help me a lot!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
command to change md5 HASH mplike Linux - Newbie 1 06-30-2008 06:34 AM
rpm have --nodeps option with dpkg is such an option available deepclutch Debian 2 03-26-2006 10:49 PM
How can I get the rpm command and rpm build command on my Debian box? abefroman Debian 6 11-28-2005 01:38 PM
rpm -bp command not working says "-bp: unknown option" Niceman2005 Linux - Software 2 11-08-2004 02:36 AM


All times are GMT -5. The time now is 05:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration