File: copywip.sh

package info (click to toggle)
geda-doc 1%3A1.4.0-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 5,344 kB
  • ctags: 1,363
  • sloc: sh: 742; makefile: 145
file content (28 lines) | stat: -rwxr-xr-x 690 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

# Handle changed files
diff -r -q wip wiki | grep Files | sed "s/Files/cp -f/" | sed "s/ and / /" | sed "s/ differ//" > tmp$$.sh
sh ./tmp$$.sh
rm -f tmp$$.sh


# Handle new files (still buggy but works for at least two levels)
diff -r -q wip wiki | grep "Only in wip" | sed "s/Only in//" | sed "s/: /:/" > filelist.$$

for i in `cat filelist.$$`
do
	directory=`echo $i | awk -F: '{print $1}'`
	file=`echo $i | awk -F: '{print $2}'`
	basedir=`basename $directory`

	echo Processing: $directory $file
	if [ "$basedir" = "wip" ] 
	then
		cp -f $basedir/$file wiki/
	else
		mkdir -p wiki/$basedir > /dev/null 2>&1
		cp -f wip/$basedir/$file wiki/$basedir
	fi
done

rm -f filelist.$$