Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8d36372

Browse files
committed
Fix very broken clean.bat for msvc install. The way we used subroutines
in .bat simply did not work, and it called them in the wrong order, some several times, and some not at all. So this unrolls all subroutine calls. This should fix the issues with clean deleting the wrong files reported by Dave Page. While at it, add the "clean dist" option to act like "make distclean", and no longer remove the flex/bison output files by default. This shuold fix the problem reported by Pavel Golub in bug #3909.
1 parent 03e4dc9 commit 8d36372

File tree

2 files changed

+61
-51
lines changed

2 files changed

+61
-51
lines changed

doc/src/sgml/install-win32.sgml

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/install-win32.sgml,v 1.44 2007/12/19 12:29:36 mha Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/install-win32.sgml,v 1.45 2008/02/06 15:13:25 mha Exp $ -->
22

33
<chapter id="install-win32">
44
<title>Installation on <productname>Windows</productname></title>
@@ -238,7 +238,10 @@
238238
handle changed files. But if there have been large changes, you may need
239239
to clean the installation. To do this, simply run the
240240
<filename>clean.bat</filename> command, which will automatically clean out
241-
all generated files.
241+
all generated files. You can also run it with with the
242+
<parameter>dist</parameter> parameter, in which case it will behave like
243+
<userinput>make distclean</userinput> and remove the flex/bison output files
244+
as well.
242245
</para>
243246

244247
<para>

src/tools/msvc/clean.bat

+56-49
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,78 @@
11
@echo off
2-
REM $PostgreSQL: pgsql/src/tools/msvc/clean.bat,v 1.9 2007/12/19 12:31:35 mha Exp $
2+
REM $PostgreSQL: pgsql/src/tools/msvc/clean.bat,v 1.10 2008/02/06 15:13:25 mha Exp $
3+
4+
set DIST=0
5+
if "%1"=="dist" set DIST=1
36

47
set D=%CD%
58
if exist ..\msvc if exist ..\..\..\src cd ..\..\..
69

710
if exist debug rd /s /q debug
811
if exist release rd /s /q release
9-
call :del *.vcproj
10-
call :del pgsql.sln
12+
for %%f in (*.vcproj) do del %%f
13+
if exist pgsql.sln del /q pgsql.sln
1114
del /s /q src\bin\win32ver.rc 2> NUL
1215
del /s /q src\interfaces\win32ver.rc 2> NUL
13-
call :del src\backend\win32ver.rc
14-
16+
if exist src\backend\win32ver.rc del /q src\backend\win32ver.rc
1517

