[p4perl] integrating perforce with a build system.

Tony Smith tony at smee.org
Thu Feb 17 10:06:12 PST 2005


Hi Roger,

> I'm looking at integrating perforce with our in-house build scheduling
> system. Our build scripts are written in Perl and I've installed the P4
> win32 perl code and the test examples work. However I'm a newbie to
> perforce.
>
> Our internal build system creates a fresh set of sources every day timed
> for  midnight. To do this, the build scripts instruct the SCM system to
> download a clean set of sources into an empty directory (the sources
> include the build tools neccessary for building those sources). So
> essentially my problem is for a P4 client (in this case, in the form of the
> P4Perl)  to connect to a P4 server and synchronize a given "depot" to a
> given (empty) folder on the file system.  I looked at the P4Perl modules
> but I didn't see any code to hand to do this task. Is there an easy way of
> doing this in the perl API?

In Perforce, that's called 'syncing' your workspace with the depot. If you 
were using the Perforce command line client you'd run:

 p4 sync

or possibly

 p4 sync -f

to force the sync even if Perforce thinks you already have the files in 
question.

In P4Perl that becomes:

 $p4->Sync();

or

 $p4->Sync( "-f" );

Good luck with the integration!

Regards,

Tony



More information about the p4perl mailing list