[p4] Using current directory as client root?

Jeff A. Bowles jab at pobox.com
Wed Jan 16 18:28:10 PST 2008


Way-back-when, I remember (on Unix) doing something like this:
   /somewhere/p4-buildroot was the directory where files were retrieved to.
It was the "Root:" of the client spec.

But...

   It was really a symlink to /somewhere/p4-buildroot.97, created by the
build-script immediately before the 'sync'.
   It was populated (I believe) with a 'p4 sync -f'.

   The next build would create /somewhere/p4-buildroot.98 and symlink THAT
to /somewhere/p4-buildroot.

   So, by definition, /somewhere/p4-buildroot was the most recent build that
just happened and the previous few nights could be found
in /somewhere/p4-buildroot.{98,97,96,etc}

   For disk-space reasons, I believe that the script would
remove /somewhere/p4-buildroot.88 when it created /somewhere/p4-buildroot.98
.

Worked nicely for a very long time.

Perhaps something like that would work?

----
Side-note: for my taste, no matter the solution, you should "p4 sync" as of
a specific changenum, date, or label. It is completely okay if you run "p4
changes -m1 -s submitted" to find out the changenum to "p4 sync" to, but it
gives you a bit of reproducible behavior. (You would run "p4 sync
//whatever/... at 91283" for tonight's build, for example.  Then log the exact
retrieval-command into /somewhere/p4-buildroot/retrieve.sh and put the
compile-logs into /somewhere/p4-buildroot/build.logs.)

   -Jeff Bowles


On Jan 16, 2008 11:58 AM, Roy Smith <smith_roy at emc.com> wrote:

> I have a requirement (as part of our build system) to be able to get
> a set of files from the repository and have them written to any
> arbitrary directory.  Because the root path is embedded in the client
> spec, there doesn't seem to be any way to do this.
>
> We've played with all sorts of hacks.  We can create a symlink from
> the root path embedded in the client to where we really want the
> files.  We can create and destroy temporary client specs on the fly.
> But all these seem like hacks.  Surely there must be some simple way
> to say, "just put the files HERE".
>
> We don't need the workspace to be managed by perforce.  We'll never
> want to edit the files there, or submit any changes from there.  We
> just want a read-only copy of the source tree so we can build it.
>
> -------------------
> Roy Smith <smith_roy at emc.com>
> Software Guy, EMC Common Management Group
> 44 South Broadway, 7th floor
> White Plains, NY 10601
> (914) 580-3427
> AIM: roysmith649
>
> _______________________________________________
> perforce-user mailing list  -  perforce-user at perforce.com
> http://maillist.perforce.com/mailman/listinfo/perforce-user
>



-- 
---
Jeff Bowles - jeff.a.bowles at gmail.com


More information about the perforce-user mailing list