[PHP-CVS] cvs: php4 /ext/mime_magic config.m4

2003-03-31 Thread Moriyoshi Koizumi
moriyoshi   Mon Mar 31 14:48:53 2003 EDT

  Modified files:  
/php4/ext/mime_magicconfig.m4 
  Log:
  Rearranged search order for the magic file to avoid further confusions
  
  
Index: php4/ext/mime_magic/config.m4
diff -u php4/ext/mime_magic/config.m4:1.9 php4/ext/mime_magic/config.m4:1.10
--- php4/ext/mime_magic/config.m4:1.9   Tue Jan 28 01:52:09 2003
+++ php4/ext/mime_magic/config.m4   Mon Mar 31 14:48:53 2003
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.9 2003/01/28 06:52:09 sniper Exp $
+dnl $Id: config.m4,v 1.10 2003/03/31 19:48:53 moriyoshi Exp $
 dnl
 
 PHP_ARG_WITH(mime-magic, whether to include mime_magic support,
@@ -22,7 +22,7 @@
   AC_MSG_ERROR([File '$PHP_MIME_MAGIC' not found!])
 fi
   else
-MAGIC_MIME_LOCATIONS="/usr/share/magic.mime /usr/share/misc/magic.mime 
/etc/magic.mime"
+MAGIC_MIME_LOCATIONS="/usr/local/apache/conf/magic 
/usr/local/etc/apache/conf/magic /etc/apache/magic /etc/httpd/conf/magic 
/usr/share/magic.mime /usr/share/misc/magic.mime /etc/magic.mime"
 
 for i in $MAGIC_MIME_LOCATIONS; do
   if test -f $i; then



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php4 /ext/mime_magic config.m4

2003-01-27 Thread Jani Taskinen

Yeah, that was a typo. :)

--Jani


On Tue, 28 Jan 2003, Marcus Börger wrote:

>At 02:00 28.01.2003, Jani Taskinen wrote:
>>sniper  Mon Jan 27 20:00:16 2003 EDT
>>
>>   Modified files:
>> /php4/ext/mime_magicconfig.m4
>>   Log:
>>   - Cleaned up and made less error-prone
>>   - Changed --enable-mime-magic -> --with-mime-magic[=FILE] to allow
>> specifying of the file during configure.
>>
>>
>>Index: php4/ext/mime_magic/config.m4
>>diff -u php4/ext/mime_magic/config.m4:1.7 php4/ext/mime_magic/config.m4:1.8
>>--- php4/ext/mime_magic/config.m4:1.7   Sat Jan 25 05:51:04 2003
>>+++ php4/ext/mime_magic/config.m4   Mon Jan 27 20:00:15 2003
>>@@ -1,28 +1,37 @@
>>-dnl $Id: config.m4,v 1.7 2003/01/25 10:51:04 hholzgra Exp $
>>-dnl config.m4 for extension mime_magic
>>+dnl
>>+dnl $Id: config.m4,v 1.8 2003/01/28 01:00:15 sniper Exp $
>>+dnl
>>
>>-PHP_ARG_ENABLE(mime-magic, whether to enable mime_magic support,
>>-[  --enable-mime-magic Enable mime_magic support])
>>+PHP_ARG_WITH(mime-magic, whether to include mime_magic support,
>>+[  --with-mime-magic[=FILE]  Include mime_magic support. FILE is the optional
>>+pathname to the magic.mime file.])
>>
>>-if test "$PHP_MIME_MAGIC" = "yes"; then
>>-  dnl PHP_SUBST(MIME_MAGIC_SHARED_LIBADD)
>>+if test "$PHP_MIME_MAGIC" != "no"; then
>>
>>PHP_NEW_EXTENSION(mime_magic, mime_magic.c, $ext_shared)
>>
>>-  # Try to see if we can find the path of the magic file in its
>>-  # default locations.
>>-  if test -f /usr/share/magic.mime ; then
>>-   PHP_MIME_MAGIC_FILE_PATH=/usr/share/magic.mime
>>-  elif test -f /usr/share/magic ; then
>>-   PHP_MIME_MAGIC_FILE_PATH=/usr/share/magic
>>-  elif test -f /usr/share/misc/magic.mime ; then
>>-   PHP_MIME_MAGIC_FILE_PATH=/usr/share/misc/magic.mime
>>-  elif test -f /etc/magic ; then
>>-   PHP_MIME_MAGIC_FILE_PATH=/etc/magic.mime
>>+  PHP_MIME_MAGIC_FILE_PATH=
>>+
>>+  dnl
>>+  dnl Try to see if we can find the path of the magic file in its default 
>>locations.
>>+  dnl
>>+  if test "$PHP_MIME_MAGIC" = "yes"; then
>>+if test -f $PHP_MIME_MAGIC; then
>>+  PHP_MIME_MAGIC_FILE_PATH=$PHP_MIME_MAGIC
>>+else
>>+  AC_MSG_ERROR([File '$PHP_MIME_MAGIC' not found!])
>>+fi
>>else
>>-   PHP_MIME_MAGIC_FILE_PATH=""
>>-  fi
>>+MAGIC_MIME_LOCATIONS="/usr/share/magic.mime 
>>/usr/share/misc/magic.mime /etc/magic.mime"
>>
>>+for i in $MAGIC_MIME_LOCATIONS; do
>>+  if test -f $i; then
>>+PHP_MIME_MAGIC_FILE_PATH=$i
>>+break
>>+  fi
>>+done
>>+  fi
>>+
>> 
>>AC_DEFINE_UNQUOTED(PHP_MIME_MAGIC_FILE_PATH,"$PHP_MIME_MAGIC_FILE_PATH",[magic 
>>file path])
>>
>>  fi
>
>
>As far as i understand that code you are looking for a file called "yes" now.
>
>I guess you meant if the configure value is neither yes nor no search for 
>that beeing a file.
>With check against no already done this looks like "!=" instead of "=":
>   if test "$PHP_MIME_MAGIC" != "yes"; then
> if test -f $PHP_MIME_MAGIC; then
>

