]>
git.ipfire.org Git - people/ms/pakfire.git/blob - tools/patch
2 # Script that automatically applies patches.
10 paths
="${paths} ${1#--search-path=}"
13 patches
="${patches} ${1}"
19 if [ -n "${patches}" ]; then
20 echo "Applying patches..."
23 # Apply all patches given on command line.
24 for patch in ${patches}; do
29 for path
in ${paths}; do
30 if [ -e "${path}/${patch}" ]; then
31 patch="${path}/${patch}"
38 # Check if patch file does exist.
39 if ! [ -e "${patch}" ]; then
40 echo >&2 " ERROR: Patch file does not exist: ${patch}"
44 # Options applied to patch command.
47 # Get right -p1 option.
50 # Get patch level from file name.
51 level
=${patch:$(( ${#patch} - 1))}
52 options
="${options} -p${level}"
56 options
="${options} -p1"
59 echo >&2 " WARNING: Ignoring unknown file: ${patch}"
64 echo " Applying ${patch} (${options})..."
65 patch ${options} -i ${patch} ||
exit $?