Korrekturen
authorcasemaster <casemaster@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Tue, 4 Jul 2006 18:10:48 +0000 (18:10 +0000)
committercasemaster <casemaster@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Tue, 4 Jul 2006 18:10:48 +0000 (18:10 +0000)
git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@196 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8

make.sh
src/install+setup/setup/main.c

diff --git a/make.sh b/make.sh
index f898bb2..91f976d 100644 (file)
--- a/make.sh
+++ b/make.sh
@@ -912,7 +912,7 @@ build)
        buildipcop
 
        # Setzen des IPFire Builds
-       if [ $FIREBUILD ]; then
+       if [ "$FIREBUILD" ]; then
                echo "$FIREBUILD" > $CONFIG_ROOT/firebuild
        else
                echo "_(OvO)_" > $CONFIG_ROOT/firebuild
index d40c9ac..44900e2 100644 (file)
-/* SmoothWall setup program.\r
- *\r
- * This program is distributed under the terms of the GNU General Public\r
- * Licence.  See the file COPYING for details.\r
- *\r
- * (c) Lawrence Manning, 2001\r
- * Contains main entry point, and misc functions.\r
- * \r
- * modified 16/11/2002 eoberlander - French language added\r
- *\r
- * $Id: main.c,v 1.4.2.7 2005/12/01 20:13:08 eoberlander Exp $\r
- * \r
- */\r
-\r
-#include "setup.h"\r
-\r
-FILE *flog = NULL;\r
-char *mylog;\r
-\r
-char **ctr = NULL;\r
-\r
-int automode = 0;\r
-\r
-extern char *bz_tr[];\r
-extern char *cs_tr[];\r
-extern char *da_tr[];\r
-extern char *en_tr[];\r
-extern char *es_tr[];\r
-extern char *fi_tr[];\r
-extern char *fr_tr[];\r
-extern char *hu_tr[];\r
-extern char *la_tr[];\r
-extern char *nl_tr[];\r
-extern char *de_tr[];\r
-extern char *tr_tr[];\r
-extern char *it_tr[];\r
-extern char *el_tr[];\r
-extern char *sk_tr[];\r
-extern char *so_tr[];\r
-extern char *sv_tr[];\r
-extern char *no_tr[];\r
-extern char *pl_tr[];\r
-extern char *pt_tr[];\r
-extern char *vi_tr[];\r
-\r
-int main(int argc, char *argv[])\r
-{\r
-#ifdef  LANG_EN_ONLY\r
-       char *shortlangnames[] = { "en", NULL };\r
-       char **langtrs[] = { en_tr, NULL };\r
-#elifdef LANG_ALL\r
-       char *shortlangnames[] = { "bz", "cs", "da", "de", "en", "es", "fr", "el", "it", "la", "hu", "nl", "no", "pl", "pt", "sk", "so", "fi", "sv", "tr", "vi", NULL };\r
-       char **langtrs[] = { bz_tr, cs_tr, da_tr, de_tr, en_tr, es_tr, fr_tr, el_tr, it_tr, la_tr, hu_tr, nl_tr, no_tr, pl_tr, pt_tr, sk_tr, so_tr, fi_tr, sv_tr, tr_tr, vi_tr, NULL };\r
-#else\r
-       char *shortlangnames[] = { "de", "en", NULL };\r
-       char **langtrs[] = { de_tr, en_tr, NULL };\r
-#endif\r
-       int choice;\r
-       char *sections[11]; /* need to fill this out AFTER knowning lang */\r
-       int rc;\r
-       struct keyvalue *kv;\r
-       char selectedshortlang[STRING_SIZE] = "en";\r
-       char title[STRING_SIZE];\r
-       int langcounter;\r
-       int autook = 0;\r
-       \r
-       /* Log file/terminal stuff. */\r
-       if (argc >= 2)\r
-               mylog = argv[1];        \r
-       else\r
-               mylog = strdup("/root/setup.log");\r
-\r
-       if (!(flog = fopen(mylog, "w+")))\r
-       {\r
-               printf("Couldn't open log terminal\n");\r
-               return 1;\r
-       }\r
-       \r
-       if (argc >= 3)\r
-               automode = 1;\r
-       \r
-       fprintf(flog, "Setup program started.\n");\r
-               \r
-       kv = initkeyvalues();\r
-       if (!(readkeyvalues(kv, CONFIG_ROOT "/main/settings")))\r
-       {\r
-               printf("%s is not properly installed.\n", NAME);\r
-               return 1;\r
-       }\r
-       findkey(kv, "LANGUAGE", selectedshortlang);\r
-       \r
-       for (langcounter = 0; langtrs[langcounter]; langcounter++)\r
-       {\r
-               if (strcmp(selectedshortlang, shortlangnames[langcounter]) == 0)\r
-               {\r
-                       ctr = langtrs[langcounter];\r
-                       break;\r
-               }\r
-       }\r
-\r
-       if (!ctr)\r
-       {\r
-               /* zh,lt,ro,ru,th languages not available in setup, so use English */\r
-               for (choice = 0; shortlangnames[choice]; choice++)\r
-               {\r
-                       if (strcmp(shortlangnames[choice], "en") == 0)\r
-                               break;\r
-               }\r
-               if (!shortlangnames[choice])\r
-                       goto EXIT;\r
-               ctr = langtrs[choice];\r
-       }\r
-\r
-       sections[0] = ctr[TR_KEYBOARD_MAPPING];\r
-       sections[1] = ctr[TR_TIMEZONE];\r
-       sections[2] = ctr[TR_HOSTNAME];\r
-       sections[3] = ctr[TR_DOMAINNAME];\r
-       sections[4] = ctr[TR_ISDN_CONFIGURATION];\r
-       sections[5] = ctr[TR_NETWORKING];       \r
-       sections[6] = ctr[TR_ROOT_PASSWORD];\r
-       sections[7] = ctr[TR_ADMIN_PASSWORD];\r
-       sections[8] = NULL;\r
-       \r
-       newtInit();\r
-       newtCls();\r
-       FILE *f_title;\r
-       if ((f_title = fopen ("/etc/issue", "r"))) \r
-       {\r
-           fgets (title, STRING_SIZE, f_title);\r
-           if (title[strlen(title) - 1] == '\n')\r
-               title[strlen(title) - 1] = '\0';\r
-           fclose (f_title);   \r
-       } else {\r
-           sprintf (title, "%s v%s - %s", NAME, VERSION, SLOGAN);\r
-       }\r
-       newtDrawRootText(14, 0, title);\r
-       newtPushHelpLine(ctr[TR_HELPLINE]);             \r
-\r
-       if (automode == 0)\r
-       {\r
-               choice = 0;\r
-               for (;;)\r
-               {\r
-                       rc = newtWinMenu(ctr[TR_SECTION_MENU],\r
-                               ctr[TR_SELECT_THE_ITEM], 50, 5, 5, 11,\r
-                               sections, &choice, ctr[TR_OK], ctr[TR_QUIT], NULL);\r
-                       \r
-                       if (rc == 2)\r
-                               break;\r
-                       \r
-                       switch (choice)\r
-                       {\r
-                               case 0:\r
-                                       handlekeymap();\r
-                                       break;\r
-                               \r
-                               case 1:\r
-                                       handletimezone();\r
-                                       break;\r
-                                       \r
-                               case 2:\r
-                                       handlehostname();\r
-                                       break;\r
-                               \r
-                               case 3:\r
-                                       handledomainname();\r
-                                       break;\r
-\r
-                               case 4:\r
-                                       handleisdn();\r
-                                       break;\r
-\r
-                               case 5:\r
-                                       handlenetworking();\r
-                                       break;\r
-                                                                       \r
-                               case 6:\r
-                                       handlerootpassword();\r
-                                       break;\r
-                                       \r
-                               case 7:\r
-                                       handleadminpassword();\r
-                                       break;\r
-               \r
-                               default:\r
-                                       break;\r
-                       }\r
-               }\r
-       }\r
-       else\r
-       {\r
-               if (!(handlekeymap()))\r
-                       goto EXIT;\r
-               if (!(handletimezone()))\r
-                       goto EXIT;      \r
-               if (!(handlehostname()))\r
-                       goto EXIT;\r
-               if (!(handledomainname()))\r
-                       goto EXIT;\r
-               if (!(handleisdn()))\r
-                       goto EXIT;\r
-               if (!(handlenetworking()))\r
-                       goto EXIT;\r
-               if (!(handledhcp()))\r
-                       goto EXIT;\r
-               if (!(handlerootpassword()))\r
-                       goto EXIT;\r
-               if (!(handleadminpassword()))\r
-                       goto EXIT;\r
-\r
-               autook = 1;\r
-       }\r
-\r
-EXIT:  \r
-       if (automode != 0)\r
-       {\r
-               sprintf (title, "%s v%s - %s", NAME, VERSION, SLOGAN);\r
-               if (autook)\r
-                       newtWinMessage(title, ctr[TR_OK], ctr[TR_SETUP_FINISHED]);\r
-               else\r
-                       newtWinMessage(ctr[TR_WARNING], ctr[TR_OK], ctr[TR_SETUP_NOT_COMPLETE]);\r
-       }\r
-       \r
-       fprintf(flog, "Setup program ended.\n");\r
-       fflush(flog);\r
-       fclose(flog);\r
-               \r
-       newtFinished();\r
-\r
-       return 0;\r
-}\r
-\r
+/* SmoothWall setup program.
+ *
+ * This program is distributed under the terms of the GNU General Public
+ * Licence.  See the file COPYING for details.
+ *
+ * (c) Lawrence Manning, 2001
+ * Contains main entry point, and misc functions.
+ * 
+ * modified 16/11/2002 eoberlander - French language added
+ *
+ * $Id: main.c,v 1.4.2.7 2005/12/01 20:13:08 eoberlander Exp $
+ *
+ */
+
+#include "setup.h"
+
+FILE *flog = NULL;
+char *mylog;
+
+char **ctr = NULL;
+
+int automode = 0;
+
+extern char *bz_tr[];
+extern char *cs_tr[];
+extern char *da_tr[];
+extern char *en_tr[];
+extern char *es_tr[];
+extern char *fi_tr[];
+extern char *fr_tr[];
+extern char *hu_tr[];
+extern char *la_tr[];
+extern char *nl_tr[];
+extern char *de_tr[];
+extern char *tr_tr[];
+extern char *it_tr[];
+extern char *el_tr[];
+extern char *sk_tr[];
+extern char *so_tr[];
+extern char *sv_tr[];
+extern char *no_tr[];
+extern char *pl_tr[];
+extern char *pt_tr[];
+extern char *vi_tr[];
+
+int main(int argc, char *argv[])
+{
+#ifdef  LANG_EN_ONLY
+       char *shortlangnames[] = { "en", NULL };
+       char **langtrs[] = { en_tr, NULL };
+#elifdef LANG_ALL
+       char *shortlangnames[] = { "bz", "cs", "da", "de", "en", "es", "fr", "el", "it", "la", "hu", "nl", "no", "pl", "pt", "sk", "so", "fi", "sv", "tr", "vi", NULL };
+       char **langtrs[] = { bz_tr, cs_tr, da_tr, de_tr, en_tr, es_tr, fr_tr, el_tr, it_tr, la_tr, hu_tr, nl_tr, no_tr, pl_tr, pt_tr, sk_tr, so_tr, fi_tr, sv_tr, tr_tr, vi_tr, NULL };
+#else
+       char *shortlangnames[] = { "de", "en", NULL };
+       char **langtrs[] = { de_tr, en_tr, NULL };
+#endif
+       int choice;
+       char *sections[11]; /* need to fill this out AFTER knowning lang */
+       int rc;
+       struct keyvalue *kv;
+       char selectedshortlang[STRING_SIZE] = "en";
+       char title[STRING_SIZE];
+       int langcounter;
+       int autook = 0;
+
+       /* Log file/terminal stuff. */
+       if (argc >= 2)
+               mylog = argv[1];
+       else
+               mylog = strdup("/root/setup.log");
+
+       if (!(flog = fopen(mylog, "w+")))
+       {
+               printf("Couldn't open log terminal\n");
+               return 1;
+       }
+
+       if (argc >= 3)
+               automode = 1;
+
+       fprintf(flog, "Setup program started.\n");
+
+       kv = initkeyvalues();
+       if (!(readkeyvalues(kv, CONFIG_ROOT "/main/settings")))
+       {
+               printf("%s is not properly installed.\n", NAME);
+               return 1;
+       }
+       findkey(kv, "LANGUAGE", selectedshortlang);
+
+       for (langcounter = 0; langtrs[langcounter]; langcounter++)
+       {
+               if (strcmp(selectedshortlang, shortlangnames[langcounter]) == 0)
+               {
+                       ctr = langtrs[langcounter];
+                       break;
+               }
+       }
+
+       if (!ctr)
+       {
+               /* zh,lt,ro,ru,th languages not available in setup, so use English */
+               for (choice = 0; shortlangnames[choice]; choice++)
+               {
+                       if (strcmp(shortlangnames[choice], "en") == 0)
+                               break;
+               }
+               if (!shortlangnames[choice])
+                       goto EXIT;
+               ctr = langtrs[choice];
+       }
+
+       sections[0] = ctr[TR_KEYBOARD_MAPPING];
+       sections[1] = ctr[TR_TIMEZONE];
+       sections[2] = ctr[TR_HOSTNAME];
+       sections[3] = ctr[TR_DOMAINNAME];
+       sections[4] = ctr[TR_ISDN_CONFIGURATION];
+       sections[5] = ctr[TR_NETWORKING];
+       sections[6] = ctr[TR_ROOT_PASSWORD];
+       sections[7] = ctr[TR_ADMIN_PASSWORD];
+       sections[8] = NULL;
+
+       newtInit();
+       newtCls();
+       FILE *f_title;
+       if ((f_title = fopen ("/etc/issue", "r")))
+       {
+           fgets (title, STRING_SIZE, f_title);
+           if (title[strlen(title) - 1] == '\n')
+               title[strlen(title) - 1] = '\0';
+           fclose (f_title);
+       } else {
+           sprintf (title, "%s v%s - %s", NAME, VERSION, SLOGAN);
+       }
+       newtDrawRootText(14, 0, title);
+       newtPushHelpLine(ctr[TR_HELPLINE]);             
+
+       if (automode == 0)
+       {
+               choice = 0;
+               for (;;)
+               {
+                       rc = newtWinMenu(ctr[TR_SECTION_MENU],
+                               ctr[TR_SELECT_THE_ITEM], 50, 5, 5, 11,
+                               sections, &choice, ctr[TR_OK], ctr[TR_QUIT], NULL);
+
+                       if (rc == 2)
+                               break;
+
+                       switch (choice)
+                       {
+                               case 0:
+                                       handlekeymap();
+                                       break;
+
+                               case 1:
+                                       handletimezone();
+                                       break;
+
+                               case 2:
+                                       handlehostname();
+                                       break;
+
+                               case 3:
+                                       handledomainname();
+                                       break;
+
+                               case 4:
+                                       handleisdn();
+                                       break;
+
+                               case 5:
+                                       handlenetworking();
+                                       break;
+
+                               case 6:
+                                       handlerootpassword();
+                                       break;
+                                       
+                               case 7:
+                                       handleadminpassword();
+                                       break;
+               
+                               default:
+                                       break;
+                       }
+               }
+       }
+       else
+       {
+               if (!(handlekeymap()))
+                       goto EXIT;
+               if (!(handletimezone()))
+                       goto EXIT;
+               if (!(handlehostname()))
+                       goto EXIT;
+               if (!(handledomainname()))
+                       goto EXIT;
+               if (!(handleisdn()))
+                       goto EXIT;
+               if (!(handlenetworking()))
+                       goto EXIT;
+               if (!(handledhcp()))
+                       goto EXIT;
+               if (!(handlerootpassword()))
+                       goto EXIT;
+               if (!(handleadminpassword()))
+                       goto EXIT;
+
+               autook = 1;
+       }
+
+EXIT:  
+       if (automode != 0)
+       {
+               sprintf (title, "%s v%s - %s", NAME, VERSION, SLOGAN);
+               if (autook)
+                       newtWinMessage(title, ctr[TR_OK], ctr[TR_SETUP_FINISHED]);
+               else
+                       newtWinMessage(ctr[TR_WARNING], ctr[TR_OK], ctr[TR_SETUP_NOT_COMPLETE]);
+       }
+       
+       fprintf(flog, "Setup program ended.\n");
+       fflush(flog);
+       fclose(flog);
+               
+       newtFinished();
+
+       return 0;
+}
+