Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=gnometesting.git;a=commitdiff;h=a40231528d94caf6c2be8c5bff2552f42e1ed743

commit a40231528d94caf6c2be8c5bff2552f42e1ed743
Author: Michel Hermier <herm...@frugalware.org>
Date:   Tue Mar 23 12:20:55 2010 +0100

genscriptlet.sh

* Reorder the overwritten values logic so success case come first.
* Various fixes.

diff --git a/source/include/genscriptlet.sh b/source/include/genscriptlet.sh
index 607f70b..b4520a6 100644
--- a/source/include/genscriptlet.sh
+++ b/source/include/genscriptlet.sh
@@ -57,28 +57,28 @@
# * install
# * subinstall
###
-if [ -z "$_F_genscriptlet_install" ]; then
+if [ -n "$_F_genscriptlet_install" ]; then
if [ -z "$install" ]; then
+               install="${Fsrcdir}/$(basename "$_F_genscriptlet_install")"
+       else
error "_F_genscriptlet_install is used but install is allready defined."
plain "Check your FrugalBuild."
Fdie
-       else
-               install="src/$(basename \"$_F_genscriptlet_install\")"
fi
fi

if [ "${#_f_genscriptlet_subinsta...@]}" -gt 0 ]; then
-       if [ "${#subinsta...@]}" -gt 0 ]; then
-               error "_F_genscriptlet_subinstall is used but install is 
allready defined."
-               plain "Check your FrugalBuild."
-               Fdie
-       else
+       if [ "${#subinsta...@]}" -eq 0 ]; then
local file
subinstall=() # Really necessary ?
for file in "${_f_genscriptlet_subinsta...@]}"
do
-                       subinstall=("${subinta...@]}" "src/$(basename 
\"$file\")")
+                       subinstall=("${subinta...@]}" "${Fsrcdir}/$(basename 
"$file")")
done
+       else
+               error "_F_genscriptlet_subinstall is used but install is 
allready defined."
+               plain "Check your FrugalBuild."
+               Fdie
fi
fi

@@ -86,7 +86,7 @@ fi
# == APPENDED VARIABLES
# * options()
###
-options=("${optio...@]}" 'scriptlet' 'genscriptlet')
+options=("${optio...@]}" 'genscriptlet')

###
# == PROVIDED FUNCTIONS
@@ -94,10 +94,14 @@ options=("${optio...@]}" 'scriptlet' 'genscriptlet')
###
__Fgenscriptlet()
{
-       local install_src="$1"
-       local install_dest="${Fsrcdir}/$(basename $install_src)"
+       Fmessage "Generating scriptlet: $(basename "$1")"
+       local install_dest="${Fsrcdir}/$(basename "$1")"

-       cp -f "$install_src" "$install_dest" || Fdie
+       if [ ! -e "$install_dest" ]; then
+               # if $install_dest don't exist, create it
+               Fmessage "Copying $1 to $install_dest"
+               cp -f "$1" "$install_dest" || Fdie
+       fi
for hook in "${_f_genscriptlet_hoo...@]}"
do
$hook "$install_dest"
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to