]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix bug in build-win32-cross-tools script reported by Howard
authorKern Sibbald <kern@sibbald.com>
Wed, 26 Apr 2006 09:28:27 +0000 (09:28 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 26 Apr 2006 09:28:27 +0000 (09:28 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2973 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/kes-1.39
bacula/src/dird/ua_cmds.c
bacula/src/findlib/create_file.c
bacula/src/win32/build-win32-cross-tools

index b8a864255fa65d0335a004c2fc1dec27036e2655..e214dad2be25566c8fbe71565d1062d64303de1b 100644 (file)
@@ -3,6 +3,7 @@
 
 General:
 26Apr06
+- Fix bug in build-win32-cross-tools script reported by Howard
 - Implement cross compiled bconsole
 25Apr06
 - Fix barcode test, eliminate BOOL (doesn't exist on Linux).
index 4fe9dc9df09f8bcbd3c17063bb33d916eaaa0e21..29feea937e5124b6f240893bb1b96f8f0855a52c 100644 (file)
@@ -153,9 +153,9 @@ int do_a_command(UAContext *ua, const char *cmd)
 
    len = strlen(ua->argk[0]);
    for (i=0; i<comsize; i++) {     /* search for command */
-      if (strncasecmp(ua->argk[0],  _(commands[i].key), len) == 0) {
+      if (strncasecmp(ua->argk[0],  commands[i].key, len) == 0) {
          /* Check if command permitted, but "quit" is always OK */
-         if (strcmp(ua->argk[0], "quit") != 0 &&
+         if (strcmp(ua->argk[0], NT_("quit")) != 0 &&
              !acl_access_ok(ua, Command_ACL, ua->argk[0], len)) {
             break;
          }
@@ -178,7 +178,7 @@ int do_a_command(UAContext *ua, const char *cmd)
 void set_pool_dbr_defaults_in_media_dbr(MEDIA_DBR *mr, POOL_DBR *pr)
 {
    mr->PoolId = pr->PoolId;
-   bstrncpy(mr->VolStatus, "Append", sizeof(mr->VolStatus));
+   bstrncpy(mr->VolStatus, NT_("Append"), sizeof(mr->VolStatus));
    mr->Recycle = pr->Recycle;
    mr->VolRetention = pr->VolRetention;
    mr->VolUseDuration = pr->VolUseDuration;
@@ -355,7 +355,7 @@ int automount_cmd(UAContext *ua, const char *cmd)
       onoff = ua->argk[1];
    }
 
-   ua->automount = (strcasecmp(onoff, _("off")) == 0) ? 0 : 1;
+   ua->automount = (strcasecmp(onoff, NT_("off")) == 0) ? 0 : 1;
    return 1;
 }
 
@@ -375,7 +375,7 @@ static int cancel_cmd(UAContext *ua, const char *cmd)
    }
 
    for (i=1; i<ua->argc; i++) {
-      if (strcasecmp(ua->argk[i], _("jobid")) == 0) {
+      if (strcasecmp(ua->argk[i], NT_("jobid")) == 0) {
          uint32_t JobId;
          if (!ua->argv[i]) {
             break;
@@ -386,7 +386,7 @@ static int cancel_cmd(UAContext *ua, const char *cmd)
             return 1;
          }
          break;
-      } else if (strcasecmp(ua->argk[i], _("job")) == 0) {
+      } else if (strcasecmp(ua->argk[i], NT_("job")) == 0) {
          if (!ua->argv[i]) {
             break;
          }
@@ -396,7 +396,7 @@ static int cancel_cmd(UAContext *ua, const char *cmd)
             bstrncpy(jcr->Job, ua->argv[i], sizeof(jcr->Job));
          }
          break;
-      } else if (strcasecmp(ua->argk[i], _("ujobid")) == 0) {
+      } else if (strcasecmp(ua->argk[i], NT_("ujobid")) == 0) {
          if (!ua->argv[i]) {
             break;
          }
@@ -578,7 +578,7 @@ extern DIRRES *director;
  */
 static int python_cmd(UAContext *ua, const char *cmd)
 {
-   if (ua->argc >= 1 && strcasecmp(ua->argk[1], _("restart")) == 0) {
+   if (ua->argc >= 1 && strcasecmp(ua->argk[1], NT_("restart")) == 0) {
       term_python_interpreter();
       init_python_interpreter(director->hdr.name, 
          director->scripts_directory, "DirStartUp");
@@ -863,9 +863,9 @@ static int setdebug_cmd(UAContext *ua, const char *cmd)
          }
       }
 
-      if (strcasecmp(ua->argk[i], "store") == 0 ||
-          strcasecmp(ua->argk[i], "storage") == 0 ||
-          strcasecmp(ua->argk[i], "sd") == 0) {
+      if (strcasecmp(ua->argk[i], NT_("store")) == 0 ||
+          strcasecmp(ua->argk[i], NT_("storage")) == 0 ||
+          strcasecmp(ua->argk[i], NT_("sd")) == 0) {
          store = NULL;
          if (ua->argv[i]) {
             store = (STORE *)GetResWithName(R_STORAGE, ua->argv[i]);
@@ -886,10 +886,10 @@ static int setdebug_cmd(UAContext *ua, const char *cmd)
     * prompt the user.
     */
    start_prompt(ua, _("Available daemons are: \n"));
-   add_prompt(ua, "Director");
-   add_prompt(ua, "Storage");
-   add_prompt(ua, "Client");
-   add_prompt(ua, "All");
+   add_prompt(ua, _("Director"));
+   add_prompt(ua, _("Storage"));
+   add_prompt(ua, _("Client"));
+   add_prompt(ua, _("All"));
    switch(do_prompt(ua, "", _("Select daemon type to set debug level"), NULL, 0)) {
    case 0:                         /* Director */
       debug_level = level;
@@ -932,7 +932,7 @@ static int trace_cmd(UAContext *ua, const char *cmd)
       onoff = ua->argk[1];
    }
 
-   set_trace((strcasecmp(onoff, _("off")) == 0) ? false : true);
+   set_trace((strcasecmp(onoff, NT_("off")) == 0) ? false : true);
    return 1;
 
 }
@@ -969,30 +969,30 @@ static int estimate_cmd(UAContext *ua, const char *cmd)
 
    jcr->JobLevel = L_FULL;
    for (int i=1; i<ua->argc; i++) {
-      if (strcasecmp(ua->argk[i], "client") == 0 ||
-          strcasecmp(ua->argk[i], "fd") == 0) {
+      if (strcasecmp(ua->argk[i], NT_("client")) == 0 ||
+          strcasecmp(ua->argk[i], NT_("fd")) == 0) {
          if (ua->argv[i]) {
             client = (CLIENT *)GetResWithName(R_CLIENT, ua->argv[i]);
             continue;
          }
       }
-      if (strcasecmp(ua->argk[i], "job") == 0) {
+      if (strcasecmp(ua->argk[i], NT_("job")) == 0) {
          if (ua->argv[i]) {
             job = (JOB *)GetResWithName(R_JOB, ua->argv[i]);
             continue;
          }
       }
-      if (strcasecmp(ua->argk[i], "fileset") == 0) {
+      if (strcasecmp(ua->argk[i], NT_("fileset")) == 0) {
          if (ua->argv[i]) {
             fileset = (FILESET *)GetResWithName(R_FILESET, ua->argv[i]);
             continue;
          }
       }
-      if (strcasecmp(ua->argk[i], "listing") == 0) {
+      if (strcasecmp(ua->argk[i], NT_("listing")) == 0) {
          listing = 1;
          continue;
       }
-      if (strcasecmp(ua->argk[i], "level") == 0) {
+      if (strcasecmp(ua->argk[i], NT_("level")) == 0) {
          if (!get_level_from_name(ua->jcr, ua->argv[i])) {
             bsendmsg(ua, _("Level %s not valid.\n"), ua->argv[i]);
          }
@@ -1574,7 +1574,7 @@ int qhelp_cmd(UAContext *ua, const char *cmd)
    unsigned int i;
 
    for (i=0; i<comsize; i++) {
-      bsendmsg(ua, "%s %s\n", _(commands[i].key), _(commands[i].help));
+      bsendmsg(ua, "%s %s\n", commands[i].key, _(commands[i].help));
    }
    return 1;
 }
index 1ebae9a6447417db409f80262631104ea2eedf56..c494ba8f1ea5da0d97983fe46424e0767fc6bde6 100644 (file)
@@ -343,25 +343,35 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace)
  */
 static int separate_path_and_file(JCR *jcr, char *fname, char *ofile)
 {
-   char *f, *p;
+   char *f, *p, *q;
    int fnl, pnl;
 
    /* Separate pathname and filename */
-   for (p=f=ofile; *p; p++) {
+   for (q=p=f=ofile; *p; p++) {
       if (*p == '/') {
-         f = p;                    /* possible filename */
+         f = q;                    /* possible filename */
       }
+#ifdef HAVE_WIN32
+      if (*p == '\\') {            /* strip backslashes on Win32 */
+         continue;
+      }
+      *q++ = *p;                   /* copy data */
+#else
+      q++;
+#endif
    }
+
    if (*f == '/') {
       f++;
    }
+   *q = 0;                         /* terminate string */
 
-   fnl = p - f;
+   fnl = q - f;
    if (fnl == 0) {
       /* The filename length must not be zero here because we
        *  are dealing with a file (i.e. FT_REGE or FT_REG).
        */
-      Qmsg1(jcr, M_ERROR, 0, _("Zero length filename: %s\n"), fname);
+      Jmsg1(jcr, M_ERROR, 0, _("Zero length filename: %s\n"), fname);
       return -1;
    }
    pnl = f - ofile - 1;
@@ -380,7 +390,7 @@ static int path_already_seen(JCR *jcr, char *path, int pnl)
    if (jcr->cached_pnl == pnl && strcmp(path, jcr->cached_path) == 0) {
       return 1;
    }
-   pm_strcpy(&jcr->cached_path, path);
+   pm_strcpy(jcr->cached_path, path);
    jcr->cached_pnl = pnl;
    return 0;
 }
index f95aa35e1598866352bac9e6185c977f06835e1e..a06ff6f76efe17f0d7643278882563dc954a8b87 100755 (executable)
 #-----------------------------------------------------
 
 
-# What flavor of GCC cross-compiler are we building?
-
+# Directory where cross-tools directory will be placed
+TOPDIR=../../..
+# Cross tools directory name under TOPDIR
+CROSSTOOLS=cross-tools
+# What flavor of GCC cross-compiler are we building? under CROSSTOOLS
 TARGET=mingw32
 
-# What directory will the cross-compiler be built in?
-# This is the directory into which source archives will
-# be downloaded, expanded, compiled, etc.  You need to
-# have write-access to this directory.  If you leave it
-# blank, it defaults to the current directory.
-
-#BUILDDIR=/data/cross-tools-4.1.0
-BUILDDIR=../../../mingw
 cwd=`pwd`
-cd ${BUILDDIR}
-# Now make builddir absolute  
-BUILDDIR=`pwd`
-cd ${cwd}
+cd ${TOPDIR}
+# Make TOPDIR absolute 
+TOPDIR=`pwd`
+BUILDDIR=${TOPDIR}/${CROSSTOOLS}
 
-mkdir -p ${BUILDDIR}
-mkdir -p ${BUILDDIR}/${TARGET}
+cd ${cwd}
 
 # Where does the cross-compiler go?
 # This should be the directory into which your cross-compiler
@@ -67,7 +61,9 @@ mkdir -p ${BUILDDIR}/${TARGET}
 # that only root has write access to, you will need to run this
 # script as root.
 
-PREFIX=${BUILDDIR}/mingw32
+PREFIX=${BUILDDIR}/${TARGET}
+mkdir -p ${BUILDDIR}
+mkdir -p ${BUILDDIR}/${TARGET}
 
 # Purge anything and everything already in the $PREFIX
 #(also known as the destination or installation) directory?