File: autopatch.sh

package info (click to toggle)
wwwconfig-common 0.3.0
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 488 kB
  • sloc: sh: 952; makefile: 5
file content (23 lines) | stat: -rwxr-xr-x 633 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
# File:		autopatch.sh
# Changes:
#     	20010219 Ola Lundqvist <opal@debian.org>
#	20020116 Ola Lundqvist <opal@debian.org>
#		Introduced and deocumented the error variable.
# Arguments:	$1 - Where the patch is located.
# Description:	Finds patches in a directory and applies them to the filesystem.
# Sets:		status={error, nothing, patch}
#		error = error message (if $status = error).

status=error
error=""

if [ -z "$1" ] ; then
    error="No patch file [arg 1] specified."
elif [ ! -f $1 ] ; then
    error="Can not find patch file $1."
else
    status=patch
    error="Autopatching, using $1."
    patch -p0 -i $1
fi