开发者

Where does the Perl Package Manager get its 'areas' data from on Win32?

开发者 https://www.devze.com 2022-12-08 09:15 出处:网络
I guess I didn\'t upgrade the right way, but for a while I was running two versions of Perl concurrently.Now I just have one, but every time I start PPM it recreates the Perl folder of one of the old

I guess I didn't upgrade the right way, but for a while I was running two versions of Perl concurrently. Now I just have one, but every time I start PPM it recreates the Perl folder of one of the old locations. I've set the active one to 开发者_如何学JAVAbe the current Perl folder, but because the old one is still present on the list (displayed when I go Edit->Preferences), it creates it every time. How do I get it to stop doing that? I looked through the Windows Registry but I don't think that's where the areas are tracked.

This is ActiveState Perl 5.10.1 build 1006 on Windows Server 2003.


My new guess is that ppm is looking in Config.pm (which is generated at install time) for the locations. Again, if you use the correct ppm, it will pick up the correct paths.


This could be way off topic, but I had to move our group's Perl install from one network drive/server (W:) to another (Z:). I had lots of problems with the PPM site stuff too (mostly because I wanted to change to a non-standard "user" area) so I wrote everything down (in case I every had to do it again).

Hopefully, some of this is useful to Kev, or any others looking at this.


1) Install the latest ActivePerl distribution. In this case, it was 5.8.8 build 820. I installed this into Z:\Software\Perl\5.8.8, with the intention that Z:\Software\Perl\site\lib would be the “user” area for installing Packages, instead of the default Z:\Software\Perl\5.8.8\site\lib.

2) Set the new Perl “bin” dir to be first on my PATH and open up a DOS prompt. Type “ppm area” and you should see the following areas:

┌────────────┬──────┬─────────────────────────────────┐
│ name       │ pkgs │ lib                             │
├────────────┼──────┼─────────────────────────────────┤
│ (Software) │  n/a │ Z:/Software/Perl/site/lib       │
│ perl       │    0 │ Z:/Software/Perl/5.8.8/lib      │
│ site*      │    0 │ Z:/Software/Perl/5.8.8/site/lib │
└────────────┴──────┴─────────────────────────────────┘

3) I needed to get “site” turned to “(site)” (read-only) and “(Software)” turned to the default, writable PPM Area. Also, I didn’t like the name “Software” (picked up from the beginning of the path on Z:, I assume), so I also wanted to rename it to “user”.

4) Run the full PPM GUI (type “ppm” in DOS) and set Software as the default Area (Edit -> Preferences) and install something easy (I usually pick MP3-Info).

5) Exit the GUI and run “ppm area” again to get:

┌──────────┬──────┬─────────────────────────────────┐
│ name     │ pkgs │ lib                             │
├──────────┼──────┼─────────────────────────────────┤
│ Software │    1 │ Z:/Software/Perl/site/lib       │
│ perl     │    0 │ Z:/Software/Perl/5.8.8/lib      │
│ site*    │    0 │ Z:/Software/Perl/5.8.8/site/lib │
└──────────┴──────┴─────────────────────────────────┘

6) For some reason, “ppm area” isn’t showing Software as the default Area, even though I did select it as the default inside PPM’s preference. Don’t worry about this yet.

7) Go to Z:\Software\Perl\site\lib\etc and rename the DB file to “ppm-user-area.db". Go to Z:\Software\Perl\5.8.8 and remove ALL write-permissions to the “site” folder and all sub-folders. Run “ppm area” again and you should see:

┌────────┬──────┬─────────────────────────────────┐
│ name   │ pkgs │ lib                             │
├────────┼──────┼─────────────────────────────────┤
│ user*  │    1 │ Z:/Software/Perl/site/lib       │
│ perl   │   42 │ Z:/Software/Perl/5.8.8/lib      │
│ (site) │    0 │ Z:/Software/Perl/5.8.8/site/lib │
└────────┴──────┴─────────────────────────────────┘

8) You should now be all set! You default PPM Area is “user” (Z:\Software\Perl\site\lib) and the “site” Area (Z:\Software\Perl\5.8.8\site\lib) is not writable (this is important because it’s not on Perl’s search path – if someone installed Packages in there, Perl wouldn’t be able to find them!).

I did have some problems getting PPM to recognize all the Packages intalled in the “perl” Area. It kept listing that Area as locked in the PPM GUI Preferences. Eventually, I deleted the PPM DB file in Z:\Software\Perl\5.8.8\etc and the PPM GUI could magically find everything!


Replace all references throughout .packlists (and possibly all other files under the Perl path as well), then delete the .db files in etc/ and site/etc, then run ppm to let it re-build the database based on the updated packlists.

So the answer is some combination of Config.pm, lib\Config_heavy.pl, lib\CORE\config.h, possibly other files, the .dbs, and the .packlists.

Although, who's to say if I had left the Windows Registry entries there too it wouldn't've found them?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号