WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: tce-size should also report size of extensions with no dependencies  (Read 2238 times)

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 266
Hi,

I just noticed that tce-size will not display the size of an extension if it doesn't have any dependencies.

The script does all the hard stuff but misses the simple case.

I think the script exits early when it cannot download "$app".tree and a .tree file only exists if the extension has dependencies.

For my purposes, I can just grab the extension size from sizelist, but it would have been nice to use a standard script especially when it handles dependencies so nicely.  :)

Code: [Select]
tc@piCorePlayer3:/usr/bin$ tce-size nano.tcz
  file.tcz                                     266240,   0.25 MB
  nano.tcz                                     139264,   0.13 MB
  ncurses.tcz                                  192512,   0.18 MB

  Total size (bytes)                           598016,   0.57 MB
+ Indicates need to download                        0,   0.00 MB

tc@piCorePlayer3:/usr/bin$ tce-size file.tcz
wget: server returned error: HTTP/1.1 404 Not Found

tc@piCorePlayer3:/usr/bin$ tce-size ncurses.tcz
wget: server returned error: HTTP/1.1 404 Not Found

regards
Greg

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 9997
Re: tce-size should also report size of extensions with no dependencies
« Reply #1 on: April 11, 2015, 02:06:06 AM »
Would you like to provide a patch?
The only barriers that can stop you are the ones you create yourself.

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 266
Re: tce-size should also report size of extensions with no dependencies
« Reply #2 on: April 11, 2015, 03:48:39 PM »
Would you like to provide a patch?

hi curaga,

Here is my attempt at a patch.

Code: [Select]
$ diff tce-size-orig tce-size
--- tce-size-orig
+++ tce-size
@@ -59,7 +59,7 @@
                touch sizelist
        fi
    fi
-   tce-fetch.sh "$app".tree || exit 1
+   tce-fetch.sh "$app".tree >/dev/null 2>&1 || echo "$app" > "$app".tree

    totalsize_needed=0
    totalsize_installed=0

Tested on:

CLI - 3.18.9-piCore+
GUI - 3.8.13-tinycore

Code: [Select]
tc@piCorePlayer3:/usr/bin$ uname -r
3.18.9-piCore+
tc@piCorePlayer3:/usr/bin$ tce-size nano.tcz
  file.tcz                                     266240,   0.25 MB
  nano.tcz                                     102400,   0.10 MB
  ncurses.tcz                                  192512,   0.18 MB

  Total size (bytes)                           561152,   0.54 MB
+ Indicates need to download                        0,   0.00 MB
tc@piCorePlayer3:/usr/bin$ tce-size file.tcz
  file.tcz                                     266240,   0.25 MB

  Total size (bytes)                           266240,   0.25 MB
+ Indicates need to download                        0,   0.00 MB
tc@piCorePlayer3:/usr/bin$ tce-size ncurses.tcz
  ncurses.tcz                                  192512,   0.18 MB

  Total size (bytes)                           192512,   0.18 MB
+ Indicates need to download                        0,   0.00 MB


regards
Greg

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 9997
Re: tce-size should also report size of extensions with no dependencies
« Reply #3 on: April 12, 2015, 12:57:13 AM »
Applied, thanks. In the future please post patches to a downloadable service, like pastebin or patches.tinycorelinux.net - copy-pasting can break them.
The only barriers that can stop you are the ones you create yourself.