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

commit dee7f41f3b350ea73c1b2476b931ce38ee3dd7a0
Author: James Buren <r...@frugalware.org>
Date:   Mon Aug 23 07:40:52 2010 -0500

[PATCH] generatesyntax
* fix usage in base directory of git
* rewrite heuristics for function/variable detection

diff --git a/tools/generatesyntax b/tools/generatesyntax
index 370f46e..2b7d097 100755
--- a/tools/generatesyntax
+++ b/tools/generatesyntax
@@ -58,15 +58,20 @@ if [ -z $1 ]; then
fi

# Schemas to search
-SCHEMAS=$(git rev-parse --show-cdup)/source/include/*.sh
+SCHEMAS=$(git rev-parse --show-cdup)source/include/*.sh

# Set base functions
FUNCTIONS="Finclude"

-# Assemble names of all functions, filter out any starting with '__'
-FUNCTIONS="$FUNCTIONS $(grep -ho '^\w\+()\s*{\?' $SCHEMAS | sed 's|[(){ 
\t]||g' | grep -v '^__F' | sort -u)"
+# Assemble names of all functions
+FUNCTIONS="$FUNCTIONS $(
+          grep -h -o -E '^\w+\(\)\s*{?' $SCHEMAS |
+          sed -r 's|[\(\){ \t]||g'               |
+          sed -r 's|^__.*$||'                    |
+          sort -u
+          )"

-# Define variables all FrugalBuilds may have
+# Set base variables
VARIABLES="pkgname pkgver pkgrel pkgdesc pkgdesc_localized url license install"
VARIABLES+=" up2date source sha1sums signatures groups archs backup depends"
VARIABLES+=" makedepends rodepends conflicts provides removes replaces options"
@@ -74,8 +79,13 @@ VARIABLES+=" subpkgs subdescs subdescs_localized sublicense 
subreplaces"
VARIABLES+=" subgroups subdepends subrodepends subremoves subconflicts"
VARIABLES+=" subprovides subbackup subinstall suboptions subarchs"

-# Append variables
-VARIABLES="$VARIABLES $(grep -hEo '(\$(F|_F_)\w+|(F|_F_)\w+=)' $SCHEMAS | sed 
's|[\$=]||g' | grep -vE '^(F|_F_)[A-Z_]+$' | sort -u)"
+# Assemble names of all variables
+VARIABLES="$VARIABLES $(
+          grep -h -E -o '(\$(F|_F_)\w+|(F|_F_)\w+=)' $SCHEMAS |
+          sed -r 's|[\$=]||g'                                 |
+          sed -r 's|^[A-Z_]+$||'                              |
+          sort -u
+          )"

if [ $1 == "nano" ]; then
nano_output
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to