Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

ppm rep describe

by QM (Parson)
on Oct 02, 2005 at 03:59 UTC ( #496714=perlquestion: print w/replies, xml ) Need Help??
QM has asked for the wisdom of the Perl Monks concerning the following question:

I was running my script at Re^2: Script to update your PPM Repositories on my home system (XP Pro), and noticed that:
my $rep_describe = `ppm rep describe $name`;
returns nothing, doesn't cause an error, etc. (at least, as far as I can tell). I looked at it in the debugger, like so:
.main::(C:\Perl\perl\ 36: my $rep_describe = `ppm rep describe $name`; DB<4> p $name ActiveState PPM2 Repository
(I had to change line 17 to invoke the debugger on the system call.)

This was working on my work machine (Win2K). On the other hand, the rest of the "ppm" calls seem to work, so I suspect something weird with XP-Pro, possibly the XP shell, and ppm3-bin (which is what ppm ultimately calls).

Any ideas?

My XP-Pro Perl install is:

C:\>perl -V Summary of my perl5 (revision 5 version 8 subversion 0) configuration: Platform: osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef usethreads=undef use5005threads=undef useithreads=define usemultip +licity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cl', ccflags ='-nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D +_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMP LICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX', optimize='-MD -Zi -DNDEBUG -O1', cppflags='-DWIN32' ccversion='', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64 +', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -l +ibpath:"C:\Perl\lib\CORE" -machine:x86' libpth="C:\Perl\lib\CORE" libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib + comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib ver +sion.lib odbc32.lib odbccp32.lib msvcrt.lib perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool +.lib comdlg32.lib advapi32.lib shell32.lib ole32. lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib + version.lib odbc32.lib odbccp32.lib msvcrt.lib libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib gnulibc_version='undef' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt: +ref,icf -libpath:"C:\Perl\lib\CORE" -machine:x86 ' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL +_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS Locally applied patches: ActivePerl Build 806 Built under MSWin32 Compiled at Mar 31 2003 00:45:44 @INC: c:/Perl/lib c:/Perl/site/lib .
I'll have to get the Win2K Perl details on Monday.

Quantum Mechanics: The dreams stuff is made of

Replies are listed 'Best First'.
Re: ppm rep describe
by randyk (Parson) on Oct 02, 2005 at 18:52 UTC
    I also find the same problem on XP. What you might try instead is accessing the information directly from PPM::UI:
    use strict; use warnings; use PPM::UI; my $name = q{ActiveState PPM2 Repository}; my $results = PPM::UI::repository_info($name); my $result = $results->{result}; print <<"END"; Name: $result->[0] Location: $result->[1] Type: $result->[2] END
      Thanks! That fixed it.

      I must have run out of steam, because I didn't think to look into how ppm3-bin was doing it.

      You gotta love the fact that PPM::UI doesn't seem to exist on CPAN, or the fact that the file on my local disk doesn't have POD. (Or did I miss something there too?)

      Quantum Mechanics: The dreams stuff is made of

        You didn't miss anything - the pod is minimal (non-existent :) for PPM::UI. There is a PPM package on CPAN, but this is only version 2, used in ActivePerl 6xx; the interface to version 3 of ppm, used in 8xx, has changed quite a bit.
Re: ppm rep describe
by planetscape (Chancellor) on Oct 02, 2005 at 09:33 UTC


    my $rep_describe = `ppm rep describe $name`;

    returns undef:

    .main::( 41: my $rep_describe = `ppm rep describe $name`; DB<1> x $name 0 'ActiveState PPM2 Repository' DB<2> x $rep_describe 0 undef

    Although if I type ppm rep describe ActiveState PPM2 Repository manually into a command prompt:

    Describing Active Repository 1: Name: ActiveState PPM2 Repository Location: +MServer Type: PPMServer 2.0

    Details of my WinXP Pro SP2 install:

    Otherwise, as you say, it seems to work just fine...


      Try something like
      # escape shell metachars, search around for something complete $name =~ s/([&"])/^$1/g; my $rep_describe = `ppm rep describe "$name"`;
      See when you use ``, you're subject to the shell (like the pod says).

      MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
      I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
      ** The third rule of perl club is a statement of fact: pod is sexy.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://496714]
Approved by Tanktalus
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2018-06-22 00:38 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (120 votes). Check out past polls.