-- 
<- For Sale! ->


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/mime_magic config.m4

2003-01-27 Thread Jani Taskinen
sniper  Tue Jan 28 01:52:09 2003 EDT

  Modified files:  
/php4/ext/mime_magicconfig.m4 
  Log:
  fix typo
  
Index: php4/ext/mime_magic/config.m4
diff -u php4/ext/mime_magic/config.m4:1.8 php4/ext/mime_magic/config.m4:1.9
--- php4/ext/mime_magic/config.m4:1.8   Mon Jan 27 20:00:15 2003
+++ php4/ext/mime_magic/config.m4   Tue Jan 28 01:52:09 2003
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.8 2003/01/28 01:00:15 sniper Exp $
+dnl $Id: config.m4,v 1.9 2003/01/28 06:52:09 sniper Exp $
 dnl
 
 PHP_ARG_WITH(mime-magic, whether to include mime_magic support,
@@ -15,7 +15,7 @@
   dnl
   dnl Try to see if we can find the path of the magic file in its default locations.
   dnl
-  if test "$PHP_MIME_MAGIC" = "yes"; then
+  if test "$PHP_MIME_MAGIC" != "yes"; then
 if test -f $PHP_MIME_MAGIC; then
   PHP_MIME_MAGIC_FILE_PATH=$PHP_MIME_MAGIC
 else



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-CVS] cvs: php4 /ext/mime_magic config.m4

2003-01-27 Thread Marcus Börger
At 02:00 28.01.2003, Jani Taskinen wrote:

sniper  Mon Jan 27 20:00:16 2003 EDT

  Modified files:
/php4/ext/mime_magicconfig.m4
  Log:
  - Cleaned up and made less error-prone
  - Changed --enable-mime-magic -> --with-mime-magic[=FILE] to allow
specifying of the file during configure.


Index: php4/ext/mime_magic/config.m4
diff -u php4/ext/mime_magic/config.m4:1.7 php4/ext/mime_magic/config.m4:1.8
--- php4/ext/mime_magic/config.m4:1.7   Sat Jan 25 05:51:04 2003
+++ php4/ext/mime_magic/config.m4   Mon Jan 27 20:00:15 2003
@@ -1,28 +1,37 @@
-dnl $Id: config.m4,v 1.7 2003/01/25 10:51:04 hholzgra Exp $
-dnl config.m4 for extension mime_magic
+dnl
+dnl $Id: config.m4,v 1.8 2003/01/28 01:00:15 sniper Exp $
+dnl

-PHP_ARG_ENABLE(mime-magic, whether to enable mime_magic support,
-[  --enable-mime-magic Enable mime_magic support])
+PHP_ARG_WITH(mime-magic, whether to include mime_magic support,
+[  --with-mime-magic[=FILE]  Include mime_magic support. FILE is the optional
+pathname to the magic.mime file.])

-if test "$PHP_MIME_MAGIC" = "yes"; then
-  dnl PHP_SUBST(MIME_MAGIC_SHARED_LIBADD)
+if test "$PHP_MIME_MAGIC" != "no"; then

   PHP_NEW_EXTENSION(mime_magic, mime_magic.c, $ext_shared)

