From 28909627356ebbd5930939f08450b8315313885f Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Fri, 18 Sep 2015 10:50:15 -0300 Subject: Fixes #5000: - Detect new pfSense repo structure, where files that were present on / in the past now lie in /src, and automatically set pathstrip to 2 - Bump package version to 1.0.6 --- config/systempatches/patches.inc | 6 ++++++ config/systempatches/systempatches.xml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'config/systempatches') diff --git a/config/systempatches/patches.inc b/config/systempatches/patches.inc index 0aa37fb8..2298e170 100644 --- a/config/systempatches/patches.inc +++ b/config/systempatches/patches.inc @@ -94,6 +94,12 @@ function patch_fetch(& $patch) { return false; } else { $patch['patch'] = base64_encode($text); + // Detect pfSense move from / to /src and fix pathstrip + if (is_github_url($patch['location']) && + $patch['pathstrip'] == 1 && + preg_match('/\n--- a\/src\//', $text)) { + $patch['pathstrip'] = 2; + } write_config("Fetched patch {$patch['descr']}"); return true; } diff --git a/config/systempatches/systempatches.xml b/config/systempatches/systempatches.xml index 06f024a8..61f3df84 100644 --- a/config/systempatches/systempatches.xml +++ b/config/systempatches/systempatches.xml @@ -43,7 +43,7 @@ System Patches applies patches supplied by the user to the firewall. System Patches - 1.0.5 + 1.0.6 System: Patches /usr/local/pkg/patches.inc -- cgit v1.2.3