+Thu Apr 13 12:51:19 2000 Christopher Faylor <cgf@cygnus.com>
+
+ * Makefile.in: Eliminate duplicate -nostdinc from CFLAGS.
+ * setup.c (create_uninstall): Create the uninstall .bat file in the
+ "root" so that we can remove the /bin directory. Add bin\cygwin.bat to
+ list of files to be deleted. Fix directory detection for determining
+ when to use 'rmdir'.
+ (do_start_menu): Add /usr/local/bin to the path.
+ (main): Add slop to files.array allocation so that we don't have to
+ worry about reallocating the array when it grows too large when doing
+ some trivial "pushes". Add /tmp and /usr/local/{bin,lib} to list of
+ files.
+
Thu Apr 13 01:59:44 2000 Christopher Faylor <cgf@cygnus.com>
* setup.c (processdirlisting): Fix handling of "A" for "A"lways
#define NFILE_LIST 10000
#endif
+#ifndef NFILE_SLOP
+#define NFILE_SLOP 20
+#endif
+
char *wd;
int downloaddir (HINTERNET session, const char *url);
{
if (++files.index >= files.count)
files.array = realloc (files.array,
- files.count += NFILE_LIST);
+ NFILE_SLOP + (files.count += NFILE_LIST));
s = buffer;
if (*s != '/')
*--s = '/';
{
size_t n;
FILE *uninst;
+ char cwd[MAX_PATH];
+ char *uninstfile;
- files.count = files.index + 1;
- qsort (files.array, files.count, sizeof (char *), reverse_sort);
-
- uninst = fopen ("bin\\uninst.bat", "wt");
+ getcwd (cwd, sizeof (cwd));
+ uninstfile = pathcat (cwd, "uninst.bat");
+ uninst = fopen (uninstfile, "wt");
if (uninst)
{
- char cwd[MAX_PATH];
- char *uninstfile;
unsigned percent = 0;
+ struct _stat st;
+
+ files.array[++files.index] = pathcat (cwd, "bin\\cygwin.bat");
+ files.count = files.index + 1;
+ qsort (files.array, files.count, sizeof (char *), reverse_sort);
- getcwd (cwd, sizeof (cwd));
fprintf (uninst,
"@echo off\n" "%c:\n" "cd \"%s\"\n", *cwd, cwd);
for (n = 0; n < files.count; ++n)
dpath = files.array[n];
- if (files.array[n][strlen (files.array[n]) - 1] == '\\')
+ if (_stat (dpath, &st) == 0 && st.st_mode & _S_IFDIR)
fprintf (uninst, "rmdir \"%s\"\n", dpath);
else
{
"del \"%s\"\n"
"del \"%s\"\n"
"rmdir \"%s\"\n"
- "del bin\\uninst.bat\n", shortcut, shellscut,
- folder);
+ "del %s\n", shortcut, shellscut,
+ folder, uninstfile);
fclose (uninst);
- uninstfile = pathcat (cwd, "bin\\uninst.bat");
- if (uninstfile)
- {
- create_shortcut (uninstfile, shortcut);
- }
+ create_shortcut (uninstfile, shortcut);
}
sa_cleanup (&files);
retval = 1;
fprintf (batch,
"@echo off\n"
"SET MAKE_MODE=unix\n"
- "SET PATH=%s\\bin;%%PATH%%\n"
+ "SET PATH=%s\\bin;%s\\usr\\local\\bin;%%PATH%%\n"
"bash\n", root, root);
fclose (batch);
mkmount (wd, root, "lib", "/usr/lib", 1);
files.count = NFILE_LIST;
- files.array = calloc (sizeof (char *), NFILE_LIST);
+ files.array = calloc (sizeof (char *), NFILE_LIST + NFILE_SLOP);
files.index = -1;
/* Extract all of the packages that are stored with setup or in
}
else
{
+ char **a;
/* bash expects a /tmp */
char *tmpdir = pathcat (root, "tmp");
if (tmpdir)
{
+ files.array[++files.index] = tmpdir;
mkdir (tmpdir); /* Ignore the result, it may
exist. */
- xfree (tmpdir);
}
+ files.array[++files.index] = pathcat (root, "usr\\local");
+ files.array[++files.index] = pathcat (root, "usr\\local\\bin");
+ files.array[++files.index] = pathcat (root, "usr\\local\\lib");
+ mkdirp (files.array[files.index]);
+ mkdir (files.array[files.index - 1]);
+
if (do_start_menu (root))
retval = 0; /* Everything worked return
successful code */