Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (8f098c2646a4d438a003408cd4e7678c29f0d6f6)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Pavel Vinogradov <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (8f098c2646a4d438a003408cd4e7678c29f0d6f6)
  • Date: Sun, 27 Aug 2023 02:49:04 +0000

GIT changes to master grimoire by Pavel Vinogradov <public AT sourcemage.org>:

ChangeLog | 3 +++
FUNCTIONS | 20 ++++++--------------
2 files changed, 9 insertions(+), 14 deletions(-)

New commits:
commit 8f098c2646a4d438a003408cd4e7678c29f0d6f6
Author: Pavel Vinogradov <public AT sourcemage.org>
Commit: Pavel Vinogradov <public AT sourcemage.org>

FUNCTIONS: simplified apply_patch_dir, removed apply_patch_dir_find

apply_patch_dir again is one function with checks done with ls and -d
find gets invoked once and only if there is non-empty directory, also the
"messsage" typo was fixed

diff --git a/ChangeLog b/ChangeLog
index da55742..228030b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2023-08-26 Pavel Vinogradov <public AT sorcemage.org>
+ * FUNCTIONS: simplified apply_patch_dir, removed apply_patch_dir_find
+
2023-08-24 Vlad Glagolev <stealth AT sourcemage.org>
* crypto/gpg-agent: new spell, GNU privacy guard - cryptographic agent

diff --git a/FUNCTIONS b/FUNCTIONS
index 1b70493..8431735 100755
--- a/FUNCTIONS
+++ b/FUNCTIONS
@@ -285,26 +285,18 @@ function install_www_files ()
}

#---------------------------------------------------------------------
-## Internal function to find patches
-#---------------------------------------------------------------------
-apply_patch_dir_find() {
- local dir="$SPELL_DIRECTORY/$1"; shift
- find "$dir" \( -name \*.patch -o -name \*.diff \) "$@"
-}
-
-#---------------------------------------------------------------------
## Apply patches from a directory
#---------------------------------------------------------------------
apply_patch_dir() {
+ local dir="$SPELL_DIRECTORY/$1"
# Check the directory exists and contains files.
- if ! [ -d "$SPELL_DIRECTORY/$1" ] ||
- ! apply_patch_dir_find "$1" -mindepth 1 -exec false {} + -quit
+ if [ -d "$dir" ] && [ "$(ls -A $dir)" ]
then
- messsage "${MESSAGE_COLOR}No patches found.$DEFAULT_COLOR"
- return
+ find "$dir" \( -name \*.patch -o -name \*.diff \) -print0 |
+ sort -zV | xargs -r -0 -n 1 -t patch -fp1 -i
+ else
+ message "${MESSAGE_COLOR}No patches found.$DEFAULT_COLOR"
fi
- apply_patch_dir_find "$1" -print0 |
- sort -zV | xargs -r -0 -n 1 -t patch -fp1 -i
}

#---------------------------------------------------------------------



  • [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (8f098c2646a4d438a003408cd4e7678c29f0d6f6), Pavel Vinogradov, 08/26/2023

Archive powered by MHonArc 2.6.24.

Top of Page