Subject: OS/X startup scripts

From: David Fetter <[email-masked]>
Date: Sun, 13 May 2007 14:15:26 -0700

Folks,

The attached tarball should be unpacked in contrib/startup-scripts,
and supplants PostgreSQL.darwin and StartupParameters.plist.darwin.
Thanks to Mark Cotner of Reflectr
<http://pgfoundry.org/projects/reflectr/> fame for this update :)

I haven't included the customary diffs.  This points me to some of the
many deficiencies of CVS, namely that I would need write access in
order to have it create a diff, and write access is boolean, which
means that I can't get write access only to the parts of the tree that
make sense for me to have write access to.

What say we consider using Git, which includes a CVS interface,
starting after 8.3 gets out the door?

Cheers,
David.
-- 
David Fetter <[email-masked]> http://fetter.org/
phone: +1 415 235 3778        AIM: dfetter666
                              Skype: davidfetter

Remember to vote!
Consider donating to PostgreSQL: http://www.postgresql.org/about/donate

---

From: Tom Lane <[email-masked]>
Date: Sun, 13 May 2007 18:49:39 -0400

David Fetter <[email-masked]> writes:
> order to have it create a diff,

Strange, it works fine for everyone else.

			regards, tom lane

---

From: Andrew Dunstan <[email-masked]>
Date: Sun, 13 May 2007 19:04:44 -0400

> Strange, it works fine for everyone else.

Especially if you have cvsutils installed (can be found in many places 
including fedora extras).

cheers

andrew

---

From: David Fetter <[email-masked]>
Date: Sun, 13 May 2007 18:18:26 -0700

On Sun, May 13, 2007 at 07:04:44PM -0400, Andrew Dunstan wrote:
> >>I haven't included the customary diffs.  This points me to some of
> >>the many deficiencies of CVS, namely that I would need write
> >>access in order to have it create a diff,
> >
> Especially if you have cvsutils installed (can be found in many
> places including fedora extras).

I didn't know about those, so I'll prepare a patch to the developer
and documenter docs that mentions this utility :)

Cheers,
D

Remember to vote!

---

From: Tom Lane <[email-masked]>
Date: Sun, 13 May 2007 21:51:53 -0400

> and documenter docs that mentions this utility :)

I dunno what cvsutils is, but I do know that plain old "cvs diff" works
fine whether you have commit privs or not.  Rather than preparing a
patch to our docs, perhaps you should spend some time reading the CVS
docs.

			regards, tom lane

---

From: David Fetter <[email-masked]>
Date: Sun, 13 May 2007 18:58:06 -0700

On Sun, May 13, 2007 at 09:51:53PM -0400, Tom Lane wrote:
> > I didn't know about those, so I'll prepare a patch to the
> > developer and documenter docs that mentions this utility :)
> 
> I dunno what cvsutils is, but I do know that plain old "cvs diff"
> works fine whether you have commit privs or not.  Rather than
> preparing a patch to our docs, perhaps you should spend some time
> reading the CVS docs.

cvs diff works just great until you want to add or remove a file
without write permissions to the CVS repository, i.e. when you've
checked out as anonymous.

Cheers,
David.

Remember to vote!

---

From: Mark Kirkwood <[email-masked]>
Date: Mon, 14 May 2007 15:31:40 +1200

> checked out as anonymous.

I usually saved an untouched version of the tree to compare against, so 
something like:

$ cvs diff -Nacr pgsql.orig pgsql

gives a complete patch including added/deleted files. It is a bit 
primitive, but is pretty easy to do!

Cheers

Mark

---

From: Neil Conway <[email-masked]>
Date: Mon, 14 May 2007 00:38:21 -0400

> checked out as anonymous.

Personally, I usually work against a checkout from a local mirror of the
CVS repository (which you can create via cvsup or rsync). With that
setup, "cvs add" and "cvs diff -N" work fine, since you can arrange for
write access to the local mirror.

(I'm always surprised to hear that anyone does a non-trivial amount of
work on Postgres without setting up a CVS mirror...)

-Neil

---

From: Gregory Stark <[email-masked]>
Date: Mon, 14 May 2007 10:44:22 +0100

> Strange, it works fine for everyone else.

If you have rsh/ssh access to a CVS repository then you do in fact need write
access just to generate diffs. It is one of the annoyances of CVS but it
doesn't really matter for Postgres where we use pserver anonymous access.

Personally I find CVS so terribly slow for large trees like Postgres that it's
essential to use rsync to maintain a local CVS repository. That makes 'cvs
diff' remarkably fast.

-- 
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com

---

From: Heikki Linnakangas <[email-masked]>
Date: Mon, 14 May 2007 10:52:45 +0100

> doesn't really matter for Postgres where we use pserver anonymous access.

You need write-access to add files, even on anonymouse server. We often 
get patches with new files as separate attachments because of that.

> essential to use rsync to maintain a local CVS repository. That makes 'cvs

