Don't try and create symbolic links on platforms that don't support symlink()
authorJ. Ali Harlow <ali@juiblex.co.uk>
Thu Jan 08 13:51:07 2009 +0000 (2009-01-08)
changeset 327c85643dd7164
parent 326 e2ddf497b914
child 328 45ea57d83f28
Don't try and create symbolic links on platforms that don't support symlink()
configure.ac
librazor/rpm.c
     1.1 --- a/configure.ac	Wed Jan 07 18:00:06 2009 +0000
     1.2 +++ b/configure.ac	Thu Jan 08 13:51:07 2009 +0000
     1.3 @@ -24,6 +24,7 @@
     1.4  AC_HEADER_STDC
     1.5  AC_CHECK_HEADERS([sys/mman.h])
     1.6  gl_INIT
     1.7 +AC_CHECK_FUNCS([symlink])
     1.8  AM_PROG_LIBTOOL
     1.9  AC_PROG_MAKE_SET
    1.10  AC_PROG_LN_S
     2.1 --- a/librazor/rpm.c	Wed Jan 07 18:00:06 2009 +0000
     2.2 +++ b/librazor/rpm.c	Thu Jan 08 13:51:07 2009 +0000
     2.3 @@ -17,6 +17,8 @@
     2.4   * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
     2.5   */
     2.6  
     2.7 +#include "config.h"
     2.8 +
     2.9  #include <stdio.h>
    2.10  #include <stddef.h>
    2.11  #include <stdlib.h>
    2.12 @@ -530,13 +532,8 @@
    2.13  			return -1;
    2.14  		}
    2.15  		return 0;
    2.16 -	case PIPE:
    2.17 -	case CDEV:
    2.18 -	case BDEV:
    2.19 -	case SOCK:
    2.20 -		printf("%s: unhandled file type %d\n", buffer, mode >> 12);
    2.21 -		return 0;
    2.22  	case LINK:
    2.23 +#if HAVE_SYMLINK
    2.24  		if (installer_inflate(installer)) {
    2.25  			fprintf(stderr, "failed to inflate\n");
    2.26  			return -1;
    2.27 @@ -551,6 +548,15 @@
    2.28  			return -1;
    2.29  		}
    2.30  		return 0;
    2.31 +#else
    2.32 +		/* fall through */
    2.33 +#endif
    2.34 +	case PIPE:
    2.35 +	case CDEV:
    2.36 +	case BDEV:
    2.37 +	case SOCK:
    2.38 +		printf("%s: unhandled file type %d\n", buffer, mode >> 12);
    2.39 +		return 0;
    2.40  	default:
    2.41  		printf("%s: unknown file type %d\n", buffer, mode >> 12);
    2.42  		return 0;