-  # Try to see if we can find the path of the magic file in its
-  # default locations.
-  if test -f /usr/share/magic.mime ; then
-   PHP_MIME_MAGIC_FILE_PATH=/usr/share/magic.mime
-  elif test -f /usr/share/magic ; then
-   PHP_MIME_MAGIC_FILE_PATH=/usr/share/magic
-  elif test -f /usr/share/misc/magic.mime ; then
-   PHP_MIME_MAGIC_FILE_PATH=/usr/share/misc/magic.mime
-  elif test -f /etc/magic ; then
-   PHP_MIME_MAGIC_FILE_PATH=/etc/magic.mime
+  PHP_MIME_MAGIC_FILE_PATH=
+
+  dnl
+  dnl Try to see if we can find the path of the magic file in its default 
locations.
+  dnl
+  if test "$PHP_MIME_MAGIC" = "yes"; then
+if test -f $PHP_MIME_MAGIC; then
+  PHP_MIME_MAGIC_FILE_PATH=$PHP_MIME_MAGIC
+else
+  AC_MSG_ERROR([File '$PHP_MIME_MAGIC' not found!])
+fi
   else
-   PHP_MIME_MAGIC_FILE_PATH=""
-  fi
+MAGIC_MIME_LOCATIONS="/usr/share/magic.mime 
/usr/share/misc/magic.mime /etc/magic.mime"

+for i in $MAGIC_MIME_LOCATIONS; do
+  if test -f $i; then
+PHP_MIME_MAGIC_FILE_PATH=$i
+break
+  fi
+done
+  fi
+

AC_DEFINE_UNQUOTED(PHP_MIME_MAGIC_FILE_PATH,"$PHP_MIME_MAGIC_FILE_PATH",[magic 
file path])

 fi


As far as i understand that code you are looking for a file called "yes" now.

I guess you meant if the configure value is neither yes nor no search for 
that beeing a file.
With check against no already done this looks like "!=" instead of "=":
  if test "$PHP_MIME_MAGIC" != "yes"; then
if test -f $PHP_MIME_MAGIC; then


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php4 /ext/mime_magic config.m4

2003-01-27 Thread Jani Taskinen
sniper  Mon Jan 27 20:00:16 2003 EDT

  Modified files:  
/php4/ext/mime_magicconfig.m4 
  Log:
  - Cleaned up and made less error-prone
  - Changed --enable-mime-magic -> --with-mime-magic[=FILE] to allow
specifying of the file during configure.
  
  
Index: php4/ext/mime_magic/config.m4
diff -u php4/ext/mime_magic/config.m4:1.7 php4/ext/mime_magic/config.m4:1.8
--- php4/ext/mime_magic/config.m4:1.7   Sat Jan 25 05:51:04 2003
+++ php4/ext/mime_magic/config.m4   Mon Jan 27 20:00:15 2003
@@ -1,28 +1,37 @@
-dnl $Id: config.m4,v 1.7 2003/01/25 10:51:04 hholzgra Exp $
-dnl config.m4 for extension mime_magic
+dnl
+dnl $Id: config.m4,v 1.8 2003/01/28 01:00:15 sniper Exp $
+dnl
 
-PHP_ARG_ENABLE(mime-magic, whether to enable mime_magic support,
-[  --enable-mime-magic Enable mime_magic support])
+PHP_ARG_WITH(mime-magic, whether to include mime_magic support,
+[  --with-mime-magic[=FILE]  Include mime_magic support. FILE is the optional
+pathname to the magic.mime file.])
 
-if test "$PHP_MIME_MAGIC" = "yes"; then
-  dnl PHP_SUBST(MIME_MAGIC_SHARED_LIBADD)
+if test "$PHP_MIME_MAGIC" != "no"; then
 
   PHP_NEW_EXTENSION(mime_magic, mime_magic.c, $ext_shared)
 
-  # Try to see if we can find the path of the magic file in its 
-  # default locations.
-  if test -f /usr/share/magic.mime ; then
-   PHP_MIME_MAGIC_FILE_PATH=/usr/share/magic.mime
-  elif test -f /usr/share/magic ; then
-   PHP_MIME_MAGIC_FILE_PATH=/usr/share/magic   
-  elif test -f /usr/share/misc/magic.mime ; then
-   PHP_MIME_MAGIC_FILE_PATH=/usr/share/misc/magic.mime
-  elif test -f /etc/magic ; then
-   PHP_MIME_MAGIC_FILE_PATH=/etc/magic.mime
+  PHP_MIME_MAGIC_FILE_PATH=
+
+  dnl
+  dnl Try to see if we can find the path of the magic file in its default locations.
+  dnl
+  if test "$PHP_MIME_MAGIC" = "yes"; then
+if test -f $PHP_MIME_MAGIC; then
+  PHP_MIME_MAGIC_FILE_PATH=$PHP_MIME_MAGIC
+else
+  AC_MSG_ERROR([File '$PHP_MIME_MAGIC' not found!])
+fi
   else
