Re: X Strike Force SVN commit: rev 422 - trunk/debian
X Strike Force SVN Admin <branden@debian.org> 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 amu@monk.mit.edu (NOT a valid e-mail address) for more info.
Reply to: