svn commit: r807514 - in /commons/proper/compress/trunk/src: changes/changes.xml main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
Author: bodewig Date: Tue Aug 25 08:11:44 2009 New Revision: 807514 URL: http://svn.apache.org/viewvc?rev=807514view=rev Log: The tar Ant task has a usecase where absolute paths inside archives are required - allow creation of such entries Modified: commons/proper/compress/trunk/src/changes/changes.xml commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java (contents, props changed) Modified: commons/proper/compress/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/changes/changes.xml?rev=807514r1=807513r2=807514view=diff == --- commons/proper/compress/trunk/src/changes/changes.xml (original) +++ commons/proper/compress/trunk/src/changes/changes.xml Tue Aug 25 08:11:44 2009 @@ -23,6 +23,11 @@ /properties body release version=1.1 date=as in SVN description=Release 1.1 + action type=add date=2009-08-25 +A new constructor of TarArchiveEntry can create entries with +names that start with slashes - the default is to strip +leading slashes in order to create relative path names. + /action action issue=COMPRESS-83 type=fix date=2009-08-01 Delegate all read and write methods in GZip stream in order to speed up operations. Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java?rev=807514r1=807513r2=807514view=diff == --- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java (original) +++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java Tue Aug 25 08:11:44 2009 @@ -167,9 +167,21 @@ * @param name the entry name */ public TarArchiveEntry(String name) { +this(name, false); +} + +/** + * Construct an entry with only a name. This allows the programmer + * to construct the entry's header by hand. File is set to null. + * + * @param name the entry name + * @param preserveLeadingSlashes whether to allow leading slashes + * in the name. + */ +public TarArchiveEntry(String name, boolean preserveLeadingSlashes) { this(); -name = normalizeFileName(name); +name = normalizeFileName(name, preserveLeadingSlashes); boolean isDir = name.endsWith(/); this.devMajor = 0; @@ -208,7 +220,7 @@ * @param file The file that the entry represents. */ public TarArchiveEntry(File file) { -this(file, normalizeFileName(file.getPath())); +this(file, normalizeFileName(file.getPath(), false)); } /** @@ -320,7 +332,7 @@ * @param name This entry's new name. */ public void setName(String name) { -this.name = normalizeFileName(name); +this.name = normalizeFileName(name, false); } /** @@ -642,7 +654,8 @@ * Strips Windows' drive letter as well as any leading slashes, * turns path separators into forward slahes. */ -private static String normalizeFileName(String fileName) { +private static String normalizeFileName(String fileName, +boolean preserveLeadingSlashes) { String osname = System.getProperty(os.name).toLowerCase(Locale.US); if (osname != null) { @@ -674,7 +687,7 @@ // No absolute pathnames // Windows (and Posix?) paths can start with \\NetworkDrive\, // so we loop on starting /'s. -while (fileName.startsWith(/)) { +while (!preserveLeadingSlashes fileName.startsWith(/)) { fileName = fileName.substring(1); } return fileName; Propchange: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java -- --- svn:mergeinfo (added) +++ svn:mergeinfo Tue Aug 25 08:11:44 2009 @@ -0,0 +1,2 @@ +/ant/core/trunk/src/main/org/apache/tools/tar/TarArchiveEntry.java:741089 +/ant/core/trunk/src/main/org/apache/tools/tar/TarEntry.java:807513
svn commit: r807529 - in /commons/sandbox/runtime/trunk/src/main/native: configure include/acr.h
Author: mturk Date: Tue Aug 25 09:06:24 2009 New Revision: 807529 URL: http://svn.apache.org/viewvc?rev=807529view=rev Log: Rename ccconfig to acr_config Modified: commons/sandbox/runtime/trunk/src/main/native/configure commons/sandbox/runtime/trunk/src/main/native/include/acr.h Modified: commons/sandbox/runtime/trunk/src/main/native/configure URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/configure?rev=807529r1=807528r2=807529view=diff == --- commons/sandbox/runtime/trunk/src/main/native/configure (original) +++ commons/sandbox/runtime/trunk/src/main/native/configure Tue Aug 25 09:06:24 2009 @@ -821,12 +821,12 @@ # Generate configuration header file # -cat $topdir/include/ccconfig.h EOF +cat $topdir/include/acr_config.h EOF /* * AUTOMATICALLY GENERATED BY CONFIGURE SCRIPT -- DO NOT EDIT */ -#ifndef _CCCONFIG_H -#define _CCCONFIG_H +#ifndef _ACR_CONFIG_H +#define _ACR_CONFIG_H #ifdef __cplusplus extern C { @@ -846,6 +846,7 @@ #define HAVE_STRING_H `have_include string` #define HAVE_STRINGS_H`have_include strings` #define HAVE_INTTYPES_H `have_include inttypes` +#define HAVE_WTYPES_H `have_include wtypes` #define HAVE_DLFCN_H `have_include dlfcn` #define HAVE_LINK_H `have_include link` #define HAVE_FCNTL_H `have_include fcntl` @@ -890,12 +891,12 @@ EOF -cat $topdir/include/ccconfig.h EOF +cat $topdir/include/acr_config.h EOF #ifdef __cplusplus } #endif -#endif /* _CCCONFIG_H */ +#endif /* _ACR_CONFIG_H */ EOF if [ .$host = .windows ]; then Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr.h URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr.h?rev=807529r1=807528r2=807529view=diff == --- commons/sandbox/runtime/trunk/src/main/native/include/acr.h (original) +++ commons/sandbox/runtime/trunk/src/main/native/include/acr.h Tue Aug 25 09:06:24 2009 @@ -17,7 +17,7 @@ #ifndef _ACR_H #define _ACR_H -#include ccconfig.h +#include acr_config.h #if HAVE_WINDOWS_H #if !defined(WIN32_LEAN_AND_MEAN) #define WIN32_LEAN_AND_MEAN @@ -100,6 +100,9 @@ #if HAVE_INTTYPES_H #include inttypes.h #endif +#if HAVE_WTYPES_H +#include wtypes.h +#endif #if HAVE_DLFCN_H #include dlfcn.h #endif
svn commit: r807635 [1/2] - in /commons/sandbox/runtime/trunk/src/main/native: ./ include/ shared/ srclib/regex/ test/
Author: mturk Date: Tue Aug 25 13:57:05 2009 New Revision: 807635 URL: http://svn.apache.org/viewvc?rev=807635view=rev Log: Add Henry Spencer's regex prefixed with acr_ Added: commons/sandbox/runtime/trunk/src/main/native/srclib/regex/ commons/sandbox/runtime/trunk/src/main/native/srclib/regex/cclass.h (with props) commons/sandbox/runtime/trunk/src/main/native/srclib/regex/cname.h (with props) commons/sandbox/runtime/trunk/src/main/native/srclib/regex/engine.c (with props) commons/sandbox/runtime/trunk/src/main/native/srclib/regex/re_comp.h (with props) commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regcomp.c (with props) commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regerror.c (with props) commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regex.h (with props) commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regex2.h (with props) commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regexec.c (with props) commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regfree.c (with props) commons/sandbox/runtime/trunk/src/main/native/srclib/regex/utils.h (with props) Modified: commons/sandbox/runtime/trunk/src/main/native/Makefile.in commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in commons/sandbox/runtime/trunk/src/main/native/include/acr_sbuf.h commons/sandbox/runtime/trunk/src/main/native/shared/ini.c commons/sandbox/runtime/trunk/src/main/native/shared/sbuf.c commons/sandbox/runtime/trunk/src/main/native/test/sample.conf commons/sandbox/runtime/trunk/src/main/native/test/sample.ini Modified: commons/sandbox/runtime/trunk/src/main/native/Makefile.in URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/Makefile.in?rev=807635r1=807634r2=807635view=diff == --- commons/sandbox/runtime/trunk/src/main/native/Makefile.in (original) +++ commons/sandbox/runtime/trunk/src/main/native/Makefile.in Tue Aug 25 13:57:05 2009 @@ -73,6 +73,7 @@ $(SRCDIR)/os/unix \ $(SRCDIR)/os/win32 \ $(SRCDIR)/modules/network/ssl \ + $(SRCDIR)/srclib/regex \ $(SRCDIR)/srclib/zlib \ $(SRCDIR)/test @@ -206,6 +207,12 @@ $(SRCDIR)/port/strlcpy.$(OBJ) \ $(SRCDIR)/port/strsignal.$(OBJ) +REGEX_OBJS=\ + $(SRCDIR)/srclib/regex/regcomp.$(OBJ) \ + $(SRCDIR)/srclib/regex/regerror.$(OBJ) \ + $(SRCDIR)/srclib/regex/regexec.$(OBJ) \ + $(SRCDIR)/srclib/regex/regfree.$(OBJ) + ZLIB_OBJS=\ $(SRCDIR)/srclib/zlib/adler32.$(OBJ) \ $(SRCDIR)/srclib/zlib/compress.$(OBJ) \ @@ -236,12 +243,12 @@ .cpp.$(OBJ): $(CXX) $(CFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) -c -o $@ $ -$(STATICLIB): $(PPORT_OBJS) $(COMMON_OBJS) $(@platf...@_objs) $(ZLIB_OBJS) @testobjs@ - $(AR) $(ARFLAGS) $@ $(COMMON_OBJS) $(@platf...@_objs) $(ZLIB_OBJS) @testobjs@ +$(STATICLIB): $(PPORT_OBJS) $(COMMON_OBJS) $(@platf...@_objs) $(REGEX_OBJS) $(ZLIB_OBJS) @testobjs@ + $(AR) $(ARFLAGS) $@ $(COMMON_OBJS) $(@platf...@_objs) $(REGEX_OBJS) $(ZLIB_OBJS) @testobjs@ $(RANLIB) $@ -$(SHAREDLIB): $(PPORT_OBJS) $(COMMON_OBJS) $(@platf...@_objs) $(ZLIB_OBJS) @testobjs@ $(STATICLIB) - $(CC) $(SHFLAGS) $(PPORT_OBJS) $(COMMON_OBJS) $(@platf...@_objs) $(ZLIB_OBJS) @testobjs@ $(LDFLAGS) -o $@ +$(SHAREDLIB): $(PPORT_OBJS) $(COMMON_OBJS) $(@platf...@_objs) $(REGEX_OBJS) $(ZLIB_OBJS) @testobjs@ $(STATICLIB) + $(CC) $(SHFLAGS) $(PPORT_OBJS) $(COMMON_OBJS) $(@platf...@_objs) $(REGEX_OBJS) $(ZLIB_OBJS) @testobjs@ $(LDFLAGS) -o $@ $(SSLMODLIB): $(SHAREDLIB) $(OPENSSL_OBJS) $(CC) $(EXLFLAGS) $(SHFLAGS) $(OPENSSL_OBJS) $(LDFLAGS) $(SSLFLAGS) -L. -l$(NAME) -o $@ Modified: commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in?rev=807635r1=807634r2=807635view=diff == --- commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in (original) +++ commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in Tue Aug 25 13:57:05 2009 @@ -128,6 +128,12 @@ $(SRCDIR)/port/strlcpy.$(OBJ) \ $(SRCDIR)/port/strsignal.$(OBJ) +REGEX_OBJS=\ + $(SRCDIR)/srclib/regex/regcomp.$(OBJ) \ + $(SRCDIR)/srclib/regex/regerror.$(OBJ) \ + $(SRCDIR)/srclib/regex/regexec.$(OBJ) \ + $(SRCDIR)/srclib/regex/regfree.$(OBJ) + ZLIB_OBJS=\ $(SRCDIR)/srclib/zlib/adler32.$(OBJ) \ $(SRCDIR)/srclib/zlib/compress.$(OBJ) \ @@ -159,6 +165,9 @@ {$(SRCDIR)\os\win32}.c{$(SRCDIR)\os\win32}.$(OBJ): $(CC) $(CFLAGS) $(CPPFLAGS) -DACR_DECLARE_EXPORT $(INCLUDES) -c -Fo$@ -Fd$(LIBNAME)-src $ +{$(SRCDIR)\srclib\regex}.c{$(SRCDIR)\srclib\regex}.$(OBJ): + $(CC) $(CFLAGS)
svn commit: r807655 - in /commons/sandbox/runtime/trunk/src/main/native: ./ include/arch/darwin/ include/arch/hpux/ include/arch/linux/ include/arch/solaris/ include/arch/unix/ include/arch/windows/ o
Author: mturk Date: Tue Aug 25 14:44:10 2009 New Revision: 807655 URL: http://svn.apache.org/viewvc?rev=807655view=rev Log: Add fnmatch to the port layer Added: commons/sandbox/runtime/trunk/src/main/native/port/fnmatch.c (with props) Modified: commons/sandbox/runtime/trunk/src/main/native/Makefile.in commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in commons/sandbox/runtime/trunk/src/main/native/include/arch/darwin/acr_arch_private.h commons/sandbox/runtime/trunk/src/main/native/include/arch/hpux/acr_arch_private.h commons/sandbox/runtime/trunk/src/main/native/include/arch/linux/acr_arch_private.h commons/sandbox/runtime/trunk/src/main/native/include/arch/solaris/acr_arch_private.h commons/sandbox/runtime/trunk/src/main/native/include/arch/unix/acr_arch.h commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch_private.h commons/sandbox/runtime/trunk/src/main/native/os/unix/pmutex.c commons/sandbox/runtime/trunk/src/main/native/os/unix/psema.c commons/sandbox/runtime/trunk/src/main/native/os/unix/temps.c commons/sandbox/runtime/trunk/src/main/native/os/win32/wutil.c commons/sandbox/runtime/trunk/src/main/native/shared/error.c commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regcomp.c commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regerror.c commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regexec.c Modified: commons/sandbox/runtime/trunk/src/main/native/Makefile.in URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/Makefile.in?rev=807655r1=807654r2=807655view=diff == --- commons/sandbox/runtime/trunk/src/main/native/Makefile.in (original) +++ commons/sandbox/runtime/trunk/src/main/native/Makefile.in Tue Aug 25 14:44:10 2009 @@ -202,6 +202,7 @@ $(SRCDIR)/os/hpux/os.$(OBJ) PPORT_OBJS=\ + $(SRCDIR)/port/fnmatch.$(OBJ) \ $(SRCDIR)/port/rijndael.$(OBJ) \ $(SRCDIR)/port/strlcat.$(OBJ) \ $(SRCDIR)/port/strlcpy.$(OBJ) \ Modified: commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in?rev=807655r1=807654r2=807655view=diff == --- commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in (original) +++ commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in Tue Aug 25 14:44:10 2009 @@ -123,6 +123,7 @@ $(SRCDIR)/os/win32/wusec.$(OBJ) PPORT_OBJS=\ + $(SRCDIR)/port/fnmatch.$(OBJ) \ $(SRCDIR)/port/rijndael.$(OBJ) \ $(SRCDIR)/port/strlcat.$(OBJ) \ $(SRCDIR)/port/strlcpy.$(OBJ) \ Modified: commons/sandbox/runtime/trunk/src/main/native/include/arch/darwin/acr_arch_private.h URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/arch/darwin/acr_arch_private.h?rev=807655r1=807654r2=807655view=diff == --- commons/sandbox/runtime/trunk/src/main/native/include/arch/darwin/acr_arch_private.h (original) +++ commons/sandbox/runtime/trunk/src/main/native/include/arch/darwin/acr_arch_private.h Tue Aug 25 14:44:10 2009 @@ -25,6 +25,7 @@ #include mach/machine.h #include mach-o/arch.h #include signal.h +#include fnmatch.h #ifdef __cplusplus extern C { Modified: commons/sandbox/runtime/trunk/src/main/native/include/arch/hpux/acr_arch_private.h URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/arch/hpux/acr_arch_private.h?rev=807655r1=807654r2=807655view=diff == --- commons/sandbox/runtime/trunk/src/main/native/include/arch/hpux/acr_arch_private.h (original) +++ commons/sandbox/runtime/trunk/src/main/native/include/arch/hpux/acr_arch_private.h Tue Aug 25 14:44:10 2009 @@ -44,6 +44,7 @@ #define ACR_WANT_STRSIGNAL 1 #define ACR_WANT_STRLCAT1 #define ACR_WANT_STRLCPY1 +#define ACR_WANT_FNMATCH1 /** * Temporary APR flags Modified: commons/sandbox/runtime/trunk/src/main/native/include/arch/linux/acr_arch_private.h URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/arch/linux/acr_arch_private.h?rev=807655r1=807654r2=807655view=diff == --- commons/sandbox/runtime/trunk/src/main/native/include/arch/linux/acr_arch_private.h (original) +++ commons/sandbox/runtime/trunk/src/main/native/include/arch/linux/acr_arch_private.h Tue Aug 25 14:44:10 2009 @@ -21,6 +21,7 @@ */ #include sys/stat.h #include sys/utsname.h
svn commit: r807658 - in /commons/sandbox/runtime/trunk/src/main/native: include/acr_port.h include/acr_private.h port/strsignal.c
Author: mturk Date: Tue Aug 25 14:50:53 2009 New Revision: 807658 URL: http://svn.apache.org/viewvc?rev=807658view=rev Log: Add port header instead repeting in acr_arch Added: commons/sandbox/runtime/trunk/src/main/native/include/acr_port.h (with props) Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr_private.h commons/sandbox/runtime/trunk/src/main/native/port/strsignal.c Added: commons/sandbox/runtime/trunk/src/main/native/include/acr_port.h URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr_port.h?rev=807658view=auto == --- commons/sandbox/runtime/trunk/src/main/native/include/acr_port.h (added) +++ commons/sandbox/runtime/trunk/src/main/native/include/acr_port.h Tue Aug 25 14:50:53 2009 @@ -0,0 +1,56 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the License); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _ACR_PORT_H +#define _ACR_PORT_H + +#include acr_arch.h + +#define UNUSED_SOURCE_FILE(F) \ +const char __provided_##F [] = Using system provided #F () + +/** + * Function prototypes for the portable layer + */ + +#if defined(ACR_WANT_STRSIGNAL) +char *strsignal(int); +#endif +#if defined(ACR_WANT_STRLCAT) +size_t strlcat(char *, const char *, size_t); +#endif +#if defined(ACR_WANT_STRLCPY) +size_t strlcpy(char *, const char *, size_t); +#endif + +#if defined(ACR_WANT_FNMATCH) +#define FNM_NOMATCH1/* Match failed. */ +#define FNM_NOSYS 2/* Function not supported (unused). */ + +#define FNM_NOESCAPE0x01/* Disable backslash escaping. */ +#define FNM_PATHNAME0x02/* Slash must be matched by slash. */ +#define FNM_PERIOD 0x04/* Period must be matched by period. */ + +#define FNM_LEADING_DIR 0x08/* Ignore /tail after Imatch. */ +#define FNM_CASEFOLD0x10/* Case insensitive search. */ +#define FNM_IGNORECASE FNM_CASEFOLD +#define FNM_FILE_NAME FNM_PATHNAME + +int fnmatch(const char *, const char *, int); +#endif + +#endif /* _ACR_PORT_H */ + Propchange: commons/sandbox/runtime/trunk/src/main/native/include/acr_port.h -- svn:eol-style = native Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr_private.h URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr_private.h?rev=807658r1=807657r2=807658view=diff == --- commons/sandbox/runtime/trunk/src/main/native/include/acr_private.h (original) +++ commons/sandbox/runtime/trunk/src/main/native/include/acr_private.h Tue Aug 25 14:50:53 2009 @@ -273,10 +273,6 @@ #define J2W(V) _w##V #define J2S(V) _c##V - -#define UNUSED_SOURCE_FILE(F) \ -const char __unused_##F [] = unused #F .c - #if CC_SIZEOF_VOIDP == 8 typedef jlong jniptr; #define P2N(P) ((jlong)LLT(P)) Modified: commons/sandbox/runtime/trunk/src/main/native/port/strsignal.c URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/port/strsignal.c?rev=807658r1=807657r2=807658view=diff == --- commons/sandbox/runtime/trunk/src/main/native/port/strsignal.c (original) +++ commons/sandbox/runtime/trunk/src/main/native/port/strsignal.c Tue Aug 25 14:50:53 2009 @@ -23,7 +23,7 @@ #include acr.h #include acr_private.h -#include acr_arch.h +#include acr_port.h #if defined(ACR_WANT_STRSIGNAL)
svn commit: r807659 - /commons/sandbox/runtime/trunk/src/main/native/port/fnmatch.c
Author: mturk Date: Tue Aug 25 14:53:24 2009 New Revision: 807659 URL: http://svn.apache.org/viewvc?rev=807659view=rev Log: Although not reached some compilers issue a warning Modified: commons/sandbox/runtime/trunk/src/main/native/port/fnmatch.c Modified: commons/sandbox/runtime/trunk/src/main/native/port/fnmatch.c URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/port/fnmatch.c?rev=807659r1=807658r2=807659view=diff == --- commons/sandbox/runtime/trunk/src/main/native/port/fnmatch.c (original) +++ commons/sandbox/runtime/trunk/src/main/native/port/fnmatch.c Tue Aug 25 14:53:24 2009 @@ -93,7 +93,7 @@ char *newp; char c, test; -for (stringstart = string;;) +for (stringstart = string;;) { switch (c = *pattern++) { case EOS: if ((flags FNM_LEADING_DIR) *string == '/') @@ -183,7 +183,9 @@ ++string; break; } +} /* NOTREACHED */ +return (FNM_NOMATCH); } static int
svn commit: r807672 - in /commons/sandbox/runtime/trunk/src/main/native/srclib/regex: COPYRIGHT cclass.h cname.h engine.c re_comp.h regerror.c regex.h regex2.h regexec.c regfree.c utils.h
Author: mturk Date: Tue Aug 25 15:40:22 2009 New Revision: 807672 URL: http://svn.apache.org/viewvc?rev=807672view=rev Log: Use COPYRIGHT file for regex Added: commons/sandbox/runtime/trunk/src/main/native/srclib/regex/COPYRIGHT (with props) Removed: commons/sandbox/runtime/trunk/src/main/native/srclib/regex/cname.h Modified: commons/sandbox/runtime/trunk/src/main/native/srclib/regex/cclass.h commons/sandbox/runtime/trunk/src/main/native/srclib/regex/engine.c commons/sandbox/runtime/trunk/src/main/native/srclib/regex/re_comp.h commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regerror.c commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regex.h commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regex2.h commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regexec.c commons/sandbox/runtime/trunk/src/main/native/srclib/regex/regfree.c commons/sandbox/runtime/trunk/src/main/native/srclib/regex/utils.h Added: commons/sandbox/runtime/trunk/src/main/native/srclib/regex/COPYRIGHT URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/srclib/regex/COPYRIGHT?rev=807672view=auto == --- commons/sandbox/runtime/trunk/src/main/native/srclib/regex/COPYRIGHT (added) +++ commons/sandbox/runtime/trunk/src/main/native/srclib/regex/COPYRIGHT Tue Aug 25 15:40:22 2009 @@ -0,0 +1,20 @@ +Copyright 1992, 1993, 1994 Henry Spencer. All rights reserved. +This software is not subject to any license of the American Telephone +and Telegraph Company or of the Regents of the University of California. + +Permission is granted to anyone to use this software for any purpose on +any computer system, and to alter it and redistribute it, subject +to the following restrictions: + +1. The author is not responsible for the consequences of use of this + software, no matter how awful, even if they arise from flaws in it. + +2. The origin of this software must not be misrepresented, either by + explicit claim or by omission. Since few users ever read sources, + credits must appear in the documentation. + +3. Altered versions must be plainly marked as such, and must not be + misrepresented as being the original software. Since few users + ever read sources, credits must appear in the documentation. + +4. This notice may not be removed or altered. Propchange: commons/sandbox/runtime/trunk/src/main/native/srclib/regex/COPYRIGHT -- svn:eol-style = native Modified: commons/sandbox/runtime/trunk/src/main/native/srclib/regex/cclass.h URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/srclib/regex/cclass.h?rev=807672r1=807671r2=807672view=diff == --- commons/sandbox/runtime/trunk/src/main/native/srclib/regex/cclass.h (original) +++ commons/sandbox/runtime/trunk/src/main/native/srclib/regex/cclass.h Tue Aug 25 15:40:22 2009 @@ -1,38 +1,20 @@ -/*- - * Copyright (c) 1992, 1993, 1994 Henry Spencer. - * Copyright (c) 1992, 1993, 1994 - * The Regents of the University of California. All rights reserved. +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the License); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * This code is derived from software contributed to Berkeley by - * Henry Spencer. + * http://www.apache.org/licenses/LICENSE-2.0 * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - *notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - *notice, this list of conditions and the following disclaimer in the - *documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - *may be used to endorse or promote products derived from this software - *without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT
svn commit: r807675 - /commons/sandbox/runtime/trunk/LICENSE.txt
Author: mturk Date: Tue Aug 25 15:45:32 2009 New Revision: 807675 URL: http://svn.apache.org/viewvc?rev=807675view=rev Log: Update LICENSE with licensed subcomponents (just like for Apache Httpd) Modified: commons/sandbox/runtime/trunk/LICENSE.txt Modified: commons/sandbox/runtime/trunk/LICENSE.txt URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/LICENSE.txt?rev=807675r1=807674r2=807675view=diff == --- commons/sandbox/runtime/trunk/LICENSE.txt (original) +++ commons/sandbox/runtime/trunk/LICENSE.txt Tue Aug 25 15:45:32 2009 @@ -1,4 +1,3 @@ - Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -200,3 +199,178 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + + +APACHE COMMONS RUNTIME SUBCOMPONENTS: + +The Apache HTTP Server includes a number of subcomponents with +separate copyright notices and license terms. Your use of the source +code for the these subcomponents is subject to the terms and +conditions of the following licenses. + + +For the MD5 Message-Digest library component: + + Copyright (C) 1995, Board of Trustees of the University of Illinois + + * + + (C) Copyright 1993,1994 by Carnegie Mellon University + All Rights Reserved. + + Permission to use, copy, modify, distribute, and sell this software + and its documentation for any purpose is hereby granted without + fee, provided that the above copyright notice appear in all copies + and that both that copyright notice and this permission notice + appear in supporting documentation, and that the name of Carnegie + Mellon University not be used in advertising or publicity + pertaining to distribution of the software without specific, + written prior permission. Carnegie Mellon University makes no + representations about the suitability of this software for any + purpose. It is provided as is without express or implied + warranty. + + CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO + THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE + FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + SOFTWARE. + + * + + Copyright (c) 1991 Bell Communications Research, Inc. (Bellcore) + + Permission to use, copy, modify, and distribute this material + for any purpose and without fee is hereby granted, provided + that the above copyright notice and this permission notice + appear in all copies, and that the name of Bellcore not be + used in advertising or publicity pertaining to this + material without the specific, prior written permission + of an authorized representative of Bellcore. BELLCORE + MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY + OF THIS MATERIAL FOR ANY PURPOSE. IT IS PROVIDED AS IS, + WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. + + * + + Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All + rights reserved. + + License to copy and use this software is granted provided that it + is identified as the RSA Data Security, Inc. MD5 Message-Digest + Algorithm in all material mentioning or referencing this software + or this function. + + License is also granted to make and use derivative works provided + that such works are identified as derived from the RSA Data + Security, Inc. MD5 Message-Digest Algorithm in all material + mentioning or referencing the derived work. + + RSA Data Security, Inc. makes no representations concerning either + the merchantability of this software or the suitability of this + software for any particular purpose. It is provided as is + without express or implied warranty of any kind. + + These notices must be retained in any copies of any part of this + documentation and/or software. + + + THE BEER-WARE LICENSE (Revision 42): + p...@login.dknet.dk wrote this file. As long as you retain this notice you + can do whatever you want with this stuff. If we meet some day, and you think + this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp + + + +For the regex library component: + + Copyright 1992, 1993, 1994
svn commit: r807680 - /commons/sandbox/runtime/trunk/src/main/native/srclib/regex/cname.h
Author: mturk Date: Tue Aug 25 15:55:43 2009 New Revision: 807680 URL: http://svn.apache.org/viewvc?rev=807680view=rev Log: Bring back cname.h Added: commons/sandbox/runtime/trunk/src/main/native/srclib/regex/cname.h (with props) Added: commons/sandbox/runtime/trunk/src/main/native/srclib/regex/cname.h URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/srclib/regex/cname.h?rev=807680view=auto == --- commons/sandbox/runtime/trunk/src/main/native/srclib/regex/cname.h (added) +++ commons/sandbox/runtime/trunk/src/main/native/srclib/regex/cname.h Tue Aug 25 15:55:43 2009 @@ -0,0 +1,119 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the License); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* character-name table */ +static struct cname { +char *name; +char code; +} cnames[] = { +{ NUL,'\0' }, +{ SOH,'\001' }, +{ STX,'\002' }, +{ ETX,'\003' }, +{ EOT,'\004' }, +{ ENQ,'\005' }, +{ ACK,'\006' }, +{ BEL,'\007' }, +{ alert, '\007' }, +{ BS, '\010' }, +{ backspace,'\b' }, +{ HT, '\011' }, +{ tab, '\t' }, +{ LF, '\012' }, +{ newline, '\n' }, +{ VT, '\013' }, +{ vertical-tab, '\v' }, +{ FF, '\014' }, +{ form-feed,'\f' }, +{ CR, '\015' }, +{ carriage-return, '\r' }, +{ SO, '\016' }, +{ SI, '\017' }, +{ DLE,'\020' }, +{ DC1,'\021' }, +{ DC2,'\022' }, +{ DC3,'\023' }, +{ DC4,'\024' }, +{ NAK,'\025' }, +{ SYN,'\026' }, +{ ETB,'\027' }, +{ CAN,'\030' }, +{ EM, '\031' }, +{ SUB,'\032' }, +{ ESC,'\033' }, +{ IS4,'\034' }, +{ FS, '\034' }, +{ IS3,'\035' }, +{ GS, '\035' }, +{ IS2,'\036' }, +{ RS, '\036' }, +{ IS1,'\037' }, +{ US, '\037' }, +{ space, ' ' }, +{ exclamation-mark, '!' }, +{ quotation-mark,'' }, +{ number-sign, '#' }, +{ dollar-sign, '$' }, +{ percent-sign, '%' }, +{ ampersand, '' }, +{ apostrophe, '\'' }, +{ left-parenthesis, '(' }, +{ right-parenthesis, ')' }, +{ asterisk, '*' }, +{ plus-sign, '+' }, +{ comma, ',' }, +{ hyphen,'-' }, +{ hyphen-minus, '-' }, +{ period,'.' }, +{ full-stop, '.' }, +{ slash, '/' }, +{ solidus, '/' }, +{ zero, '0' }, +{ one, '1' }, +{ two, '2' }, +{ three, '3' }, +{ four, '4' }, +{ five, '5' }, +{ six, '6' }, +{ seven, '7' }, +{ eight, '8' }, +{ nine, '9' }, +{ colon, ':' }, +{ semicolon, ';' }, +{ less-than-sign,'' }, +{ equals-sign, '=' }, +{ greater-than-sign, '' }, +{ question-mark, '?' }, +{ commercial-at, '@' }, +{ left-square-bracket,'[' }, +{ backslash, '\\' }, +{ reverse-solidus, '\\' }, +{ right-square-bracket, ']' }, +{ circumflex, '^' }, +{ circumflex-accent, '^' }, +{ underscore, '_' }, +{ low-line, '_' }, +{ grave-accent, '`' }, +{ left-brace, '{' }, +{ left-curly-bracket, '{' }, +{ vertical-line, '|' }, +{ right-brace,'}' }, +{ right-curly-bracket,'}' }, +{ tilde, '~' }, +{ DEL, '\177' }, +{ NULL, 0 } +}; + Propchange: commons/sandbox/runtime/trunk/src/main/native/srclib/regex/cname.h
svn commit: r807738 - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math/optimization/linear/SimplexSolver.java site/xdoc/changes.xml test/java/org/apache/commons/math/optimization/l
Author: luc Date: Tue Aug 25 18:07:13 2009 New Revision: 807738 URL: http://svn.apache.org/viewvc?rev=807738view=rev Log: fixed an error induced by zero entries in simplex solver JIRA: MATH-288 Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/linear/SimplexSolver.java commons/proper/math/trunk/src/site/xdoc/changes.xml commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/linear/SimplexSolverTest.java Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/linear/SimplexSolver.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/linear/SimplexSolver.java?rev=807738r1=807737r2=807738view=diff == --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/linear/SimplexSolver.java (original) +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/optimization/linear/SimplexSolver.java Tue Aug 25 18:07:13 2009 @@ -77,9 +77,10 @@ double minRatio = Double.MAX_VALUE; Integer minRatioPos = null; for (int i = tableau.getNumObjectiveFunctions(); i tableau.getHeight(); i++) { -double rhs = tableau.getEntry(i, tableau.getWidth() - 1); -if (MathUtils.compareTo(tableau.getEntry(i, col), 0, epsilon) = 0) { -double ratio = rhs / tableau.getEntry(i, col); +final double rhs = tableau.getEntry(i, tableau.getWidth() - 1); +final double entry = tableau.getEntry(i, col); +if (MathUtils.compareTo(entry, 0, epsilon) 0) { +final double ratio = rhs / entry; if (ratio minRatio) { minRatio = ratio; minRatioPos = i; Modified: commons/proper/math/trunk/src/site/xdoc/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdoc/changes.xml?rev=807738r1=807737r2=807738view=diff == --- commons/proper/math/trunk/src/site/xdoc/changes.xml (original) +++ commons/proper/math/trunk/src/site/xdoc/changes.xml Tue Aug 25 18:07:13 2009 @@ -39,6 +39,9 @@ /properties body release version=2.1 date=TBD description=TBD + action dev=luc type=fix issue=MATH-288 due-to=Benjamin McCann +Fixed an error induced by entries set to 0 + /action action dev=luc type=fix issue=MATH-286 due-to=Benjamin McCann Fixed an error leading the simplex solver to compute the right solution but return another one Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/linear/SimplexSolverTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/linear/SimplexSolverTest.java?rev=807738r1=807737r2=807738view=diff == --- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/linear/SimplexSolverTest.java (original) +++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/linear/SimplexSolverTest.java Tue Aug 25 18:07:13 2009 @@ -57,7 +57,22 @@ RealPointValuePair solution = new SimplexSolver().optimize(f, constraints, GoalType.MAXIMIZE, true); assertEquals(6.9, solution.getValue(), .001); } - + +@Test +public void testMath288() throws OptimizationException { +LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { 7, 3, 0, 0 }, 0 ); +CollectionLinearConstraint constraints = new ArrayListLinearConstraint(); +constraints.add(new LinearConstraint(new double[] { 3, 0, -5, 0 }, Relationship.LEQ, 0.0)); +constraints.add(new LinearConstraint(new double[] { 2, 0, 0, -5 }, Relationship.LEQ, 0.0)); +constraints.add(new LinearConstraint(new double[] { 0, 3, 0, -5 }, Relationship.LEQ, 0.0)); +constraints.add(new LinearConstraint(new double[] { 1, 0, 0, 0 }, Relationship.LEQ, 1.0)); +constraints.add(new LinearConstraint(new double[] { 0, 1, 0, 0 }, Relationship.LEQ, 1.0)); + +SimplexSolver solver = new SimplexSolver(); +RealPointValuePair solution = solver.optimize(f, constraints, GoalType.MAXIMIZE, true); +assertEquals(10.0, solution.getValue(), .001); +} + @Test public void testSimplexSolver() throws OptimizationException { LinearObjectiveFunction f =