Yeah, I've done that for a long time. It's by far the best way to work 
with CVS, "cvs add" works, and you can do diffs, checkouts etc. offline.

-- 
   Heikki Linnakangas

---

From: Gregory Stark <[email-masked]>
Date: Mon, 14 May 2007 12:36:14 +0100

"Heikki Linnakangas" <[email-masked]> writes:

> You need write-access to add files, even on anonymouse server. We often get
> patches with new files as separate attachments because of that.

Oh quite right. I had forgotten but that was the original reason I switched to
using rsync. The alternative is to manually edit the Entries files to list the
new files.

---

From: Andrew Dunstan <[email-masked]>
Date: Mon, 14 May 2007 08:04:22 -0400

Heikki Linnakangas wrote:
>
> You need write-access to add files, even on anonymouse server. We 
> often get patches with new files as separate attachments because of that.
>
>

This is the part that cvsutils fakes for you (by hacking the local cvs 
metadata files) so you don't need write access.

cheers

andrew

---

From: Greg Smith <[email-masked]>
Date: Mon, 14 May 2007 09:46:56 -0400 (EDT)

> essential to use rsync to maintain a local CVS repository. That makes 'cvs

Having recently tried to get this to work right and not quite nailed it 
down yet, I know it would be a help to new developers if someone using 
this technique would write out a suggested setup/workflow for generating 
patches this way.  Right now the best instructions out there are those 
that go with the buildfarm

http://pgfoundry.org/docman/view.php/1000040/4/PGBuildFarm-HOWTO.txt

and those aren't quite focused right if the goal is to work on new patches 
while keeping in sync with the repository.

--
* Greg Smith [email-masked] http://www.gregsmith.com Baltimore, MD

---

From: David Fetter <[email-masked]>
Date: Mon, 14 May 2007 10:35:56 -0700

On Mon, May 14, 2007 at 03:31:40PM +1200, Mark Kirkwood wrote:
> I usually saved an untouched version of the tree to compare against,
> so something like:
> 

It's great that we have all this knowledge of how to deal with CVS's
deficiencies, but at the moment, it amounts to magical lore.  Until we
get something better to replace it, they should be part of the docs. :)

Cheers,
David.

Remember to vote!

---

From: Alvaro Herrera <[email-masked]>
Date: Mon, 14 May 2007 15:16:15 -0400

> > primitive, but is pretty easy to do!

Except that it also includes diffs for generated files, which tend to be
huge.  To work around that you need to create a list of files to
exclude, and the whole thing (which was cumbersome already) starts to
get unmanageable.

I do use the cvsup mirror myself which makes things so much easier and
faster.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

---

From: Mark Kirkwood <[email-masked]>
Date: Tue, 15 May 2007 13:54:56 +1200

> I do use the cvsup mirror myself which makes things so much easier and

Not so, you just do a

$ make maintainer-clean

before the diff, which clears all those out.

While maintaining a cvs mirror is also good, for a small piece of work 
(or a work on a well defined area of the code) this requires no fooling 
around with repositories at all (which is nice).

Cheers

Mark

---

From: Alvaro Herrera <[email-masked]>
Date: Mon, 14 May 2007 22:44:51 -0400

> before the diff, which clears all those out.

Yeah, but then if you make a mistake with the patch and have to build
again to retest, you have to wait the whole thing to compile, which can
be annoying.

---

From: Mark Kirkwood <[email-masked]>
Date: Tue, 15 May 2007 15:35:45 +1200

> again to retest, you have to wait the whole thing to compile, which can

True - depends on the speed of your machine as to how annoying this 
really is... (I'm using a PIII 1.26 GHz... takes 5 min with -O2 - good 
excuse for a coffee etc).

However, as David brought up previously it is probably worth mentioning 
several of the various CVS work-arounds in the docs, so people at least 
get a good survey of the options - they can then choose whichever suits 
their needs best.

Cheers

Mark

---

From: "Jim C. Nasby" <[email-masked]>
Date: Tue, 15 May 2007 19:29:36 -0500

> get a good survey of the options - they can then choose whichever suits 

+1...

BTW, is there some trick to getting cvs diff to ignore files that aren't
in the repo?
-- 
Jim Nasby                                      [email-masked]
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)

---

From: Heikki Linnakangas <[email-masked]>
Date: Wed, 16 May 2007 09:12:23 +0100

> BTW, is there some trick to getting cvs diff to ignore files that aren't

Trick? That's what it does by default.

---

From: David Fetter <[email-masked]>
Date: Wed, 16 May 2007 07:15:49 -0700

On Wed, May 16, 2007 at 09:12:23AM +0100, Heikki Linnakangas wrote:
> Jim C. Nasby wrote:
> >BTW, is there some trick to getting cvs diff to ignore files that
> >aren't in the repo?
> 

I suspect he's talking about all the lines starting with '?' that diff
produces.

Lacking sophistication, I've been known to do:

cvs diff [list of files here] |grep -v '^?' > the_file.diff

Cheers,
D

