public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: vapier@gentoo.org
Subject: Re: [gentoo-dev] unpacker.eclass
Date: Wed, 1 Feb 2012 21:30:16 +0100	[thread overview]
Message-ID: <20120201213016.3ffb6419@pomiocik.lan> (raw)
In-Reply-To: <201202011505.41142.vapier@gentoo.org>

[-- Attachment #1: Type: text/plain, Size: 2137 bytes --]

On Wed, 1 Feb 2012 15:05:40 -0500
Mike Frysinger <vapier@gentoo.org> wrote:

> # You have to specify the off_t size ... I have no idea how to
> extract that # information out of the binary executable myself.
> Basically you pass in # the size of the off_t type (in bytes) on the
> machine that built the pdv # archive.

Can't you use 'file' to determine the host type and just assume off_t
for it?

> # @FUNCTION: unpack_makeself
> # @USAGE: [file to unpack] [offset] [tail|dd]
> # @DESCRIPTION:
> # Unpack those pesky makeself generated files ...
> # They're shell scripts with the binary package tagged onto
> # the end of the archive.  Loki utilized the format as does
> # many other game companies.
> #
> # If the file is not specified, then ${A} is used.  If the
> # offset is not specified then we will attempt to extract
> # the proper offset from the script itself.

The third argument is not explained.

> unpack_makeself() {
> 	local src_input=${1:-${A}}

What if ${A} contains more than a single file? Well, what is this for
anyway?

> 	case ${exe} in
> 		tail)	exe="tail -n +${skip} '${src}'";;
> 		dd)		exe="dd ibs=${skip} skip=1
> if='${src}'";; *)		die "makeself cant handle exe
> '${exe}'" esac

What is the use of that?

> # @FUNCTION: unpacker

Wrong name.

> # @USAGE: [archives that we will unpack]
> # @RETURN: Dependencies needed to unpack all the archives
> # @DESCRIPTION:
> # Walk all the specified files (defaults to $SRC_URI) and figure out
> the # dependencies that are needed to unpack things.
> #
> # Note: USE flags are not yet handled.
> unpacker_src_uri_depends() {
> 	local uri deps d
> 
> 	[[ $# -eq 0 ]] && set -- ${SRC_URI}
> 
> 	for uri in "$@" ; do
> 		case ${uri} in
> 		*.rar|*.RAR)
> 			d="app-arch/unrar" ;;
> 		*.7z)
> 			d="app-arch/p7zip" ;;

Where are those file formats handled? You don't seem to fallback to
'unpack' anywhere too.

And I think you should consider using 'file --mime' rather than
relying on format descriptions not ever changing/differing due to
subtle differences.

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]

  reply	other threads:[~2012-02-01 20:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-01 20:05 [gentoo-dev] unpacker.eclass Mike Frysinger
2012-02-01 20:30 ` Michał Górny [this message]
2012-02-01 20:44   ` Mike Frysinger
2012-02-01 20:51     ` Michał Górny
2012-02-01 20:55       ` Mike Frysinger
2012-02-01 23:12         ` Michał Górny
2012-02-02  0:33           ` Mike Frysinger
2012-02-02  8:06             ` Michał Górny
2012-02-02 16:18               ` Mike Frysinger
2012-02-01 21:11 ` Alexandre Rostovtsev
2012-02-02 17:24 ` Mike Frysinger
2012-02-05  5:21 ` [gentoo-dev] unpacker.eclass and base.eclass integration Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120201213016.3ffb6419@pomiocik.lan \
    --to=mgorny@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=vapier@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox