You are not logged in.

#26 2007-07-24 20:44:31

Xentac
Forum Fellow
From: Victoria, BC
Registered: 2003-01-17
Posts: 1,797
Website

Re: Improving namcap

I didn't know who to give attribution to, so I made all the patches by Jesse, but I added both people as authors.

Check out git.  I've changed the way pacman.py works (I like it a *lot* better), so I had to modify most of these patches somewhat.  I'm trying to use a lot less regular expressions because they're error prone and annoying.  Feel free to start creating patches in git and using git-format-patch to send them to me or set up your own git repo (repo.or.cz is one place you can just host them).

I don't read the forum much, but Dusty pointed this out to me.


I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal

Offline

#27 2007-07-24 20:49:26

Xentac
Forum Fellow
From: Victoria, BC
Registered: 2003-01-17
Posts: 1,797
Website

Re: Improving namcap

Lone_Wolf wrote:
PenguinFlavored wrote:

@STiAT
So you're saying scripting languages don't get detected as a dependency? After briefly looking at Namcap/depends.py it looks like it looks at the hashbang line and ruby/perl/bash/etc. Is this functionality not working? Can you provide an example PKGBUILD?

I recently encountered the same problem with the python package singularity : http://aur.archlinux.org/packages.php?d … s=0&SeB=nd

It depends on python and python-pygame , but namcap claims those are not needed.

i can understand that python-pygame may be hard to test for, but python should be detected as a necessary dep.

Hmmm, namcap should be triggering off of the singularity.py #!... let me see about fixing that...

It looks like my depends.py logic is wrong there.  It tries to use readelf to find the deps.  It needs to detect that some files aren't even elf files and then check for script #!s.  I'll try to write a patch for this later tonight or maybe someone else will.


I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal

Offline

#28 2007-07-24 21:06:20

PenguinFlavored
Member
From: Chicago, IL, USA
Registered: 2006-06-06
Posts: 66
Website

Re: Improving namcap

Xentac wrote:

Hmmm, namcap should be triggering off of the singularity.py #!... let me see about fixing that...

It looks like my depends.py logic is wrong there.  It tries to use readelf to find the deps.  It needs to detect that some files aren't even elf files and then check for script #!s.  I'll try to write a patch for this later tonight or maybe someone else will.

namcap reads the readelf output using var[1]. However this is an empty array var[2] contains the output of the pipe. So in depends.py

for j in var[1].readlines():

should be

for j in var[2].readlines():

simple.

what do you suggest for finding dependencies such as python-pygame or pygtk, etc. That are found in scripts. Is there a tool out there that does this already? Or should we look at the import lines and try to map that to a python lib?

@DaNiMoTh
Can you put your patch back up to see what code you contributed? I remember that you wrote some code in pacman.py and the varorder.py but people didn't like that.

Offline

#29 2007-07-24 21:20:21

Xentac
Forum Fellow
From: Victoria, BC
Registered: 2003-01-17
Posts: 1,797
Website

Re: Improving namcap

It's not the readelf part.  Check the logic.

[jchu@wingnut ~]$ readelf -d /usr/bin/namcap
readelf: Error: Unable to read in 0x6567 bytes of section headers
readelf: Error: Not an ELF file - it has the wrong magic bytes at the start

walkfunc steps over all those lines and tries to open the file we're readelf'ing...?  The code is just wrong, that else should be outside the for and be using a different condition...

I don't know a good way to find the dependencies.  It used to be a simple search in /usr/lib/python2.4/site-packages, but now with setuptools, etc things are a lot more complicated.  I really don't want to actually run/import the program but I don't know of a foolproof way of detecting dependencies.


I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal

Offline

#30 2007-07-25 09:57:51

DaNiMoTh
Member
Registered: 2006-06-10
Posts: 260

Re: Improving namcap

@Penguin
I lost my original patch sad
I remember that I've added support for arch and license variable.

I'm proud to have begun this work, with the initial patch. But I see that I'm very busy with my other works ( some packages in community, ALSW.. ), and you are much skilled than me with python big_smile
So, from now I'll only test namcap sad

Offline

Board footer

Powered by FluxBB