DanMcInerney / LANs.py

Inject code and spy on wifi users
GNU General Public License v3.0
2.59k stars 494 forks source link

Don't assume apt-get is the package manager on the system #50

Open rpdelaney opened 9 years ago

rpdelaney commented 9 years ago

In module_check() you present the user with an opportunity to install missing modules via apt-get. However, there is no confirmation that apt-get is installed.

ddworken commented 9 years ago

Are you suggesting that we add automatic detection of OS to choose the correct package manager? Module check does warn that apt-get will be used to install the dependency.

DanMcInerney commented 9 years ago

All we need to do is remove the module checker and add a requirements.txt. I wrote this tool prior to learning about pip's requirements.txt. Should be an easy fix, I'll get to it sometime this week.

On Wed, Dec 24, 2014 at 8:39 AM, David Dworken notifications@github.com wrote:

Are you suggesting that we add automatic detection of OS to choose the correct package manager? Module check does warn that apt-get will be used to install the dependency.

— Reply to this email directly or view it on GitHub https://github.com/DanMcInerney/LANs.py/issues/50#issuecomment-68059221.

DanMcInerney commented 9 years ago

That should also fix the issue of the new nfqueue package not being backwards compatible although I haven't officially verified that myself yet. But either way we can set requirements.txt to specify the right version.

On Wed, Dec 24, 2014 at 9:03 AM, Dan McInerney dan.h.mcinerney@gmail.com wrote:

All we need to do is remove the module checker and add a requirements.txt. I wrote this tool prior to learning about pip's requirements.txt. Should be an easy fix, I'll get to it sometime this week.

On Wed, Dec 24, 2014 at 8:39 AM, David Dworken notifications@github.com wrote:

Are you suggesting that we add automatic detection of OS to choose the correct package manager? Module check does warn that apt-get will be used to install the dependency.

— Reply to this email directly or view it on GitHub https://github.com/DanMcInerney/LANs.py/issues/50#issuecomment-68059221 .

rpdelaney commented 9 years ago

Yep, pip is the way to go. In other cases, the type built-in is useful for checking if a package is installed before attempting to execute it.

DanMcInerney commented 9 years ago

I added a requirements.txt but nfqueue is still a little weird. So apparently pip sees that package as NetfilterQueue rather than nfqueue. It also struggles to install some dependencies of that python library like libnetfilter-queue* throwing some very ambiguous errors. Installing system-wide with apt-get or yum doesn't seem to have this problem. So I have all the normal libraries pip can install in requirements but I still have the hacky module_check() in there just for nfqueue. Sometime later I'll figure out how to make that nicer.