1618
REM Delete files created with GenerateFiles() in Solution.pm
17-
call :del src\include\pg_config.h
18-
call :del src\include\pg_config_os.h
19-
call :del src\backend\parser\parse.h
20-
call :del src\include\utils\fmgroids.h
21-
22-
call :del src\backend\utils\fmgrtab.c
23-
call :del src\backend\catalog\postgres.bki
24-
call :del src\backend\catalog\postgres.description
25-
call :del src\backend\catalog\postgres.shdescription
26-
call :del src\backend\parser\gram.c
27-
call :del src\backend\bootstrap\bootparse.c
28-
call :del src\backend\bootstrap\bootstrap_tokens.h
29-
30-
call :del src\bin\psql\sql_help.h
31-
32-
call :del src\interfaces\libpq\libpq.rc
33-
call :del src\interfaces\libpq\libpqdll.def
34-
call :del src\interfaces\ecpg\compatlib\compatlib.def
35-
call :del src\interfaces\ecpg\ecpglib\ecpglib.def
36-
call :del src\interfaces\ecpg\include\ecpg_config.h
37-
call :del src\interfaces\ecpg\pgtypeslib\pgtypeslib.def
38-
call :del src\interfaces\ecpg\preproc\preproc.c
39-
call :del src\interfaces\ecpg\preproc\preproc.h
40-
41-
call :del src\port\pg_config_paths.h
42-
43-
call :del src\pl\plperl\spi.c
44-
call :del src\pl\plpgsql\src\pl_gram.c
45-
call :del src\pl\plpgsql\src\pl.tab.h
46-
47-
call :del contrib\cube\cubeparse.c
48-
call :del contrib\cube\cubeparse.h
49-
call :del contrib\seg\segparse.c
50-
call :del contrib\seg\segparse.h
19+
if exist src\include\pg_config.h del /q src\include\pg_config.h
20+
if exist src\include\pg_config_os.h del /q src\include\pg_config_os.h
21+
if %DIST%==1 if exist src\backend\parser\parse.h del /q src\backend\parser\parse.h
22+
if exist src\include\utils\fmgroids.h del /q src\include\utils\fmgroids.h
23+
24+
if exist src\backend\utils\fmgrtab.c del /q src\backend\utils\fmgrtab.c
25+
if exist src\backend\catalog\postgres.bki del /q src\backend\catalog\postgres.bki
26+
if exist src\backend\catalog\postgres.description del /q src\backend\catalog\postgres.description
27+
if exist src\backend\catalog\postgres.shdescription del /q src\backend\catalog\postgres.shdescription
28+
if %DIST%==1 if exist src\backend\parser\scan.c del /q src\backend\parser\scan.c
29+
if %DIST%==1 if exist src\backend\parser\gram.c del /q src\backend\parser\gram.c
30+
if %DIST%==1 if exist src\backend\bootstrap\bootscanner.c del /q src\backend\bootstrap\bootscanner.c
31+
if %DIST%==1 if exist src\backend\bootstrap\bootparse.c del /q src\backend\bootstrap\bootparse.c
32+
if %DIST%==1 if exist src\backend\bootstrap\bootstrap_tokens.h del /q src\backend\bootstrap\bootstrap_tokens.h
33+
if %DIST%==1 if exist src\backend\utils\misc\guc-file.c del /q src\backend\utils\misc\guc-file.c
34+
35+
36+
if exist src\bin\psql\sql_help.h del /q src\bin\psql\sql_help.h
37+
38+
if exist src\interfaces\libpq\libpq.rc del /q src\interfaces\libpq\libpq.rc
39+
if exist src\interfaces\libpq\libpqdll.def del /q src\interfaces\libpq\libpqdll.def
40+
if exist src\interfaces\ecpg\compatlib\compatlib.def del /q src\interfaces\ecpg\compatlib\compatlib.def
41+
if exist src\interfaces\ecpg\ecpglib\ecpglib.def del /q src\interfaces\ecpg\ecpglib\ecpglib.def
42+
if exist src\interfaces\ecpg\include\ecpg_config.h del /q src\interfaces\ecpg\include\ecpg_config.h
43+
if exist src\interfaces\ecpg\pgtypeslib\pgtypeslib.def del /q src\interfaces\ecpg\pgtypeslib\pgtypeslib.def
44+
if %DIST%==1 if exist src\interfaces\ecpg\preproc\pgc.c del /q src\interfaces\ecpg\preproc\pgc.c
45+
if %DIST%==1 if exist src\interfaces\ecpg\preproc\preproc.c del /q src\interfaces\ecpg\preproc\preproc.c
46+
if %DIST%==1 if exist src\interfaces\ecpg\preproc\preproc.h del /q src\interfaces\ecpg\preproc\preproc.h
47+
48+
if exist src\port\pg_config_paths.h del /q src\port\pg_config_paths.h
49+
50+
if exist src\pl\plperl\spi.c del /q src\pl\plperl\spi.c
51+
if %DIST%==1 if exist src\pl\plpgsql\src\pl_scan.c del /q src\pl\plpgsql\src\pl_scan.c
52+
if %DIST%==1 if exist src\pl\plpgsql\src\pl_gram.c del /q src\pl\plpgsql\src\pl_gram.c
53+
if %DIST%==1 if exist src\pl\plpgsql\src\pl.tab.h del /q src\pl\plpgsql\src\pl.tab.h
54+
55+
if %DIST%==1 if exist src\bin\psql\psqlscan.c del /q src\bin\psql\psqlscan.c
56+
57+
if %DIST%==1 if exist contrib\cube\cubescan.c del /q contrib\cube\cubescan.c
58+
if %DIST%==1 if exist contrib\cube\cubeparse.c del /q contrib\cube\cubeparse.c
59+
if %DIST%==1 if exist contrib\cube\cubeparse.h del /q contrib\cube\cubeparse.h
60+
if %DIST%==1 if exist contrib\seg\segscan.c del /q contrib\seg\segscan.c
61+
if %DIST%==1 if exist contrib\seg\segparse.c del /q contrib\seg\segparse.c
62+
if %DIST%==1 if exist contrib\seg\segparse.h del /q contrib\seg\segparse.h
5163

5264
if exist src\test\regress\tmp_check rd /s /q src\test\regress\tmp_check
53-
call :del contrib\spi\refint.dll
54-
call :del contrib\spi\autoinc.dll
55-
call :del src\test\regress\regress.dll
65+
if exist contrib\spi\refint.dll del /q contrib\spi\refint.dll
66+
if exist contrib\spi\autoinc.dll del /q contrib\spi\autoinc.dll
67+
if exist src\test\regress\regress.dll del /q src\test\regress\regress.dll
5668

5769
REM Clean up datafiles built with contrib
58-
cd contrib
59-
for /r %%f in (*.sql) do if exist %%f.in del %%f
70+
REM cd contrib
71+
REM for /r %%f in (*.sql) do if exist %%f.in del %%f
6072

6173
cd %D%
6274

6375
REM Clean up ecpg regression test files
6476
msbuild /NoLogo ecpg_regression.proj /t:clean /v:q
6577

6678
goto :eof
67-
68-
69-
:del
70-
if exist %1 del /q %1
71-
goto :eof

0 commit comments

Comments
 (0)