views:

205

answers:

3

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 be 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.

+1  A: 

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.

Sinan Ünür
Hmm...Config.pm doesn't, but there is Config.pm~, which does. Odd, let me try chanigng that one.
Kev
Nope, unfortunately it didn't seem to affect it.
Kev
@Kev: `Config.pm~` is likely a leftover backup file. If you have a valid Perl installation, there **has** to be a `Config.pm` in the `lib` directory of that installation. Just like there has to be a valid `ppm.bat` file in the `bin` directory.
Sinan Ünür
Sorry, I was unclear. Config.pm exists, but it only contains references to the correct path, not the old one. The leftover backup file had references to the old one.
Kev
+1  A: 

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!

jimtut
Kev
A: 

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?

Kev
Except now PPM is complaining about missing 'user' area...
Kev
Solution: "ppm config gui.install_area site"
Kev
Fully working now.
Kev
Glad it's working for you! And I'm glad I found out about the "ppm config" command/option - I hadn't known/remembered that was there. Turns out the "ppm help" gives a bunch of things you can do from the command-line that can really help with stuff like this.
jimtut
Cool, thanks, glad it was helpful for you too.
Kev