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

commit d1d04f0cd87f8603ff35c08cc501e7d5c94a5cfd
Author: Michel Hermier <herm...@frugalware.org>
Date:   Thu Mar 25 08:28:13 2010 +0100

genscriptlet.sh

* Avoid empty file generation.
* Fix .install path search (if it is not absolute it is relative to
$startdir).
* Allways copy the original .install to $Fsrcdir before substituing.

diff --git a/source/include/genscriptlet.sh b/source/include/genscriptlet.sh
index b4520a6..ca39636 100644
--- a/source/include/genscriptlet.sh
+++ b/source/include/genscriptlet.sh
@@ -94,14 +94,22 @@ options=("${optio...@]}" 'genscriptlet')
###
__Fgenscriptlet()
{
+       if [ -z "$1" ]; then
+               # Skipping empty genscriptlet file names.
+               return
+       fi
+
Fmessage "Generating scriptlet: $(basename "$1")"
+       local install_src="$1"
local install_dest="${Fsrcdir}/$(basename "$1")"

-       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
+       if [ ! -e "$install_src" ]; then
+               # if $install_src don't exist, it is relative to $startdir
+               install_src="$startdir/$1"
fi
+       Fmessage "Copying $1 to $install_dest"
+       cp -f "$install_src" "$install_dest" || Fdie
+
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