[Frugalware-git] frugalware-current: generatesyntax * filter out functions starting with __F * filter out variables starting with _F_ or F and consisting only of * capital letters and the underscore character

James Buren ryuo at frugalware.org
Fri Apr 2 15:57:29 CEST 2010


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

commit 4c3a417c37d5e44eb7da4d832c34094dbc0dacc5
Author: James Buren <ryuo at frugalware.org>
Date:   Fri Apr 2 08:52:56 2010 -0500

generatesyntax
* filter out functions starting with __F
* filter out variables starting with _F_ or F and consisting only of
* capital letters and the underscore character

diff --git a/tools/generatesyntax b/tools/generatesyntax
index 76c7871..370f46e 100755
--- a/tools/generatesyntax
+++ b/tools/generatesyntax
@@ -64,7 +64,7 @@ SCHEMAS=$(git rev-parse --show-cdup)/source/include/*.sh
FUNCTIONS="Finclude"

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

# Define variables all FrugalBuilds may have
VARIABLES="pkgname pkgver pkgrel pkgdesc pkgdesc_localized url license install"
@@ -75,7 +75,7 @@ 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' | sort -u)"
+VARIABLES="$VARIABLES $(grep -hEo '(\$(F|_F_)\w+|(F|_F_)\w+=)' $SCHEMAS | sed 's|[\$=]||g' | grep -vE '^(F|_F_)[A-Z_]+$' | sort -u)"

if [ $1 == "nano" ]; then
nano_output


More information about the Frugalware-git mailing list