Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=dce871c2150034c8cdef4ab87855664a8d41fe1b
commit dce871c2150034c8cdef4ab87855664a8d41fe1b Author: Michel Hermier <herm...@frugalware.org> Date: Wed Jul 7 14:15:08 2010 +0200 kde.sh * Moce Ftreecmp and Fcleandestdir from util.sh to kde.sh. diff --git a/source/include/kde.sh b/source/include/kde.sh index d4fe627..0d634d9 100644 --- a/source/include/kde.sh +++ b/source/include/kde.sh @@ -162,9 +162,56 @@ _F_cmake_confopts="$_F_cmake_confopts \ ### # == PROVIDED FUNCTIONS -# * KDE_project_install: Install a specific package. Parameters: 1) Name of the -# project (Must also be the name of a directory). +# * 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() @@ -194,7 +241,10 @@ __KDE_pre_build_check() ## TODO: add check for missing $CARCH in subarchs ( porting / splitting issues ) } - +### +# * KDE_project_install: Install a specific package. Parameters: 1) Name of the +# project (Must also be the name of a directory). +### KDE_project_install() { if [ -d "filters" ]; then # Koffice diff --git a/source/include/util.sh b/source/include/util.sh index 07ebc18..e2f0ca8 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -548,59 +548,7 @@ Freplace() { Fdeststrip() { local i for i in "$@"; do - Fsed "$Fdestdir" "" "$Fdestdir"/$i # expand $i if possible - done -} - -### -# * 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 - 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 + Fsed "$Fdestdir" "" "$Fdestdir/$i" done } _______________________________________________ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git