Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaa71939

Browse files
committed
In pg_regress, remove the temporary installation upon successful exit.
This results in a very substantial reduction in disk space usage during"make check-world", since that sequence involves creation of numeroustemporary installations. It should also help a bit in the buildfarm, eventhough the buildfarm script doesn't create as many temp installations,because the current script misses deleting some of them; and anyway itseems better to do this once in one place rather than expecting thatscript to get it right every time.In 9.4 and HEAD, also undo the unwise choice in commitb1aebbbto report strerror(errno) after a rmtree() failure. rmtree has alreadyreported that, possibly for multiple failures with distinct errnos; andwhat's more, by the time it returns there is no good reason to assumethat errno still reflects the last reportable error. So reporting errnohere is at best redundant and at worst badly misleading.Back-patch to all supported branches, so that future revisions of thebuildfarm script can rely on this behavior.
1 parent75b48e1 commitaa71939

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

‎src/test/regress/pg_regress.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -537,8 +537,8 @@ convert_sourcefiles_in(char *source_subdir, char *dest_dir, char *dest_subdir, c
537537
if (directory_exists(testtablespace))
538538
if (!rmtree(testtablespace, true))
539539
{
540-
fprintf(stderr,_("\n%s: could not remove test tablespace \"%s\": %s\n"),
541-
progname,testtablespace,strerror(errno));
540+
fprintf(stderr,_("\n%s: could not remove test tablespace \"%s\"\n"),
541+
progname,testtablespace);
542542
exit(2);
543543
}
544544
make_directory(testtablespace);
@@ -2392,7 +2392,8 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
23922392
header(_("removing existing temp installation"));
23932393
if (!rmtree(temp_install, true))
23942394
{
2395-
fprintf(stderr,_("\n%s: could not remove temp installation \"%s\": %s\n"),progname,temp_install,strerror(errno));
2395+
fprintf(stderr,_("\n%s: could not remove temp installation \"%s\"\n"),
2396+
progname,temp_install);
23962397
exit(2);
23972398
}
23982399
}
@@ -2668,6 +2669,19 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
26682669
stop_postmaster();
26692670
}
26702671

2672+
/*
2673+
* If there were no errors, remove the temp installation immediately to
2674+
* conserve disk space. (If there were errors, we leave the installation
2675+
* in place for possible manual investigation.)
2676+
*/
2677+
if (temp_install&&fail_count==0&&fail_ignore_count==0)
2678+
{
2679+
header(_("removing temporary installation"));
2680+
if (!rmtree(temp_install, true))
2681+
fprintf(stderr,_("\n%s: could not remove temp installation \"%s\"\n"),
2682+
progname,temp_install);
2683+
}
2684+
26712685
fclose(logfile);
26722686

26732687
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp