Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 70 lines (65 sloc) 1.337 kb
#!/bin/sh
#
# Copyright (c) Eric Lesh, 2007
#
USAGE="[-l | --list | -n | --none | [<patchname>] [(+|-)<guard>...]]"
. `dirname $0`/guilt
print_guards()
{
guards=`get_guards "$1"`
echo "$1: $guards"
}
if [ "$1" = "-l" -o "$1" = "--list" ]; then
get_full_series | while read patch; do
print_guards "$patch"
done
exit 0
elif [ "$1" = "-n" -o "$1" = "--none" ]; then
patch="$2"
if [ -z "$patch" ]; then
patch=`get_top`
fi
unset_guards "$patch" `get_guards "$patch"`
exit 0
fi
case $# in
0)
if [ ! -s "$applied" ]; then
die "No patches applied."
fi
print_guards `get_top`
;;
1)
if [ -z $(printf %s "$1" | grep -e '^[+-]') ]; then
if [ -z $(get_full_series | grep -e "^$1\$") ]; then
die "Patch $1 does not exist."
else
print_guards "$1"
fi
else
patch=`get_top`
if [ -z "$patch" ]; then
die "You must specify a patch."
fi
unset_guards "$patch" `get_guards "$patch"`
set_guards "$patch" "$1"
fi
;;
*)
if [ -z $(printf %s "$1" | grep -e '^[+-]') ]; then
if [ -z $(get_full_series | grep -e "^$1\$") ]; then
die "Patch $1 does not exist."
else
patch="$1"
fi
shift
else
patch=`get_top`
if [ -z "$patch" ]; then
die "You must specify a patch."
fi
fi
unset_guards "$patch" `get_guards "$patch"`
set_guards "$patch" "$@"
;;
esac
Jump to Line
Something went wrong with that request. Please try again.