Jorgen Austvik wrote:
Maybe push the stat operation inside convert_sourcefiles_in ?

Yes, that was what I tried to do in the patch, but unfortunately I was too eager :) I'll send a new proposal tomorrow. Thanks for your help!

Hi,

this patch should only move the stat operation into convert_sourcefiles_in().

The attached patch is tested by running pg_regress in a non-standard path, and by running "make check" in pgsql plus in ecpg.

-J
--

Jørgen Austvik, Software Engineering - QA
Database Technology Group
Index: src/test/regress/pg_regress.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/test/regress/pg_regress.c,v
retrieving revision 1.38
diff -c -r1.38 pg_regress.c
*** src/test/regress/pg_regress.c	15 Nov 2007 21:14:46 -0000	1.38
--- src/test/regress/pg_regress.c	27 Nov 2007 14:13:47 -0000
***************
*** 399,404 ****
--- 399,406 ----
  	char		abs_builddir[MAXPGPATH];
  	char		testtablespace[MAXPGPATH];
  	char		indir[MAXPGPATH];
+ 	struct stat	st;
+ 	int		ret;
  	char	  **name;
  	char	  **names;
  	int			count = 0;
***************
*** 424,429 ****
--- 426,440 ----
  		strcpy(abs_srcdir, abs_builddir);
  
  	snprintf(indir, MAXPGPATH, "%s/%s", abs_srcdir, source);
+ 
+ 	ret = stat(indir, &st);
+ 	if ((ret != 0) || (!S_ISDIR(st.st_mode)))
+ 		/*
+ 		 * No warning, to avoid noise in tests that does not have
+ 		 * these directories, see ecpg, contrib and src/pl.
+ 		 */
+ 		return;
+ 
  	names = pgfnames(indir);
  	if (!names)
  		/* Error logged in pgfnames */
***************
*** 512,527 ****
  static void
  convert_sourcefiles(void)
  {
! 	struct stat st;
! 	int			ret;
! 
! 	ret = stat("input", &st);
! 	if (ret == 0 && S_ISDIR(st.st_mode))
! 		convert_sourcefiles_in("input", "sql", "sql");
! 
! 	ret = stat("output", &st);
! 	if (ret == 0 && S_ISDIR(st.st_mode))
! 		convert_sourcefiles_in("output", "expected", "out");
  }
  
  /*
--- 523,530 ----
  static void
  convert_sourcefiles(void)
  {
! 	convert_sourcefiles_in("input", "sql", "sql");
! 	convert_sourcefiles_in("output", "expected", "out");
  }
  
  /*
begin:vcard
fn;quoted-printable:J=C3=B8rgen Austvik
n;quoted-printable:Austvik;J=C3=B8rgen
org:Sun Microsystems;Database Technology Group
adr:;;Haakon VIII gt. 7b;Trondheim;;NO-7485;Norway
email;internet:[EMAIL PROTECTED]
title:Senior Engineer
tel;work:+47 73 84 21 10 
tel;fax:+47 73 84 21 01
tel;cell:+47 901 97 886
x-mozilla-html:FALSE
url:http://www.sun.com/
version:2.1
end:vcard

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

Reply via email to