Re: Check flat package type
Re: Check flat package type
- Subject: Re: Check flat package type
- From: Stephane Sudre <email@hidden>
- Date: Thu, 19 Nov 2015 11:35:20 +0100
AFAIK, since the .pkg flat files are xar archive and a "Product
archive" (i.e. a distribution) contains a Distribution file at the
first level of the archives, you can just invoke:
xar -t -f thisMysteriousThing.pkg
and look for a Distribution file.
e.g.
#!/bin/sh
isThereADistributionFile=`/usr/bin/xar -t -f "$1" | grep Distribution`
if [ ! -z "$isThereADistributionFile" ]; then
echo "It's a trap... ahem, it's a Product archive"
else
echo "It's a component package"
fi
exit 0
On Thu, Nov 19, 2015 at 7:10 AM, Erik Berglund <email@hidden> wrote:
> Hi.
>
> I'm searching for a way to determine the type of a given flat package.
>
> I need to figure out if the package is a "component package" or a "product
> archive".
>
> I've looked at the different pkg-tools I know of to find a flag or
> information flag to get this info but haven't found one yet. So, I'm asking
> here if anybody knows a reliable way to determine this.
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Installer-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
--
Packaging Resources - http://s.sudre.free.fr/Packaging.html
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden