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 04-02-2004, 04:12 AM   #1
sneezesnoeze
LQ Newbie
 
Registered: Mar 2004
Posts: 15

Rep: Reputation: 0
rpm only unpacking ?


Hi

I am just reading http://www.rpm.org/max-rpm/s1-rpm-inside-macros.html

cd /usr/src/redhat/BUILD
rm -rf cdplayer-1.0
gzip -dc /usr/src/redhat/SOURCES/cdplayer-1.0.tgz | tar -xvvf -
if [ $? -ne 0 ]; then
exit $?
fi
cd cdplayer-1.0
cd /usr/src/redhat/BUILD/cdplayer-1.0
chown -R root.root .
chmod -R a+rX,g-w,o-w .

I have a few questions.

Why is the package unpacked twice : gzip and tar ?

When I look in all the examples there, it looks to me like that only unpacking is done. Where does the the copying of files in installdir happen?

Sneeze

Last edited by sneezesnoeze; 04-02-2004 at 04:13 AM.
 
Old 04-02-2004, 04:18 AM   #2
Lazarus
Member
 
Registered: Dec 2001
Location: Kent in UK
Distribution: Fedora 2
Posts: 170

Rep: Reputation: 30
tar collects files into an archive. gzip is a compressor. Often files are put in an archive and then comressed. Tar will do this for you if you use the z option. Compressed (gzipped) archives often end in .tar.gz or .taz
To unpack a compressed archive use tar -zxf filename
 
Old 04-02-2004, 04:34 AM   #3
sneezesnoeze
LQ Newbie
 
Registered: Mar 2004
Posts: 15

Original Poster
Rep: Reputation: 0
Why to use these in one line ?

Sneeze
 
Old 04-02-2004, 04:38 AM   #4
Disruptor
LQ Newbie
 
Registered: Jul 2003
Location: Hellas - Crete - Heraklion
Distribution: Red Hat 9
Posts: 24

Rep: Reputation: 15
A small note

.zip files are kinda tar'ed and gzip'ed in the same time. With gzip, tar has to be used first to collate the files
in one. Then gzip is used to compress the resulting archive.

Cheers
 
Old 04-02-2004, 04:43 AM   #5
sneezesnoeze
LQ Newbie
 
Registered: Mar 2004
Posts: 15

Original Poster
Rep: Reputation: 0
Are these line executed form right to left ?

First tar and then Gzip ?

Why to compress at this stage of the rpm ?
 
Old 04-02-2004, 06:44 AM   #6
sneezesnoeze
LQ Newbie
 
Registered: Mar 2004
Posts: 15

Original Poster
Rep: Reputation: 0
Ok I'm sorry those are stupid questions but lazarus are you saying that

gzip -dc /usr/src/redhat/SOURCES/cdplayer-1.0.tgz | tar -xvvf -

is the same as

tar -zxf filename

?

Kind Regards

Sneeze
 
Old 04-02-2004, 10:28 AM   #7
Lazarus
Member
 
Registered: Dec 2001
Location: Kent in UK
Distribution: Fedora 2
Posts: 170

Rep: Reputation: 30
I think so. In your example the output from gzip is piped straight into tar.
Much of the stuff for download is compressed, usualy but but not always with gzip for linux or winzip for windoze. If you run tar -zxf xxx and look at what processes are running you will see tar and gzip. I never call gzip explicitly when using tar
 
  


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
unpacking .tar.gz files crazibri Linux - Newbie 5 03-24-2004 03:19 AM
unpacking / new kernel cloeser Linux - General 2 08-30-2003 10:38 AM
After unpacking a RPM where does it go? Umbrella Linux - Software 3 08-01-2003 11:08 PM
error unpacking rpm.bin rose_bud4201 Linux - Software 6 04-02-2003 02:22 AM
Unpacking files OneDragonWon Linux - Newbie 5 02-22-2003 01:53 AM


All times are GMT -5. The time now is 01:40 PM.

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