]> git.saurik.com Git - bison.git/blame - djgpp/djunpack.bat
Regenerate.
[bison.git] / djgpp / djunpack.bat
CommitLineData
b09a18c5
JMG
1@echo off\r
2Rem\r
3Rem WARNING WARNING WARNING: This file needs to have DOS CRLF end-of-line\r
4Rem format, or else stock DOS/Windows shells will refuse to run it.\r
5Rem\r
6Rem This batch file unpacks the Bison distribution while simultaneously\r
7Rem renaming some of the files whose names are invalid on DOS or conflict\r
8Rem with other file names after truncation to DOS 8+3 namespace.\r
9Rem\r
02650b7f
PE
10Rem Copyright (C) 2005 Free Software Foundation, Inc.\r
11Rem\r
12Rem This program is free software; you can redistribute it and/or modify\r
13Rem it under the terms of the GNU General Public License as published by\r
14Rem the Free Software Foundation; either version 2, or (at your option)\r
15Rem any later version.\r
16Rem\r
17Rem This program is distributed in the hope that it will be useful,\r
18Rem but WITHOUT ANY WARRANTY; without even the implied warranty of\r
19Rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
20Rem GNU General Public License for more details.\r
21Rem\r
22Rem You should have received a copy of the GNU General Public License\r
23Rem along with this program; if not, write to the Free Software Foundation,\r
24Rem Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\r
25Rem\r
26Rem\r
b09a18c5
JMG
27Rem Invoke like this:\r
28Rem\r
29Rem djunpack bison-XYZ.tar\r
30Rem\r
31Rem where XYZ is the version number. If the argument includes leading\r
32Rem directories, it MUST use backslashes, not forward slashes.\r
33Rem\r
34Rem The following 2 lines need to be changed with each new Bison release, to\r
35Rem be identical to the name of the top-level directory where the Bison\r
36Rem distribution unpacks itself.\r
37set ENVIRONMENT_SIZE_TEST_STRING=ENVIRONMENT_SIZE_TEST_STRING\r
38if "%ENVIRONMENT_SIZE_TEST_STRING%"=="ENVIRONMENT_SIZE_TEST_STRING" GoTo EnvOk\r
39Rem If their environment space is too small, re-exec with a larger one\r
40command.com /e:4096 /c %0 %1\r
41GoTo End\r
42:EnvOk\r
43set ENVIRONMENT_SIZE_TEST_STRING=\r
44if "%1" == "" GoTo NoArgument\r
45if not exist %1 GoTo NoArchive\r
46Rem Extract top src dir from archive file.\r
47djtar -t %1 > top_src.dir\r
48Rem The following uses a feature of COPY whereby it does not copy\r
49Rem empty files. We need that because the previous line will create\r
50Rem an empty fnchange.tmp even if the command failed for some reason.\r
51copy top_src.dir junk.tmp > nul\r
52if not exist junk.tmp GoTo NoDjTar\r
53del junk.tmp\r
54sed "1{s/^.*bison-/djtar -x -p -o bison-/;s|$|djgpp/fnchange.lst %%1 > fnchange.tmp|};2,$d" top_src.dir > ext_list.bat\r
55Rem See the comment above about the reason for using COPY.\r
56copy ext_list.bat junk.tmp > nul\r
57if not exist junk.tmp GoTo NoSed\r
58del junk.tmp\r
59Rem Extract fnchange.lst from archive.\r
60call ext_list.bat %1\r
61del ext_list.bat\r
62sed "1{s|^.*bison-|s/@V@/bison-|;s|$|g|};2,$d" top_src.dir > version.sed\r
63sed -f version.sed < fnchange.tmp > fnchange.lst\r
64del version.sed\r
65del fnchange.tmp\r
66del top_src.dir\r
67Rem unpack the source distribution\r
68djtar -x -n fnchange.lst %1\r
69del fnchange.lst\r
70GoTo End\r
71:NoSed\r
72del junk.tmp\r
73echo FAIL: Sed is not available.\r
74GoTo End\r
75:NoDjTar\r
76del junk.tmp\r
77echo FAIL: DJTAR is not available or no fnchange.lst file in %1.\r
78GoTo End\r
79:NoArchive\r
80echo FAIL: the file %1 does not seem to exist.\r
81echo Remember that %1 cannot use forward slashes, only backslashes.\r
82GoTo End\r
83:NoArgument\r
84echo FAIL: no archive file has been specified.\r
85echo Remember that the file name cannot use forward slashes, only backslashes.\r
86:End\r