Re: [pgsql-patches] partial pg_regress patch from Magnus

2007-01-19 Thread Alvaro Herrera
Alvaro Herrera wrote:
> Alvaro Herrera wrote:
> 
> > Other than that, if I don't see objections, I'll commit it later today.
> 
> Applied.

And apparently I broke most of the buildfarm, sorry :-(  Working on it.

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

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [pgsql-patches] partial pg_regress patch from Magnus

2007-01-19 Thread Alvaro Herrera
Alvaro Herrera wrote:

> Other than that, if I don't see objections, I'll commit it later today.

Applied.

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

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [pgsql-patches] partial pg_regress patch from Magnus

2007-01-19 Thread Alvaro Herrera
Alvaro Herrera wrote:
> Alvaro Herrera wrote:
> 
> > I tested it in a VPATH and a normal build, and regression test still
> > pass.  This is mostly Magnus' code: I merely stripped out the parts
> > unrelated to this change, and reworked the code a little.  So the
> > possible bugs are likely mine.
> 
> Woops, it doesn't work in VPATH :-(  Sorry, I'll fix and resubmit.
> (It only worked before because the parallel test had created the files,
> and I failed to run "make clean" between runs).

It seems the problem was only that the makefile was neglecting to add
the --srcdir argument.  It was kind of annoying that it didn't show any
warning or anything; I spent quite some time trying to figure out what
was going wrong.  I think I'll add a check that if it detects less than,
say, 5 files, throw an error message and quit.

Other than that, if I don't see objections, I'll commit it later today.

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

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [pgsql-patches] partial pg_regress patch from Magnus

2007-01-18 Thread Alvaro Herrera
Alvaro Herrera wrote:

> I tested it in a VPATH and a normal build, and regression test still
> pass.  This is mostly Magnus' code: I merely stripped out the parts
> unrelated to this change, and reworked the code a little.  So the
> possible bugs are likely mine.

Woops, it doesn't work in VPATH :-(  Sorry, I'll fix and resubmit.
(It only worked before because the parallel test had created the files,
and I failed to run "make clean" between runs).

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

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


[pgsql-patches] partial pg_regress patch from Magnus

2007-01-18 Thread Alvaro Herrera
Hi,

This is a revised partial version of Magnus' patch to pg_regress.  The
only thing this patch does is remove the dependency on sed, by having
pg_regress itself generate the .sql and .out files from the .source
files.

The motivator behind this patch is allowing the Visual C++ environment
be in the buildfarm, so while I personally think it's a dumb thing to do
;-) I think the end is worthwhile.

pg_regress now needs to have the source dir in a VPATH build, to know
where to find the source files to process.  So a new --srcdir switch was
added.

I tested it in a VPATH and a normal build, and regression test still
pass.  This is mostly Magnus' code: I merely stripped out the parts
unrelated to this change, and reworked the code a little.  So the
possible bugs are likely mine.

I also changed the Makefile so that the source file list is not
explicit, but rather a $(wildcard) thing.  This is because now
pg_regress also gets the file list using a wildcard sort of thing.  (The
file list is only used in the "clean" target, so it's likely to get
desynchronized if it has to be updated manually).

Magnus' original patch is in the queue:
http://momjian.us/mhonarc/patches/msg0.html

-- 
Alvaro Herrerahttp://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
Index: src/include/port.h
===
RCS file: /home/alvherre/Code/cvs/pgsql/src/include/port.h,v
retrieving revision 1.108
diff -c -p -r1.108 port.h
*** src/include/port.h	11 Jan 2007 02:39:52 -	1.108
--- src/include/port.h	18 Jan 2007 17:12:47 -
*** extern void get_man_path(const char *my_
*** 46,51 
--- 46,55 
  extern bool get_home_path(char *ret_path);
  extern void get_parent_directory(char *path);
  
+ /* port/dirmod.c */
+ extern char **pgfnames(char *path);
+ extern void pgfnames_cleanup(char **filenames);
+ 
  /*
   *	is_absolute_path
   *
Index: src/port/dirmod.c
===
RCS file: /home/alvherre/Code/cvs/pgsql/src/port/dirmod.c,v
retrieving revision 1.46
diff -c -p -r1.46 dirmod.c
*** src/port/dirmod.c	5 Jan 2007 22:20:02 -	1.46
--- src/port/dirmod.c	18 Jan 2007 21:35:11 -
*** pgsymlink(const char *oldpath, const cha
*** 287,298 
  
  
  /*
!  * fnames
   *
!  * return a list of the names of objects in the argument directory
   */
! static char **
! fnames(char *path)
  {
  	DIR		   *dir;
  	struct dirent *file;
--- 287,300 
  
  
  /*
!  * pgfnames
   *
!  * return a list of the names of objects in the argument directory.  Caller
!  * must call pgfnames_cleanup later to free the memory allocated by this
!  * function.
   */
! char **
! pgfnames(char *path)
  {
  	DIR		   *dir;
  	struct dirent *file;
*** fnames(char *path)
*** 357,368 
  
  
  /*
!  *	fnames_cleanup
   *
   *	deallocate memory used for filenames
   */
! static void
! fnames_cleanup(char **filenames)
  {
  	char	  **fn;
  
--- 359,370 
  
  
  /*
!  *	pgfnames_cleanup
   *
   *	deallocate memory used for filenames
   */
! void
! pgfnames_cleanup(char **filenames)
  {
  	char	  **fn;
  
*** rmtree(char *path, bool rmtopdir)
*** 394,400 
  	 * we copy all the names out of the directory before we start modifying
  	 * it.
  	 */
! 	filenames = fnames(path);
  
  	if (filenames == NULL)
  		return false;
--- 396,402 
  	 * we copy all the names out of the directory before we start modifying
  	 * it.
  	 */
! 	filenames = pgfnames(path);
  
  	if (filenames == NULL)
  		return false;
*** rmtree(char *path, bool rmtopdir)
*** 415,421 
  			if (!rmtree(filepath, true))
  			{
  /* we already reported the error */
! fnames_cleanup(filenames);
  return false;
  			}
  		}
--- 417,423 
  			if (!rmtree(filepath, true))
  			{
  /* we already reported the error */
! pgfnames_cleanup(filenames);
  return false;
  			}
  		}
*** rmtree(char *path, bool rmtopdir)
*** 433,439 
  			goto report_and_fail;
  	}
  
! 	fnames_cleanup(filenames);
  	return true;
  
  report_and_fail:
--- 435,441 
  			goto report_and_fail;
  	}
  
! 	pgfnames_cleanup(filenames);
  	return true;
  
  report_and_fail:
*** report_and_fail:
*** 444,449 
  	fprintf(stderr, _("could not remove file or directory \"%s\": %s\n"),
  			filepath, strerror(errno));
  #endif
! 	fnames_cleanup(filenames);
  	return false;
  }
--- 446,451 
  	fprintf(stderr, _("could not remove file or directory \"%s\": %s\n"),
  			filepath, strerror(errno));
  #endif
! 	pgfnames_cleanup(filenames);
  	return false;
  }
Index: src/test/regress/GNUmakefile
===
RCS file: /home/alvherre/Code/cvs/pgsql/src/test/regress/GNUmakefile,v
retrieving revision 1.63
diff -c -p -r1.63 GNUmakefile
*** src/test/regress/GNUmakefile	5 Jan 2007 22:20:03 -	1.63