carnold     2005/02/03 23:51:52

  Modified:    msvc     log4cxx.sln
               tests/src/util transformer.cpp
  Log:
  LOGCXX-54: Looks like sed is working now
  
  Revision  Changes    Path
  1.2       +3 -37     logging-log4cxx/msvc/log4cxx.sln
  
  Index: log4cxx.sln
  ===================================================================
  RCS file: /home/cvs/logging-log4cxx/msvc/log4cxx.sln,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- log4cxx.sln       18 Sep 2003 22:28:04 -0000      1.1
  +++ log4cxx.sln       4 Feb 2005 07:51:52 -0000       1.2
  @@ -1,49 +1,15 @@
   Microsoft Visual Studio Solution File, Format Version 8.00
  -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dll", "dll\dll.vcproj", 
"{A4E44A07-5436-4BE3-BAEA-C7994AD3D829}"
  -     ProjectSection(ProjectDependencies) = postProject
  -     EndProjectSection
  -EndProject
  -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "simplesocketserver", 
"simplesocketserver\simplesocketserver.vcproj", 
"{A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}"
  -     ProjectSection(ProjectDependencies) = postProject
  -             {A4E44A07-5436-4BE3-BAEA-C7994AD3D829} = 
{A4E44A07-5436-4BE3-BAEA-C7994AD3D829}
  -     EndProjectSection
  -EndProject
  -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "static", 
"static\static.vcproj", "{495708AC-96C6-41E5-AD66-4AFD16C27A21}"
  +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "log4cxx", 
"log4cxx.vcproj", "{66D5A510-3995-49A4-8C2B-8F38DAD15566}"
        ProjectSection(ProjectDependencies) = postProject
        EndProjectSection
   EndProject
   Global
        GlobalSection(SolutionConfiguration) = preSolution
                Debug = Debug
  -             Release = Release
  -             Unicode Debug = Unicode Debug
  -             Unicode Release = Unicode Release
        EndGlobalSection
        GlobalSection(ProjectConfiguration) = postSolution
  -             {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Debug.ActiveCfg = 
Debug|Win32
  -             {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Debug.Build.0 = 
Debug|Win32
  -             {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Release.ActiveCfg = 
Release|Win32
  -             {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Release.Build.0 = 
Release|Win32
  -             {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Unicode Debug.ActiveCfg 
= Unicode Debug|Win32
  -             {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Unicode Debug.Build.0 = 
Unicode Debug|Win32
  -             {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Unicode 
Release.ActiveCfg = Unicode Release|Win32
  -             {A4E44A07-5436-4BE3-BAEA-C7994AD3D829}.Unicode Release.Build.0 
= Unicode Release|Win32
  -             {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Debug.ActiveCfg = 
Debug|Win32
  -             {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Debug.Build.0 = 
Debug|Win32
  -             {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Release.ActiveCfg = 
Release|Win32
  -             {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Release.Build.0 = 
Release|Win32
  -             {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Unicode Debug.ActiveCfg 
= Unicode Debug|Win32
  -             {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Unicode Debug.Build.0 = 
Unicode Debug|Win32
  -             {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Unicode 
Release.ActiveCfg = Unicode Release|Win32
  -             {A21EE49A-CE32-4A4B-9B8E-EA2444DCC494}.Unicode Release.Build.0 
= Unicode Release|Win32
  -             {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Debug.ActiveCfg = 
Debug|Win32
  -             {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Debug.Build.0 = 
Debug|Win32
  -             {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Release.ActiveCfg = 
Release|Win32
  -             {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Release.Build.0 = 
Release|Win32
  -             {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Unicode Debug.ActiveCfg 
= Unicode Debug|Win32
  -             {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Unicode Debug.Build.0 = 
Unicode Debug|Win32
  -             {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Unicode 
Release.ActiveCfg = Unicode Release|Win32
  -             {495708AC-96C6-41E5-AD66-4AFD16C27A21}.Unicode Release.Build.0 
= Unicode Release|Win32
  +             {66D5A510-3995-49A4-8C2B-8F38DAD15566}.Debug.ActiveCfg = 
Debug|Win32
  +             {66D5A510-3995-49A4-8C2B-8F38DAD15566}.Debug.Build.0 = 
Debug|Win32
        EndGlobalSection
        GlobalSection(ExtensibilityGlobals) = postSolution
        EndGlobalSection
  
  
  
  1.12      +22 -26    logging-log4cxx/tests/src/util/transformer.cpp
  
  Index: transformer.cpp
  ===================================================================
  RCS file: /home/cvs/logging-log4cxx/tests/src/util/transformer.cpp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- transformer.cpp   4 Feb 2005 07:07:01 -0000       1.11
  +++ transformer.cpp   4 Feb 2005 07:51:52 -0000       1.12
  @@ -118,36 +118,26 @@
           //      using Q as regex separator on s command
           //
           const char** args = (const char**)
  -          apr_palloc(pool, 6 * sizeof(*args));
  -        int i = 0;
  +          apr_palloc(pool, 5 * sizeof(*args));
  +        int i = 0;
  +
  +        //
  +        //   not well documented
  +        //     but the first arg is a duplicate of the executable name
  +        //
  +        args[i++] = "sed";
   
           //
           //   write the regex's to a temporary file since they
           //      may get mangled if passed as parameters
           //
  -        apr_file_t* regexFile;
  -        char regexName[400];
  -
  -        const char* tmpDir;
  -        stat = apr_temp_dir_get(&tmpDir, pool);
  -
  -        strcpy(regexName, tmpDir);
  -        strcat(regexName, "/regexpXXXXXX");
  -
  -        apr_pool_t* regexPool;
  -        stat = apr_pool_create(&regexPool, pool);
  -
  -        stat = apr_file_mktemp(&regexFile, regexName, APR_WRITE | 
APR_CREATE, regexPool);
  -        assert(stat == 0);
  -
  -        args[i++] = "-f";
  -        const char* tmpName;
  -        stat = apr_file_name_get(&tmpName, regexFile);
  -        assert(stat == 0);
  -        char* tmpName2 = (char*) apr_palloc(pool, strlen(tmpName) + 1);
  -        strcpy(tmpName2, tmpName);
  -        args[i++] = tmpName2;
  -
  +        std::string regexName(in.getOSName());
  +        regexName.append(".sed");
  +
  +        std::string regexArg("-f");
  +        regexArg.append(regexName);
  +        args[i++] = regexArg.c_str();
  +
           args[i++] = "-i";
           //
           //    specify the input file
  @@ -155,6 +145,13 @@
           args[i] = NULL;
   
   
  +        apr_file_t* regexFile;
  +        apr_int32_t flags = APR_FOPEN_WRITE | APR_FOPEN_CREATE | 
APR_FOPEN_TRUNCATE;
  +        stat = apr_file_open(&regexFile, 
  +               regexName.c_str(),
  +               APR_FOPEN_WRITE | APR_FOPEN_CREATE | APR_FOPEN_TRUNCATE, 
APR_OS_DEFAULT, 
  +               pool);
  +
           std::string tmp;
           for (log4cxx::Filter::PatternList::const_iterator iter = 
patterns.begin();
             iter != patterns.end();
  @@ -167,7 +164,6 @@
             apr_file_puts(tmp.c_str(), regexFile);
           }
           apr_file_close(regexFile);
  -        apr_pool_destroy(regexPool);
   
   
           //
  
  
  

Reply via email to