-   PHP_MIME_MAGIC_FILE_PATH="" 
-  fi
+MAGIC_MIME_LOCATIONS="/usr/share/magic.mime /usr/share/misc/magic.mime 
+/etc/magic.mime"
 
+for i in $MAGIC_MIME_LOCATIONS; do
+  if test -f $i; then
+PHP_MIME_MAGIC_FILE_PATH=$i
+break
+  fi
+done
+  fi
+  
   AC_DEFINE_UNQUOTED(PHP_MIME_MAGIC_FILE_PATH,"$PHP_MIME_MAGIC_FILE_PATH",[magic file 
path])
 
 fi



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-CVS] cvs: php4 /ext/mime_magic config.m4

2003-01-27 Thread Marcus Börger
At 10:23 27.01.2003, Jani Taskinen wrote:


It still looks for '/usr/share/magic' file thus
your fix doesn't fix anything.

Attached is a bit better version of the config.m4,
please let me know if it's ok to commit.

--Jani


Looks good to me

marcus


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-CVS] cvs: php4 /ext/mime_magic config.m4

2003-01-27 Thread Jani Taskinen

It still looks for '/usr/share/magic' file thus
your fix doesn't fix anything.
 
Attached is a bit better version of the config.m4,
please let me know if it's ok to commit.

--Jani


On Sat, 25 Jan 2003, Hartmut Holzgraefe wrote:

>hholzgra   Sat Jan 25 05:51:04 2003 EDT
>
>  Modified files:  
>/php4/ext/mime_magic   config.m4 
>  Log:
>  suggesting a plain magic file insteat of a mime one is a bad idea
>  
>  
>Index: php4/ext/mime_magic/config.m4
>diff -u php4/ext/mime_magic/config.m4:1.6 php4/ext/mime_magic/config.m4:1.7
>--- php4/ext/mime_magic/config.m4:1.6  Tue Sep 24 02:37:17 2002
>+++ php4/ext/mime_magic/config.m4  Sat Jan 25 05:51:04 2003
>@@ -1,4 +1,4 @@
>-dnl $Id: config.m4,v 1.6 2002/09/24 06:37:17 sas Exp $
>+dnl $Id: config.m4,v 1.7 2003/01/25 10:51:04 hholzgra Exp $
> dnl config.m4 for extension mime_magic
> 
> PHP_ARG_ENABLE(mime-magic, whether to enable mime_magic support,
>@@ -18,7 +18,7 @@
>   elif test -f /usr/share/misc/magic.mime ; then
>   PHP_MIME_MAGIC_FILE_PATH=/usr/share/misc/magic.mime
>   elif test -f /etc/magic ; then
>-  PHP_MIME_MAGIC_FILE_PATH=/etc/magic
>+  PHP_MIME_MAGIC_FILE_PATH=/etc/magic.mime
>   else
>   PHP_MIME_MAGIC_FILE_PATH="" 
>   fi
>
>
>
>

-- 
<- For Sale! ->

dnl
dnl $Id: config.m4,v 1.7 2003/01/25 10:51:04 hholzgra Exp $
dnl

PHP_ARG_WITH(mime-magic, whether to include mime_magic support,
[  --with-mime-magic[=FILE]  Include mime_magic support. FILE is the optional
pathname to the magic.mime file.])

if test "$PHP_MIME_MAGIC" != "no"; then

  PHP_NEW_EXTENSION(mime_magic, mime_magic.c, $ext_shared)

  PHP_MIME_MAGIC_FILE_PATH=

  dnl
  dnl Try to see if we can find the path of the magic file in its default locations.
  dnl
  if test "$PHP_MIME_MAGIC" = "yes"; then
if test -f $PHP_MIME_MAGIC; then
  PHP_MIME_MAGIC_FILE_PATH=$PHP_MIME_MAGIC
else
  AC_MSG_ERROR([File '$PHP_MIME_MAGIC' not found!])
fi
  else
MAGIC_MIME_LOCATIONS="/usr/share/magic.mime /usr/share/misc/magic.mime 
/etc/magic.mime"

for i in $MAGIC_MIME_LOCATIONS; do
  if test -f $i; then
PHP_MIME_MAGIC_FILE_PATH=$i
break
  fi
done
  fi
  
  AC_DEFINE_UNQUOTED(PHP_MIME_MAGIC_FILE_PATH,"$PHP_MIME_MAGIC_FILE_PATH",[magic file 
path])

fi

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-CVS] cvs: php4 /ext/mime_magic config.m4

