diff options
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | configure.in | 72 | ||||
-rw-r--r-- | debian/changelog | 5 | ||||
-rw-r--r-- | doc/CHANGES | 6 | ||||
-rw-r--r-- | libattr/libattr.c | 106 |
5 files changed, 129 insertions, 62 deletions
@@ -3,5 +3,5 @@ # PKG_MAJOR=2 PKG_MINOR=4 -PKG_REVISION=1 +PKG_REVISION=2 PKG_BUILD=0 diff --git a/configure.in b/configure.in index dec6cc8..96aec53 100644 --- a/configure.in +++ b/configure.in @@ -58,37 +58,51 @@ test -z "$INSTALL_GROUP" || pkg_group="$INSTALL_GROUP" AC_SUBST(pkg_group) dnl check if user wants their own C compiler -test -z "$CC" && AC_PROG_CC +if test -z "$CC"; then + AC_PROG_CC +fi cc=$CC AC_SUBST(cc) dnl check if users wants their own make -test -z "$MAKE" && AC_PATH_PROG(MAKE, make, /usr/bin/make) +if test -z "$MAKE"; then + AC_PATH_PROG(MAKE, make, /usr/bin/make) +fi make=$MAKE AC_SUBST(make) dnl check if users wants their own linker -test -z "$LD" && AC_PATH_PROG(LD, ld, /usr/bin/ld) +if test -z "$LD"; then + AC_PATH_PROG(LD, ld, /usr/bin/ld) +fi ld=$LD AC_SUBST(ld) dnl check if the tar program is available -test -z "$TAR" && AC_PATH_PROG(TAR, tar) +if test -z "$TAR"; then + AC_PATH_PROG(TAR, tar) +fi tar=$TAR AC_SUBST(tar) dnl check if the gzip program is available -test -z "$ZIP" && AC_PATH_PROG(ZIP, gzip, /bin/gzip) +if test -z "$ZIP"; then + AC_PATH_PROG(ZIP, gzip, /bin/gzip) +fi zip=$ZIP AC_SUBST(zip) dnl check if the makedepend program is available -test -z "$MAKEDEPEND" && AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true) +if test -z "$MAKEDEPEND"; then + AC_PATH_PROG(MAKEDEPEND, makedepend, /bin/true) +fi makedepend=$MAKEDEPEND AC_SUBST(makedepend) dnl check if the rpm program is available -test -z "$RPM" && AC_PATH_PROG(RPM, rpm, /bin/rpm) +if test -z "$RPM"; then + AC_PATH_PROG(RPM, rpm, /bin/rpm) +fi rpm=$RPM AC_SUBST(rpm) @@ -114,19 +128,27 @@ dnl check if symbolic links are supported AC_PROG_LN_S dnl check if user wants their own awk, sed and echo -test -z "$AWK" && AC_PATH_PROG(AWK, awk, /bin/awk) +if test -z "$AWK"; then + AC_PATH_PROG(AWK, awk, /bin/awk) +fi awk=$AWK AC_SUBST(awk) -test -z "$SED" && AC_PATH_PROG(SED, sed, /bin/sed) +if test -z "$SED"; then + AC_PATH_PROG(SED, sed, /bin/sed) +fi sed=$SED AC_SUBST(sed) -test -z "$ECHO" && AC_PATH_PROG(ECHO, echo, /bin/echo) +if test -z "$ECHO"; then + AC_PATH_PROG(ECHO, echo, /bin/echo) +fi echo=$ECHO AC_SUBST(echo) dnl ensure libtool is installed -test -z "$LIBTOOL" && AC_PATH_PROG(LIBTOOL, libtool,,/usr/bin) -if test "$LIBTOOL" = ""; then +if test -z "$LIBTOOL"; then + AC_PATH_PROG(LIBTOOL, libtool,,/usr/bin) +fi +if test -z "$LIBTOOL"; then echo echo 'FATAL ERROR: libtool does not seem to be installed.' echo $pkg_name cannot be built without a working libtool installation. @@ -137,31 +159,38 @@ AC_SUBST(libtool) dnl libtool to build libraries static only? AC_ARG_ENABLE(shared, - [ --enable-shared=[yes/no] Enable use of shared libraries [default=yes]],, +[ --enable-shared=[yes/no] Enable use of shared libraries [default=yes]],, enable_shared=yes) AC_SUBST(enable_shared) dnl will we be making use of gettext? AC_ARG_ENABLE(gettext, - [ --enable-gettext=[yes/no] Enable alternate language support [default=yes]],, +[ --enable-gettext=[yes/no] Enable alternate language support [default=yes]],, enable_gettext=yes) -test $enable_gettext = "yes" && AC_DEFINE(ENABLE_GETTEXT) +if test $enable_gettext = yes; then + AC_DEFINE(ENABLE_GETTEXT) +fi AC_SUBST(enable_gettext) dnl check if the msgfmt, msgmerge, xgettext programs are available if test "$enable_gettext" = yes; then - test -z "$MSGFMT" && AC_CHECK_PROG(MSGFMT, msgfmt, /usr/bin/msgfmt) + if test -z "$MSGFMT"; then + AC_CHECK_PROG(MSGFMT, msgfmt, /usr/bin/msgfmt) + fi msgfmt=$MSGFMT AC_SUBST(msgfmt) - test -z "$MSGMERGE" && AC_CHECK_PROG(MSGMERGE, msgmerge, /usr/bin/msgmerge) + if test -z "$MSGMERGE"; then + AC_CHECK_PROG(MSGMERGE, msgmerge, /usr/bin/msgmerge) + fi msgmerge=$MSGMERGE AC_SUBST(msgmerge) - - test -z "$XGETTEXT" && AC_CHECK_PROG(XGETTEXT, xgettext, /usr/bin/xgettext) + if test -z "$XGETTEXT"; then + AC_CHECK_PROG(XGETTEXT, xgettext, /usr/bin/xgettext) + fi xgettext=$XGETTEXT AC_SUBST(xgettext) - if test "$XGETTEXT" = ""; then + if test -z "$XGETTEXT"; then echo echo 'FATAL ERROR: xgettext does not seem to be installed.' echo $pkg_name cannot be built without a working gettext installation. @@ -174,8 +203,7 @@ dnl also check if man page source is gzipped dnl (usually on Debian, but not Redhat pre-7.0) have_zipped_manpages=false for d in ${prefix}/share/man ${prefix}/man ; do - if test -f $d/man1/man.1.gz - then + if test -f $d/man1/man.1.gz; then have_zipped_manpages=true break fi diff --git a/debian/changelog b/debian/changelog index 0078de2..b3b3621 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,9 @@ -attr (2.4.1-1) unstable; urgency=low +attr (2.4.2-1) unstable; urgency=low * New upstream release + * Note: COMPAT_XFSROOT environment variable is no longer needed - -- Nathan Scott <nathans@debian.org> Thu, 27 Mar 2003 10:30:18 +1100 + -- Nathan Scott <nathans@debian.org> Mon, 14 Apr 2003 09:00:18 +1000 attr (2.4.0-1) unstable; urgency=low diff --git a/doc/CHANGES b/doc/CHANGES index 3e7bcea..2e570dc 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -1,3 +1,9 @@ +attr-2.4.2 (14 April 2003) + - Found a better way to handle the trusted/xfsroot namespace + transition, from a suggestion from Andreas. COMPAT_XFSROOT + is no longer checked, we figure this out on-the-fly now. + - Fix configure tests that used AC_PATH_PROG incorrectly. + attr-2.4.1 (27 March 2003) - Cleanups to the build process, in particular the automatic rpm package generation Makefile and spec file template. diff --git a/libattr/libattr.c b/libattr/libattr.c index 1c37abc..521f418 100644 --- a/libattr/libattr.c +++ b/libattr/libattr.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2002 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2001-2003 Silicon Graphics, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2.1 of the GNU Lesser General Public License @@ -48,15 +48,11 @@ * Convert IRIX API components into Linux/XFS API components */ static int -api_convert(char *name, const char *irixname, int irixflags) +api_convert(char *name, const char *irixname, int irixflags, int compat) { static const char *user_name = "user."; static const char *trusted_name = "trusted."; static const char *xfsroot_name = "xfsroot."; - static int compat = -1; - - if (compat == -1) - compat = (getenv("COMPAT_XFSROOT") != NULL); if (strlen(irixname) >= MAXNAMELEN) { errno = EINVAL; @@ -78,15 +74,20 @@ int attr_get(const char *path, const char *attrname, char *attrvalue, int *valuelength, int flags) { - int c; + int c, compat; char name[MAXNAMELEN+16]; - if ((c = api_convert(name, attrname, flags)) < 0) - return c; - if (flags & ATTR_DONTFOLLOW) - c = lgetxattr(path, name, attrvalue, *valuelength); - else - c = getxattr(path, name, attrvalue, *valuelength); + for (compat = 0; compat < 2; compat++) { + if ((c = api_convert(name, attrname, flags, compat)) < 0) + return c; + if (flags & ATTR_DONTFOLLOW) + c = lgetxattr(path, name, attrvalue, *valuelength); + else + c = getxattr(path, name, attrvalue, *valuelength); + if (c < 0 && errno == ENOATTR) + continue; + break; + } if (c < 0) return c; *valuelength = c; @@ -97,12 +98,17 @@ int attr_getf(int fd, const char *attrname, char *attrvalue, int *valuelength, int flags) { - int c; + int c, compat; char name[MAXNAMELEN+16]; - if ((c = api_convert(name, attrname, flags)) < 0) - return c; - c = fgetxattr(fd, name, attrvalue, *valuelength); + for (compat = 0; compat < 2; compat++) { + if ((c = api_convert(name, attrname, flags, compat)) < 0) + return c; + c = fgetxattr(fd, name, attrvalue, *valuelength); + if (c < 0 && errno == ENOATTR) + continue; + break; + } if (c < 0) return c; *valuelength = c; @@ -113,7 +119,7 @@ int attr_set(const char *path, const char *attrname, const char *attrvalue, const int valuelength, int flags) { - int c, lflags = 0; + int c, compat, lflags = 0; char name[MAXNAMELEN+16]; void *buffer = (void *)attrvalue; @@ -122,18 +128,25 @@ attr_set(const char *path, const char *attrname, const char *attrvalue, else if (flags & ATTR_REPLACE) lflags = XATTR_REPLACE; - if ((c = api_convert(name, attrname, flags)) < 0) - return c; - if (flags & ATTR_DONTFOLLOW) - return lsetxattr(path, name, buffer, valuelength, lflags); - return setxattr(path, name, buffer, valuelength, lflags); + for (compat = 0; compat < 2; compat++) { + if ((c = api_convert(name, attrname, flags, compat)) < 0) + return c; + if (flags & ATTR_DONTFOLLOW) + c = lsetxattr(path, name, buffer, valuelength, lflags); + else + c = setxattr(path, name, buffer, valuelength, lflags); + if (c < 0 && errno == ENOATTR) + continue; + break; + } + return c; } int attr_setf(int fd, const char *attrname, const char *attrvalue, const int valuelength, int flags) { - int c, lflags = 0; + int c, compat, lflags = 0; char name[MAXNAMELEN+16]; void *buffer = (void *)attrvalue; @@ -142,33 +155,52 @@ attr_setf(int fd, const char *attrname, else if (flags & ATTR_REPLACE) lflags = XATTR_REPLACE; - if ((c = api_convert(name, attrname, flags)) < 0) - return c; - return fsetxattr(fd, name, buffer, valuelength, lflags); + for (compat = 0; compat < 2; compat++) { + if ((c = api_convert(name, attrname, flags, compat)) < 0) + return c; + c = fsetxattr(fd, name, buffer, valuelength, lflags); + if (c < 0 && errno == ENOATTR) + continue; + break; + } + return c; } int attr_remove(const char *path, const char *attrname, int flags) { - int c; + int c, compat; char name[MAXNAMELEN+16]; - if ((c = api_convert(name, attrname, flags)) < 0) - return c; - if (flags & ATTR_DONTFOLLOW) - return lremovexattr(path, name); - return removexattr(path, name); + for (compat = 0; compat < 2; compat++) { + if ((c = api_convert(name, attrname, flags, compat)) < 0) + return c; + if (flags & ATTR_DONTFOLLOW) + c = lremovexattr(path, name); + else + c = removexattr(path, name); + if (c < 0 && errno == ENOATTR) + continue; + break; + } + return c; } int attr_removef(int fd, const char *attrname, int flags) { - int c; + int c, compat; char name[MAXNAMELEN+16]; - if ((c = api_convert(name, attrname, flags)) < 0) - return c; - return fremovexattr(fd, name); + for (compat = 0; compat < 2; compat++) { + if ((c = api_convert(name, attrname, flags, compat)) < 0) + return c; + c = fremovexattr(fd, name); + if (c < 0 && errno == ENOATTR) + continue; + break; + } + return c; } |