Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove all but core from @INC #17

Open
xenoterracide opened this issue Jun 1, 2010 · 3 comments
Open

remove all but core from @INC #17

xenoterracide opened this issue Jun 1, 2010 · 3 comments

Comments

@xenoterracide
Copy link

the idea occurred to me to day that in order to stop prereqs from being generated based on what /I have/ installed perhaps there's a way to make what I have installed disappear when creating the pkgbuild by removing site and vendor from @inc

@juster
Copy link
Owner

juster commented Jun 2, 2010

Interesting idea but there's a problem. When Makefile.PL or Build.PL is run it is run inside a new perl process. We can't modify the sub perl process's @inc. This could also cause problems with modules you actually want loaded from site or vendor. Bare necessities that is.

@xenoterracide
Copy link
Author

yeah I thought that maybe it wouldn't work... I really only want it when generating pkgbuilds which doesn't seem to cause a problem when the modules aren't there. could we sed patch the *PL's? obviously I want the directories used in the real install. I'm just annoyed that my modules that I use can affect the depends of the final pkgbuild.

@juster
Copy link
Owner

juster commented Jun 2, 2010

Okay I'll reopen the issue as a feature request. A big problem is I don't have any code that runs the Makefile.PL. That is all done by CPANPLUS. To do what you are talking about, one would have to patch CPANPLUS.

I'd recommend trying it out manually first to see what happens. You wouldn't need a "sed patch" but you'd need to insert a line of code to filter out @inc like so:

BEGIN { @INC = grep { /core/ } @INC }

Note this only works with Archlinux which explicitly names the core module dir 'core_perl'. A more robust solution would use the Config module which lists the dirs specified when perl was compiled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants