Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=8e5bde2b57798cfc2720e04b68eadbfac523f6e7

commit 8e5bde2b57798cfc2720e04b68eadbfac523f6e7
Author: Michel Hermier <herm...@frugalware.org>
Date:   Wed Dec 29 23:02:03 2010 +0100

util.sh: Move Ftreecmp and Fcleandestdir back to util.sh

* We have 2 users for this function qt4 package and kde.sh. So vmiklos
was confused and said me to move it to kde.sh wrongly in the past ;)

diff --git a/source/include/kde.sh b/source/include/kde.sh
index 75d14de..ffcdcbb 100644
--- a/source/include/kde.sh
+++ b/source/include/kde.sh
@@ -158,60 +158,6 @@ _F_cmake_confopts="$_F_cmake_confopts \
-DICON_INSTALL_DIR=/usr/share/kde/icons \
-DKDE_DISTRIBUTION_TEXT='Frugalware Linux'"

-
-###
-# == PROVIDED FUNCTIONS
-# * Ftreecmp(): Compare 2 tree and do an action on a compare result. 
Parameters:
-# 1) Fist tree 2) Second tree 3) Action to perform on compared item. The item
-# is an inode item (relative to both tree) prefixed with '-', '=' or '+'
-# depending if it deleted, still present or added in the comparison from the
-# first tree to the second tree.
-###
-Ftreecmp() {
-       local line old=$(mktemp) new=$(mktemp)
-       if [ ! -d "$1" -o ! -d "$2" ]; then
-               Fmessage "$1 or $2 is not a directory"
-               Fdie
-       fi
-       if [ -z "$3" ]; then
-               Fmessage "Comparison function is empty"
-               Fdie
-       fi
-       (cd "$1" && find $_F_treecmp_findopts | sort) > $old
-       (cd "$2" && find $_F_treecmp_findopts | sort) > $new
-       diff --new-line-format='+%L' --old-line-format='-%L' \
-               --unchanged-line-format='=%L' $old $new \
-       | while read line
-       do
-               "$3" "$line" "$1" "$2"
-       done
-       rm $old $new
-}
-
-###
-# * __Ftreecmp_cleandestdir: Internal
-###
-__Ftreecmp_cleandestdir() {
-       case "$1" in
-       =*)     Frm "${1//=/}" ;;
-       esac
-}
-
-###
-# * Fcleandestdir(): Clean the $Fdestdir from subpackages files, to make
-# them conflict less. Parameters: The subpackages to use.
-###
-Fcleandestdir() {
-       local i subdestdir
-       for i in "$@"
-       do
-               Fmessage "Removing conflicting files with $i subpackage."
-               subdestdir="`Fsubdestdir "$i"`"
-               _F_treecmp_findopts='! -type d' \
-               Ftreecmp "$Fdestdir" "$subdestdir" __Ftreecmp_cleandestdir
-       done
-}
-
# stolen from makepkg ;))
__kde_in_array()
{
@@ -241,6 +187,7 @@ __KDE_pre_build_check()
}

###
+# == PROVIDED FUNCTIONS
# * KDE_project_install: Install a specific package. Parameters: 1) Name of the
# project (Must also be the name of a directory).
###
diff --git a/source/include/util.sh b/source/include/util.sh
index c2a841e..c2beb71 100644
--- a/source/include/util.sh
+++ b/source/include/util.sh
@@ -1312,6 +1312,58 @@ Fwrapper()
}

###
+# * Ftreecmp(): Compare 2 tree and do an action on a compare result. 
Parameters:
+# 1) Fist tree 2) Second tree 3) Action to perform on compared item. The item
+# is an inode item (relative to both tree) prefixed with '-', '=' or '+'
+# depending if it deleted, still present or added in the comparison from the
+# first tree to the second tree.
+###
+Ftreecmp() {
+       local line old=$(mktemp) new=$(mktemp)
+       if [ ! -d "$1" -o ! -d "$2" ]; then
+               Fmessage "$1 or $2 is not a directory"
+               Fdie
+       fi
+       if [ -z "$3" ]; then
+               Fmessage "Comparison function is empty"
+               Fdie
+       fi
+       (cd "$1" && find $_F_treecmp_findopts | sort) > $old
+       (cd "$2" && find $_F_treecmp_findopts | sort) > $new
+       diff --new-line-format='+%L' --old-line-format='-%L' \
+               --unchanged-line-format='=%L' $old $new \
+       | while read line
+       do
+               "$3" "$line" "$1" "$2"
+       done
+       rm $old $new
+}
+
+###
+# * __Ftreecmp_cleandestdir: Internal
+###
+__Ftreecmp_cleandestdir() {
+       case "$1" in
+       =*)     Frm "${1//=/}" ;;
+       esac
+}
+
+###
+# * Fcleandestdir(): Clean the $Fdestdir from subpackages files, to make
+# them conflict less. Parameters: The subpackages to use.
+###
+Fcleandestdir() {
+       local i subdestdir
+       for i in "$@"
+       do
+               Fmessage "Removing conflicting files with $i subpackage."
+               subdestdir="`Fsubdestdir "$i"`"
+               _F_treecmp_findopts='! -type d' \
+               Ftreecmp "$Fdestdir" "$subdestdir" __Ftreecmp_cleandestdir
+       done
+}
+
+###
# * Fsplit(): Moves a file pattern to a subpackage. Parameters: 1) name of the
# subpackage 2) pattern of the files to move. Example: Fsplit libmysql /usr/lib.
#
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to