Changeset 308 for trunk/run_email2trac.c


Ignore:
Timestamp:
01/27/10 16:23:38 (14 years ago)
Author:
bas
Message:

Added a patch to set teh PYTHON_EGG_CACHE environment variable in run_email2trac, closes #174

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/run_email2trac.c

    r202 r308  
    5656
    5757  char   **trac_script_args;
     58  char   *python_egg_cache;
    5859  struct passwd *TRAC;
    5960  struct passwd *MTA;
     
    8081      continue;
    8182    }
     83    else if ( (strcmp(argv[i],"--eggcache") == 0) ||
     84         (strcmp(argv[i],"-e") == 0) ) {
     85      i++;
     86      python_egg_cache = argv[i];
     87      continue;
     88    }
    8289   
    8390    trac_script_args[j] = argv[i];
     
    8693  trac_script_args[j] = NULL;
    8794
    88  
    8995  /* Check caller */
    90 
    91 
    9296  check_username(MTA_USER);
    9397  MTA = getpwnam(MTA_USER);
     
    102106    return -2;     /* 254 : Invalid caller */
    103107  }
    104  
    105108 
    106109  /* set UID/GID to Trac (or apache) user */
     
    122125  }
    123126 
     127  /* Set PYTHON_EGG_CACHE env variable if we have been told to do so */
     128  if ( strlen(python_egg_cache) > 0 ) {
     129    setenv("PYTHON_EGG_CACHE",python_egg_cache ,1);
     130  }
     131
    124132  /* Execute script */
    125133  status = execv(trac_script, trac_script_args);
     134 
    126135  if ( DEBUG ) printf("Script %s execution failure (error=%d). Check permission and interpreter path.\n",trac_script,status);
    127136  return -1;     /* 255 : should never reach this point */
Note: See TracChangeset for help on using the changeset viewer.