X-Git-Url: http://git.silcnet.org/gitweb/?p=autodist.git;a=blobdiff_plain;f=apps%2Fautodist%2Fautodist.in;h=2e600820d2080f9e25b35872a822deceb4352a28;hp=72a86a1c25f66f1ba8b9d81cf4e174670968b16a;hb=1f5e8e83c1ef34a85b88a2d0fb6761827d6039d1;hpb=5eb5e7e513f84a0e41b8ccb8200a996d21863bfa diff --git a/apps/autodist/autodist.in b/apps/autodist/autodist.in index 72a86a1..2e60082 100755 --- a/apps/autodist/autodist.in +++ b/apps/autodist/autodist.in @@ -533,7 +533,7 @@ EOF # S_AD_ENABLE_DEPENDENCIES \$(srcdir)/Makefile.am: Makefile.ad - cd \$(top_srcdir) && autodist -p \$(subdir)/Makefile.ad \$(subdir)/Makefile.am && cd \$(subdir) + cd \$(top_srcdir) && autodist -p makefile \$(subdir)/Makefile.ad \$(subdir)/Makefile.am && cd \$(subdir) # E_AD_ENABLE_DEPENDENCIES EOF fi @@ -1713,13 +1713,13 @@ ad_process_source_file() } # -# Processes a non-source file. This is the -p, --process option. +# Processes a file. This is the -p, --process option. # -# Arguments: ad_process +# Arguments: ad_process # ad_process() { - ad_debug "Starting process: $1 $2" + ad_debug "Starting process: $1 $2 $3" nolog=true @@ -1729,13 +1729,41 @@ ad_process() # Parse distribution distribution=`grep "dist:" < autodist.dist | cut -d: -f2` || exit 1 + dist_version=`grep "ver:" < autodist.dist | cut -d: -f2` || exit 1 ad_parse_distribution $distribution false ad_process_distdefs # Process file - ad_make_makefile_am $1 $2 + case "$1" in + makefile) + if test -z $3; then + ad_fatal "File type $1 requires argument" + fi + ad_make_makefile_am $2 $3 + exit 0;; + + configure) + ad_make_configure_ac $2 + exit 0;; + + non-source) + if test -z $3; then + ad_fatal "File type $1 requires argument" + fi + ad_process_file $2 $3 false + exit 0;; + + source) + if test -z $3; then + ad_fatal "File type $1 requires argument" + fi + ad_process_source_file $2 $3 false + exit 0;; - ad_debug "Ending process: $1 $2" + *) + ad_fatal "Unknown file type: $1"; + ;; + esac } # @@ -1811,8 +1839,10 @@ Operation modes: -s, --distdefs [] print distribution defines of , then exit -i, --init initialize Autodist environment, create default distribution directory and distribution, then exit - -p, --process process Makefile.ad file into for - distribution, the exit + -p, --process [] + process file into for distribution, + is 'makefile', 'configure', 'non-source' + or 'source' and defines the type of -m, --makedist create and package distribution --gzip create package compressed with gzip (default) --bzip2 create also package compressed with bzip2 @@ -1857,8 +1887,8 @@ while test $# -gt 0; do -p | --process) shift; - if test $# -eq 2; then - ad_process $1 $2 + if test $# -ge 2; then + ad_process $1 $2 $3 else echo "${usage}" 1>&2; fi