1 |
On Wed, 1 Feb 2012 15:05:40 -0500 |
2 |
Mike Frysinger <vapier@g.o> wrote: |
3 |
|
4 |
> # You have to specify the off_t size ... I have no idea how to |
5 |
> extract that # information out of the binary executable myself. |
6 |
> Basically you pass in # the size of the off_t type (in bytes) on the |
7 |
> machine that built the pdv # archive. |
8 |
|
9 |
Can't you use 'file' to determine the host type and just assume off_t |
10 |
for it? |
11 |
|
12 |
> # @FUNCTION: unpack_makeself |
13 |
> # @USAGE: [file to unpack] [offset] [tail|dd] |
14 |
> # @DESCRIPTION: |
15 |
> # Unpack those pesky makeself generated files ... |
16 |
> # They're shell scripts with the binary package tagged onto |
17 |
> # the end of the archive. Loki utilized the format as does |
18 |
> # many other game companies. |
19 |
> # |
20 |
> # If the file is not specified, then ${A} is used. If the |
21 |
> # offset is not specified then we will attempt to extract |
22 |
> # the proper offset from the script itself. |
23 |
|
24 |
The third argument is not explained. |
25 |
|
26 |
> unpack_makeself() { |
27 |
> local src_input=${1:-${A}} |
28 |
|
29 |
What if ${A} contains more than a single file? Well, what is this for |
30 |
anyway? |
31 |
|
32 |
> case ${exe} in |
33 |
> tail) exe="tail -n +${skip} '${src}'";; |
34 |
> dd) exe="dd ibs=${skip} skip=1 |
35 |
> if='${src}'";; *) die "makeself cant handle exe |
36 |
> '${exe}'" esac |
37 |
|
38 |
What is the use of that? |
39 |
|
40 |
> # @FUNCTION: unpacker |
41 |
|
42 |
Wrong name. |
43 |
|
44 |
> # @USAGE: [archives that we will unpack] |
45 |
> # @RETURN: Dependencies needed to unpack all the archives |
46 |
> # @DESCRIPTION: |
47 |
> # Walk all the specified files (defaults to $SRC_URI) and figure out |
48 |
> the # dependencies that are needed to unpack things. |
49 |
> # |
50 |
> # Note: USE flags are not yet handled. |
51 |
> unpacker_src_uri_depends() { |
52 |
> local uri deps d |
53 |
> |
54 |
> [[ $# -eq 0 ]] && set -- ${SRC_URI} |
55 |
> |
56 |
> for uri in "$@" ; do |
57 |
> case ${uri} in |
58 |
> *.rar|*.RAR) |
59 |
> d="app-arch/unrar" ;; |
60 |
> *.7z) |
61 |
> d="app-arch/p7zip" ;; |
62 |
|
63 |
Where are those file formats handled? You don't seem to fallback to |
64 |
'unpack' anywhere too. |
65 |
|
66 |
And I think you should consider using 'file --mime' rather than |
67 |
relying on format descriptions not ever changing/differing due to |
68 |
subtle differences. |
69 |
|
70 |
-- |
71 |
Best regards, |
72 |
Michał Górny |