LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   rpm only unpacking ? (https://www.linuxquestions.org/questions/linux-newbie-8/rpm-only-unpacking-165271/)

sneezesnoeze 04-02-2004 03:12 AM

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

Lazarus 04-02-2004 03:18 AM

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

sneezesnoeze 04-02-2004 03:34 AM

Why to use these in one line ?

Sneeze

Disruptor 04-02-2004 03:38 AM

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

sneezesnoeze 04-02-2004 03:43 AM

Are these line executed form right to left ?

First tar and then Gzip ?

Why to compress at this stage of the rpm ?

sneezesnoeze 04-02-2004 05:44 AM

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

Lazarus 04-02-2004 09:28 AM

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


All times are GMT -5. The time now is 07:54 PM.