Remember to vote!

---

From: "Jim C. Nasby" <[email-masked]>
Date: Wed, 16 May 2007 09:27:25 -0500

> Trick? That's what it does by default.

Well, it throws a notice that they're there...

[email-masked][20:34]~/pgsql/HEAD/src:22%cvs diff
? Makefile.global
? backend/postgres
? backend/access/common/.deps
? backend/access/gin/.deps
...

Granted, I could run that through grep, but I'm not sure that's 100%
safe.
-- 
Jim Nasby                                      [email-masked]
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)

---

From: Alvaro Herrera <[email-masked]>
Date: Wed, 16 May 2007 10:38:23 -0400

> [email-masked][20:34]~/pgsql/HEAD/src:22%cvs diff

What I do is build somewhere else.  Thus the only files present in the
source dir and not in the repo are those generated by bison/flex, which
are in .cvsignore and are thus not displayed.

That said, check this out:

http://www.ubiobio.cl/~gpoo/pgsql/settings/

Sadly, usage instructions are in spanish only currently, but I claim
that this script is extremely useful for Pg development (sure, I wrote
it and tailored to my needs).  If there is interest I can translate the
docs, but I have posted the script in these lists before and got no much
of an interest.  Michael Glaesemann did find it useful when I showed it
to him in the summit, though.

---

From: Gregory Stark <[email-masked]>
Date: Wed, 16 May 2007 15:53:22 +0100

> cvs diff [list of files here] |grep -v '^?' > the_file.diff

Those lines go to stderr. If you do "cvs diff > file" it spits out all the cvs
file statuses to the terminal but dumps the diff to the file.

It doesn't matter, diffs can contain arbitrary junk between the file diffs.
patch only looks at the things it recognizes.

---

From: David Fetter <[email-masked]>
Date: Wed, 16 May 2007 07:59:36 -0700

On Wed, May 16, 2007 at 03:53:22PM +0100, Gregory Stark wrote:
> >> >BTW, is there some trick to getting cvs diff to ignore files
> >> >that aren't in the repo?
> >> 
> > I suspect he's talking about all the lines starting with '?' that
> > diff produces.
> >
> Those lines go to stderr.

Not when I do "cvs diff."  Is there something I should (un)set in my
.cvsrc?

> If you do "cvs diff > file" it spits out all the cvs file statuses
> to the terminal but dumps the diff to the file.
> 
> It doesn't matter, diffs can contain arbitrary junk between the file
> diffs.  patch only looks at the things it recognizes.

IMHO, the diffs also need to be human-readable, and 500 useless lines
starting with "?" don't help with that.

Cheers,
D

Remember to vote!

---

From: Andrew Dunstan <[email-masked]>
Date: Wed, 16 May 2007 11:22:11 -0400

> Not when I do "cvs diff."  Is there something I should (un)set in my

No. (The lines that go to stderr are the directory names). But I don't 
see why there's a problem with using the command above. Or if you 
prefer, use something like this to postprocess the file:

  perl -ni -e 'print unless /^\?/;' diff-file

Bottom line - TIMTOWTDI

cheers

andrew

---

From: Michael Glaesemann <[email-masked]>
Date: Wed, 16 May 2007 10:52:05 -0500

> to him in the summit, though.

Ooo! Nifty! I'll have to check out what's changed. I still use this  
script. I find it very helpful. I can post my tweaks as well, if  
there's interest.

Michael Glaesemann
grzm seespotcode net

---

From: Alvaro Herrera <[email-masked]>
Date: Wed, 16 May 2007 12:08:09 -0400

> script. I find it very helpful. I can post my tweaks as well, if  

Yes, there is.

The one thing I did not keep was the stuff about the env vars, because
it didn't suit me to be copying and pasting them with the mouse.  To
solve the autocompletion problem you had that prompted you to tweak it,
what I do is

runpg 00<tab> ` Ctrl-A ` <enter>

so the autocompletion works because the first work is "runpg" and not
the single quote, and I enter the initial quote when the command has
been completed (Ctrl-A moves to the start of the line).

I can't remember if I dropped something else.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

---

From: Michael Glaesemann <[email-masked]>
Date: Thu, 17 May 2007 11:10:27 -0500

> I can't remember if I dropped something else.

Thanks, Alvaro. I've installed Hg and pulled from the site you  
posted. When I get a few spare cycles I'll take a look.

Btw, we should look at localization for this in the not too distant  
future. Or maybe I should learn Spanish :)

Michael Glaesemann
grzm seespotcode net

---

From: Bruce Momjian <[email-masked]>
Date: Wed, 30 May 2007 14:10:54 -0400 (EDT)

Patch applied and moved to a separate osx directory.  Thanks.

---------------------------------------------------------------------------

> starting after 8.3 gets out the door?

[ Attachment, skipping... ]

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
> 
>                http://archives.postgresql.org

-- 
  Bruce Momjian  <[email-masked]>          http://momjian.us
  EnterpriseDB                               http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +