Tiny Core Linux

General TC => General TC Talk => Topic started by: aus9 on February 14, 2013, 07:47:51 AM

Title: code to get your tcz folder
Post by: aus9 on February 14, 2013, 07:47:51 AM
Hi

I am a simple coder

this kind of works as I need to download a package (tce-load -w cups)
find out where that package is with
Code: [Select]
TCE1=`cat /etc/sysconfig/backup_device`
# now use
cp /mnt/$TCE1/optional/cups.tcz /tmp

is this acceptable?

I know what to do when its there, I am just looking for any gotchas

Title: Re: code to get your tcz folder
Post by: Lee on February 14, 2013, 08:58:28 AM
While the default is to have the backup stored in the tce directory, it is not a given that the backup device and tce directory will always be the same.

On recent releases of Core, use
Code: [Select]
cp /etc/sysconfig/tcedir/optional/cups.tcz /tmp

/etc/sysconfig/tcedir is a symbolic link to your actual tce directory, wherever that might be.
Title: Re: code to get your tcz folder
Post by: aus9 on February 14, 2013, 06:53:48 PM
excellent!

atm it now looks like
Code: [Select]
mkdir /tmp/cupsunpack

if [ ! -f /etc/sysconfig/tcedir/optional/cups.tcz ] ; then
tce-load -w cups
cp /etc/sysconfig/tcedir/optional/cups.tcz /tmp/cupsunpack
else cp /etc/sysconfig/tcedir/optional/cups.tcz /tmp/cupsunpack
fi

the unsquashing is done later and can be outside the if then