X Strike Force SVN Admin <[EMAIL PROTECTED]> writes:

> -if ! fgrep -qsx "$THIS_PACKAGE" "$XWRAPPER_CONFIG_ROSTER" ]; then
> -  echo "$THIS_PACKAGE" >> "$XWRAPPER_CONFIG_ROSTER"
> +if [ ! -e "$CHECKSUM_DIR" ]; then
> +  mkdir --mode=755 --parents "$CHECKSUM_DIR"
> +  if ! fgrep -qsx "$THIS_PACKAGE" "$XWRAPPER_CONFIG_ROSTER" ]; then
> +    echo "$THIS_PACKAGE" >> "$XWRAPPER_CONFIG_ROSTER"
> +  fi
> +else
> +  # if the checksum pathname does exist but is not a directory, give up; we
> +  # will assume the user has reasons for setting things up this way
> +  if [ ! -d "$CHECKSUM_DIR" ]; then
> +    message "Warning: cannot register $THIS_PACKAGE package as an owner of" \
> +            "$XWRAPPER_CONFIG; $CHECKSUM_DIR exists but is not a directory."
> +  fi

The new logic (both instances) seems to do nothing if the directory
exists, even though it still might not contain the (complete) roster.
Also, I don't think you want to be grepping ].  I'd suggest running
mkdir unconditionally (which is safe due to -p) and then just using
test -d in the outer conditional:

[...]
mkdir --mode=755 --parents "$CHECKSUM_DIR"
if [ -d "$CHECKSUM_DIR" ]; then
  if ! fgrep -qsx "$THIS_PACKAGE" "$XWRAPPER_CONFIG_ROSTER"; then
    echo "$THIS_PACKAGE" >> "$XWRAPPER_CONFIG_ROSTER"
  fi
else
  # if the checksum pathname does exist but is not a directory, give up; we
  # will assume the user has reasons for setting things up this way
  message "Warning: cannot register $THIS_PACKAGE package as an owner of" \
          "$XWRAPPER_CONFIG; $CHECKSUM_DIR exists but is not a directory."
fi
[...]

-- 
Aaron M. Ucko, KB1CJC (amu at alum.mit.edu, ucko at debian.org)
Finger [EMAIL PROTECTED] (NOT a valid e-mail address) for more info.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to