2003-01-25 Thread Marcus Börger
At 11:51 25.01.2003, Hartmut Holzgraefe wrote:

hholzgraSat Jan 25 05:51:04 2003 EDT

  Modified files:
/php4/ext/mime_magicconfig.m4
  Log:
  suggesting a plain magic file insteat of a mime one is a bad idea


Index: php4/ext/mime_magic/config.m4
diff -u php4/ext/mime_magic/config.m4:1.6 php4/ext/mime_magic/config.m4:1.7
--- php4/ext/mime_magic/config.m4:1.6   Tue Sep 24 02:37:17 2002
+++ php4/ext/mime_magic/config.m4   Sat Jan 25 05:51:04 2003
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.6 2002/09/24 06:37:17 sas Exp $
+dnl $Id: config.m4,v 1.7 2003/01/25 10:51:04 hholzgra Exp $
 dnl config.m4 for extension mime_magic

 PHP_ARG_ENABLE(mime-magic, whether to enable mime_magic support,
@@ -18,7 +18,7 @@
   elif test -f /usr/share/misc/magic.mime ; then
PHP_MIME_MAGIC_FILE_PATH=/usr/share/misc/magic.mime
   elif test -f /etc/magic ; then
-   PHP_MIME_MAGIC_FILE_PATH=/etc/magic
+   PHP_MIME_MAGIC_FILE_PATH=/etc/magic.mime
   else
PHP_MIME_MAGIC_FILE_PATH=""
   fi



Shouldn't you change the test above to
 elif test -f /etc/magic.mime ; then

marcus


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/mime_magic config.m4

2003-01-25 Thread Hartmut Holzgraefe
hholzgraSat Jan 25 05:51:04 2003 EDT

  Modified files:  
/php4/ext/mime_magicconfig.m4 
  Log:
  suggesting a plain magic file insteat of a mime one is a bad idea
  
  
Index: php4/ext/mime_magic/config.m4
diff -u php4/ext/mime_magic/config.m4:1.6 php4/ext/mime_magic/config.m4:1.7
--- php4/ext/mime_magic/config.m4:1.6   Tue Sep 24 02:37:17 2002
+++ php4/ext/mime_magic/config.m4   Sat Jan 25 05:51:04 2003
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.6 2002/09/24 06:37:17 sas Exp $
+dnl $Id: config.m4,v 1.7 2003/01/25 10:51:04 hholzgra Exp $
 dnl config.m4 for extension mime_magic
 
 PHP_ARG_ENABLE(mime-magic, whether to enable mime_magic support,
@@ -18,7 +18,7 @@
   elif test -f /usr/share/misc/magic.mime ; then
PHP_MIME_MAGIC_FILE_PATH=/usr/share/misc/magic.mime
   elif test -f /etc/magic ; then
-   PHP_MIME_MAGIC_FILE_PATH=/etc/magic
+   PHP_MIME_MAGIC_FILE_PATH=/etc/magic.mime
   else
PHP_MIME_MAGIC_FILE_PATH="" 
   fi



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-CVS] cvs: php4 /ext/mime_magic config.m4

2002-09-23 Thread Sascha Schumann

sas Tue Sep 24 02:37:17 2002 EDT

  Modified files:  
/php4/ext/mime_magicconfig.m4 
  Log:
  Replace underscores with dashes in --enable-mime-magic
  
  
Index: php4/ext/mime_magic/config.m4
diff -u php4/ext/mime_magic/config.m4:1.5 php4/ext/mime_magic/config.m4:1.6
--- php4/ext/mime_magic/config.m4:1.5   Thu Sep 19 16:14:24 2002
+++ php4/ext/mime_magic/config.m4   Tue Sep 24 02:37:17 2002
@@ -1,8 +1,8 @@
-dnl $Id: config.m4,v 1.5 2002/09/19 20:14:24 derick Exp $
+dnl $Id: config.m4,v 1.6 2002/09/24 06:37:17 sas Exp $
 dnl config.m4 for extension mime_magic
 
-PHP_ARG_ENABLE(mime_magic, whether to enable mime_magic support,
-[  --enable-mime_magic Enable mime_magic support])
+PHP_ARG_ENABLE(mime-magic, whether to enable mime_magic support,
+[  --enable-mime-magic Enable mime_magic support])
 
 if test "$PHP_MIME_MAGIC" = "yes"; then
   dnl PHP_SUBST(MIME_MAGIC_SHARED_LIBADD)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php