Bye Bye dpatch: now everything is handled in git branches

pull/3/head
Yaroslav Halchenko 2008-02-08 00:52:04 -05:00
parent a832ede291
commit 4b2bd7e776
5 changed files with 3 additions and 85 deletions

2
debian/control vendored
View File

@ -2,7 +2,7 @@ Source: fail2ban
Section: net
Priority: optional
Maintainer: Yaroslav Halchenko <debian@onerussian.com>
Build-Depends: debhelper (>= 5.0.37.2), dpatch, python
Build-Depends: debhelper (>= 5.0.37.2), python
Build-Depends-Indep: python-central (>= 0.5.6)
XS-Python-Version: current, >= 2.4
Homepage: http://www.fail2ban.org

View File

@ -1,23 +0,0 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 00_named_logtimeformat.dpatch by Yaroslav Halchenko <debian@onerussian.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
@DPATCH@
diff -urNad trunk~/server/datedetector.py trunk/server/datedetector.py
--- trunk~/server/datedetector.py 2007-04-01 16:42:08.000000000 -0400
+++ trunk/server/datedetector.py 2007-07-29 22:28:52.000000000 -0400
@@ -80,6 +80,12 @@
template.setRegex("\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}")
template.setPattern("%Y-%m-%d %H:%M:%S")
self.__templates.append(template)
+ # named 26-Jul-2007 15:20:52.252
+ template = DateStrptime()
+ template.setName("Day-Month-Year Hour:Minute:Second[.Millisecond]")
+ template.setRegex("\d{2}-\S{3}-\d{4} \d{2}:\d{2}:\d{2}")
+ template.setPattern("%d-%b-%Y %H:%M:%S")
+ self.__templates.append(template)
# TAI64N
template = DateTai64n()
template.setName("TAI64N")

View File

View File

@ -1,54 +0,0 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 10_multiple_HOST_regexp.dpatch by Yaroslav Halchenko <debian@onerussian.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
@DPATCH@
diff -urNad fail2ban-0.7.5~/server/filter.py fail2ban-0.7.5/server/filter.py
--- fail2ban-0.7.5~/server/filter.py 2006-11-26 15:37:31.000000000 -0500
+++ fail2ban-0.7.5/server/filter.py 2006-12-22 13:30:25.000000000 -0500
@@ -170,8 +170,17 @@
self.__failRegex = value
self.__failRegexObj = None
else:
- # Replace "<HOST>" with default regular expression for host.
- regex = value.replace("<HOST>", "(?:::f{4,6}:)?(?P<host>\S+)")
+ # Replace "<HOST>"s with regular expression for a hostname,
+ # naming groups hostX where X is a number starting with 1
+ regex = value
+ oldregex = ''; k = 0
+ while ( regex != oldregex ):
+ oldregex = regex
+ k += 1
+ regex = regex.replace("<HOST>",
+ "(?:::f{4,6}:)?(?P<host%d>\S+)" % k,
+ 1)
+
self.__failRegex = regex
self.__failRegexObj = re.compile(regex)
logSys.info("Set failregex = %s" % self.__failRegex)
@@ -435,12 +444,18 @@
+ "this format")
else:
try:
- ipMatch = DNSUtils.textToIp(match.group("host"))
- if ipMatch:
- for ip in ipMatch:
- failList.append([ip, date])
+ allGroups = match.groupdict()
+ hostRe = re.compile('host\d*$')
+ # Select only groups named host\d*
+ hostGroups = filter(lambda x: hostRe.match(x[0]) and x[1],
+ allGroups.iteritems())
+ for hostGroup, hostEntry in hostGroups:
+ ipMatch = DNSUtils.textToIp(hostEntry)
+ if ipMatch:
+ for ip in ipMatch:
+ failList.append([ip, date])
except IndexError:
- logSys.error("There is no 'host' group in the rule. " +
+ logSys.error("There is no 'hostX' group in the rule. " +
"Please correct your configuration.")
return failList

9
debian/rules vendored
View File

@ -11,19 +11,14 @@
DESTDIR=$(CURDIR)/debian/fail2ban
# no parallel execution -- required for dpatch
.NOTPARALLEL:
include /usr/share/dpatch/dpatch.make
configure: configure-stamp
configure-stamp:
dh_testdir
touch configure-stamp
build: patch
build:
clean: clean-inits unpatch
clean: clean-inits
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp