WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Any way to automatically download .info files with extensions ?  (Read 3674 times)

Offline yoshi314

  • Full Member
  • ***
  • Posts: 135
Some packages have fairly lengthy instructions on how to set them up. Most of it is documented in the .info file which is only available from the app browser.

It would be nice to be able to install those files to some common location along with packages, for future reference. I know that i can do this by hand with a simple script, but automation of such tasks could be a life saver, especially when using tc offline.

The biggest problem i had was setting up web connection through mobile phone connected by bluetooth. Nearly every package in required chain of dependencies has its own setup instructions. None of which are available when you are offline.

That was a situation i was not prepared for, so i didn't download instructions in advance, i only had the necessary apps in ondemand.

Offline spence91

  • Jr. Member
  • **
  • Posts: 80
Re: Any way to automatically download .info files with extensions ?
« Reply #1 on: January 15, 2013, 10:22:17 AM »
Hi - you could probably do something like this to get your info files - This hasn't been tested BTW but I think it should work.
This will find each TCZ you have locally, and then attempt to get the .info file for it, and download it to the working directory.

Code: [Select]
cd $MNT$/tce/optional
find -iname '*tcz' -exec "wget http://tinycorelinux.net/4.x/x86/tcz/{}.info" \;


EDIT--

Sorry, got ahead of myself there. I've just realised you don't need a one liner.. You can probably edit the shell script which fetches the tcz to get the .info as well I imagine.
« Last Edit: January 15, 2013, 10:26:20 AM by spence91 »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11634
Re: Any way to automatically download .info files with extensions ?
« Reply #2 on: January 15, 2013, 10:46:33 AM »
Hi yoshi314
You could automate the process yourself by creating a script that intercepts the call to AppBrowser (or whatever it's
called these days). Place a script in  /usr/local/bin  called  appbrowser.
Code: [Select]
#!/bin/sh
exec /usr/bin/appbrowser
cd /etc/sysconfig/tcedir/optional
for i in `ls *.tcz`
do
    [ -e "$i.info" ] && continue
        tce-fetch.sh $i.info
done
This has not been tested either. It will start AppBrowser. Then when AppBrowser exits, it will go to your tce/optional
directory, scan for all .tcz files, if the info file for the .tcz is not present, it will fetch it. File names and locations are
based on TC4.1, yours may be slightly different.

@spence91: Doesn't the  find  command require that you give it a location to start searching in?
« Last Edit: January 15, 2013, 04:47:51 PM by Rich »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Any way to automatically download .info files with extensions ?
« Reply #3 on: January 15, 2013, 10:57:19 AM »
/opt/.tce_dir has not existed for a long time.

cd /etc/sysconfig/tcedir/optional

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11634
Re: Any way to automatically download .info files with extensions ?
« Reply #4 on: January 15, 2013, 11:01:49 AM »
Hi gerald_clark
Thanks, forgot about that. Example corrected.
« Last Edit: January 15, 2013, 04:52:07 PM by Rich »

Offline zerophnx

  • Newbie
  • *
  • Posts: 24
Re: Any way to automatically download .info files with extensions ?
« Reply #5 on: January 15, 2013, 04:27:35 PM »
Code: [Select]
#!/bin/sh
exec /usr/bin/appbrowser
cd /etc/sysconfig/tcedir/optional
for i in `ls *.tcz`
do
    [ -e "$i.tcz.info" ] && continue
        tce-fetch.sh $i.tcz.info
done

I got Rich's suggestion to work by changing "$i.tcz.info" to "$i.info". It looks like ls is already returning the filename with the .tcz extension.  This will be very helpful!

Thanks for the scripts :D

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11634
Re: Any way to automatically download .info files with extensions ?
« Reply #6 on: January 15, 2013, 04:51:48 PM »
Hi zerophnx
You are right,  i  already contains the  .tcz  part of the file name. Example corrected, again.