script to check a binary package for architecture-independence

View: New views
10 Messages — Rating Filter:   Alert me  

script to check a binary package for architecture-independence

by Chris Brannon-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Here's a script to check the architecture-independence of a binary package.
It only checks to see whether or not a tarball contains files that start
with the ELF magic number, bytes 0x7f E L F.
Maybe someone will find it useful.

-- Chris


Re: script to check a binary package for architecture-independence

by Andrea Scarpino-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 02/11/2009, Chris Brannon <cmbrannon79@...> wrote:
> Here's a script to check the architecture-independence of a binary package.
> It only checks to see whether or not a tarball contains files that start
> with the ELF magic number, bytes 0x7f E L F.
> Maybe someone will find it useful.
Here, where? :)

--
Andrea `bash` Scarpino
Arch Linux Developer

Re: script to check a binary package for architecture-independence

by Gerardo Exequiel Pozzi-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Chris Brannon wrote:
> Here's a script to check the architecture-independence of a binary package.
> It only checks to see whether or not a tarball contains files that start
> with the ELF magic number, bytes 0x7f E L F.
> Maybe someone will find it useful.
>
> -- Chris
>
>  
Hello

There is no attach here.

[1] But only doing this check (ELF signature) is just a necessary
condition but not sufficient.
[2] Should also check the machine (sufficient), because there are
packages for example AVR and ARM that from point of view of -any are
"architecture-independence". (some "crazy" :P packages have SPARC ELFs)
[3] And also (I din't see the script, so i just suppose), you also need
to exactarc archives files (.a) and analize the content of each object
with [1] and [2]

Good Luck!

--
Gerardo Exequiel Pozzi ( djgera )
http://www.djgera.com.ar
KeyID: 0x1B8C330D
Key fingerprint = 0CAA D5D4 CD85 4434 A219  76ED 39AB 221B 1B8C 330D


Re: script to check a binary package for architecture-independence

by Chris Brannon-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Gerardo Exequiel Pozzi wrote:
> Hello
>
> There is no attach here.

The script is here: http://the-brannons.com/isanypkg
The attachment must have been scrubbed.  Plus, gmail doesn't give me copies of
mail that I send to the list.  Broken, broken gmail!

> [2] Should also check the machine (sufficient), because there are
> packages for example AVR and ARM that from point of view of -any are
> "architecture-independence". (some "crazy" :P packages have SPARC ELFs)
> [3] And also (I din't see the script, so i just suppose), you also need
> to exactarc archives files (.a) and analize the content of each object

Thanks so much for your insight!  Your guess was right; I forgot about
members of ar archives.

On second thought, I wonder if these sorts of checks should be done
within namcap?

-- Chris

Re: script to check a binary package for architecture-independence

by Pierre Schmitz-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Mon, 02 Nov 2009 08:34:51 -0600, Chris Brannon <cmbrannon79@...>
wrote:
> Gerardo Exequiel Pozzi wrote:
> On second thought, I wonder if these sorts of checks should be done
> within namcap?

Good idea. Maybe its best to file a feature request and attach you script
there.

--
Pierre Schmitz, https://users.archlinux.de/~pierre

Re: script to check a binary package for architecture-independence

by Firmicus@gmx.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Chris Brannon wrote:
> Here's a script to check the architecture-independence of a binary package.
> It only checks to see whether or not a tarball contains files that start
> with the ELF magic number, bytes 0x7f E L F.
> Maybe someone will find it useful.
>
> -- Chris
>
>  
Thanks Chris. However I think Gerardo has already written such a script,
and the result is available on this page:
http://wiki.archlinux.org/index.php/DeveloperWiki:Unimportant_Rebuild_List#Packages_that_can_be_converted_to_arch.3Dany
(which also includes community)

F

Re: script to check a binary package for architecture-independence

by Daenyth Blank :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Nov 2, 2009 at 09:48, Firmicus <Firmicus@...> wrote:
> Thanks Chris. However I think Gerardo has already written such a script,
I think he said he did it manually, or with a one-time bash hack

Re: script to check a binary package for architecture-independence

by Firmicus@gmx.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Daenyth Blank wrote:
> On Mon, Nov 2, 2009 at 09:48, Firmicus <Firmicus@...> wrote:
>  
>> Thanks Chris. However I think Gerardo has already written such a script,
>>    
> I think he said he did it manually, or with a one-time bash hack
>
>  
RIght, and I also wrote that the list on the wiki includes community,
which is simply wrong. Sorry! So, yes Chris, your contribution is more
than welcome!

F

Re: script to check a binary package for architecture-independence

by Thomas Bächler-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Chris Brannon schrieb:

> Gerardo Exequiel Pozzi wrote:
>> Hello
>>
>> There is no attach here.
>
> The script is here: http://the-brannons.com/isanypkg
> The attachment must have been scrubbed.  Plus, gmail doesn't give me copies of
> mail that I send to the list.  Broken, broken gmail!
>
>> [2] Should also check the machine (sufficient), because there are
>> packages for example AVR and ARM that from point of view of -any are
>> "architecture-independence". (some "crazy" :P packages have SPARC ELFs)
>> [3] And also (I din't see the script, so i just suppose), you also need
>> to exactarc archives files (.a) and analize the content of each object
>
> Thanks so much for your insight!  Your guess was right; I forgot about
> members of ar archives.
>
> On second thought, I wonder if these sorts of checks should be done
> within namcap?
They should. Two checks:
1) Is an arch=any package architecture-dependent -> error
2) Is an arch=whatever package architecture-independent -> warning

If you know python and have the time, you should write a patch against
namcap.git and mail it to Hugo. I told him once that it's a good
feature, no idea if he got to it. You can check namcap.git to see if he
did something, and check the bugtracker if there is a feature request
already.


Yay, I just looked at the script and it is in python already, so I guess
a patch for namcap is in order :)



signature.asc (269 bytes) Download Attachment

Re: script to check a binary package for architecture-independence

by Abhishek Dasgupta :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/11/2 Thomas Bächler <thomas@...>:

> Chris Brannon schrieb:
>> On second thought, I wonder if these sorts of checks should be done
>> within namcap?
>
> They should. Two checks:
> 1) Is an arch=any package architecture-dependent -> error
> 2) Is an arch=whatever package architecture-independent -> warning
>
> If you know python and have the time, you should write a patch against
> namcap.git and mail it to Hugo. I told him once that it's a good feature, no
> idea if he got to it. You can check namcap.git to see if he did something,
> and check the bugtracker if there is a feature request already.
>

It's not in namcap.git. You could look at elfflies.py - that already checks for
ELF files in the package. This would fit in neatly there.

Abhishek