From ec85b0b62b86c097dedc5c722b237f8fa0fce1a5 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 26 Nov 2008 16:15:56 +0100 Subject: [PATCH] Added a new template var: patch_args. If not set, defaults to "-p0". --HG-- extra : convert_revision : e2cd770b61b872ca08249d6462cf6f36f842c781 --- xbps.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xbps.sh b/xbps.sh index 1ccc77ac161..0ef72015525 100755 --- a/xbps.sh +++ b/xbps.sh @@ -241,7 +241,7 @@ reset_tmpl_vars() tar_override_cmd xml_entries sgml_entries \ build_depends libtool_fixup_la_stage no_fixup_libtool \ disable_parallel_build run_depends cross_compiler \ - only_for_archs \ + only_for_archs patch_args \ XBPS_EXTRACT_DONE XBPS_CONFIGURE_DONE \ XBPS_BUILD_DONE XBPS_INSTALL_DONE" @@ -636,6 +636,8 @@ apply_tmpl_patches() patch_files="$pkgname-fix-install.diff $patch_files" fi + [ -z "$patch_args" ] && patch_args="-p0" + # # If package needs some patches applied before building, # apply them now. @@ -663,7 +665,8 @@ apply_tmpl_patches() continue fi - cd $wrksrc && patch -s -p0 < $patch 2>/dev/null + cd $wrksrc && patch -s ${patch_args} < \ + $patch 2>/dev/null if [ "$?" -eq 0 ]; then msg_normal "Patch applied: $i." else