]>
cygwin.com Git - cygwin-apps/setup.git/blob - ini.cc
2 * Copyright (c) 2000, Red Hat, Inc.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * A copy of the GNU General Public License can be found at
12 * Written by DJ Delorie <dj@cygnus.com>
16 /* The purpose of this file is to get and parse the setup.ini file
17 from the mirror site. A few support routines for the bison and
18 flex parsers are provided also. We check to see if this setup.ini
19 is older than the one we used last time, and if so, warn the user. */
35 unsigned int setup_timestamp
= 0;
37 extern "C" int yyparse ();
38 /* extern int yydebug; */
43 char *ini_file
= get_url_to_string (concat (MIRROR_SITE
, "/setup.ini", 0));
46 fatal (IDS_SETUPINI_MISSING
, MIRROR_SITE
);
54 mkdir_p (1, concat (root_dir
, "/etc/setup", 0));
56 unsigned int old_timestamp
= 0;
57 FILE *ots
= fopen (concat (root_dir
, "/etc/setup/timestamp", 0), "rt");
60 fscanf (ots
, "%u", &old_timestamp
);
62 if (old_timestamp
&& setup_timestamp
63 && (old_timestamp
> setup_timestamp
))
65 int yn
= yesno (IDS_OLD_SETUPINI
);
72 FILE *nts
= fopen (concat (root_dir
, "/etc/setup/timestamp", 0), "wt");
75 fprintf (nts
, "%u", setup_timestamp
);
80 next_dialog
= IDD_S_CHOOSE
;
83 extern "C" int yyerror (char *s
)
85 MessageBox (0, s
, "Parse Error", 0);
89 extern "C" int fprintf(FILE *f
, const char *s
, ...);
92 fprintf(FILE *f
, const char *fmt
, ...)
100 rv
= vsprintf (buf
, fmt
, args
);
101 MessageBox (0, buf
, "Cygwin Setup", 0);
105 rv
= vfprintf (f
, fmt
, args
);
This page took 0.0393 seconds and 5 git commands to generate.