[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: CVS update: populatemkfiles.sh



  User: ahvezda 
  Date: 06/08/24 20:57:53

  Added:       .        populatemkfiles.sh
  Log:
  Oops forgot new script
  
  
  
  
  Revision  Changes    Path
  1.1                  eda/geda/gaf/docs/scripts/populatemkfiles.sh
  
  Index: populatemkfiles.sh
  ===================================================================
  #!/bin/sh
  
  # $1 is the name of the directory
  do_work()
  {
  	if [ "$2" = "." ]
  	then
  		thisdir=
  	else
  		if [ "$2" != "" ]
  		then
  			thisdir=/$1/$2
  		else
  			thisdir=/$1
  		fi
  	fi
  
  	thisdir=`echo $thisdir | sed "s%//%/%g"`
  
  	mv -f Makefile.am Makefile.am.old
  	echo "" > Makefile.am
  
  	echo "" >> Makefile.am
  	echo "docname=wiki" >> Makefile.am
  	echo 'docsdir = @GEDADOCDIR@/$(docname)'$thisdir >> Makefile.am
  	echo "" >> Makefile.am
  
  	dirs=`find . -maxdepth 1 -type d -print | grep -v CVS | sed "s%^./%%" | sed "s%^\.%%"`
  
  	if [ "$dirs" != "" ]
  	then
  		echo -n "SUBDIRS = " >> Makefile.am
  		for i in $dirs
  		do
  			echo -n "$i " >> Makefile.am
  		done
  		echo "" >> Makefile.am
  		echo "" >> Makefile.am
  	fi
  
  	files=`find . -maxdepth 1 -type f -print | grep -v Makefile | grep -v CVS | grep -v .cvsignore  | sed "s%^./%%" | sed "s%^\.%%"`
  	files=`echo $files`
  	echo files: _${files}_
  
  	if [ "$files" != "" ]
  	then
  		echo -n "docs_DATA = " >> Makefile.am
  		for i in $files
  		do
  			if [ ! -d $i ]
  			then
  				echo -n "$i " >> Makefile.am
  			fi
  		done
  		echo "" >> Makefile.am
  		echo "" >> Makefile.am
  
  		echo 'EXTRA_DIST = $(docs_DATA)' >> Makefile.am
  	
  	fi
  	echo "" >> Makefile.am
  }
  
  thisprogram=/home/ahvezda/1gaf/docs/scripts/populatemkfiles.sh
  pwd=`pwd`
  basedir=/home/ahvezda/1gaf/docs/wiki
  
  subdir=`echo $pwd | awk -F$basedir '{print $2}'`
  
  do_work $1 $2
  
  subdirs=`find . -maxdepth 1 -type d -print | grep -v CVS | sed "s%^./%%" | sed "s%^\.%%"`
  subdirs=`echo $subdirs`
  
  for i in $subdirs
  do
  	currentpwd=`pwd`
  	cd $i
  	echo Handling: $subdir $i
  	$thisprogram $subdir $i
  	cd $currentpwd
  done
  
  
  
  


_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs