r143 als Version 1.1 zu tags hinzugefuegt
This commit is contained in:
parent
609b0db4c0
commit
19eed40acc
99 changed files with 10342 additions and 0 deletions
94
v1.1/_scripts/erzeuge_export_mirror.sh
Executable file
94
v1.1/_scripts/erzeuge_export_mirror.sh
Executable file
|
@ -0,0 +1,94 @@
|
|||
#!/bin/sh
|
||||
# Parameter: Datenverzeichnis Zielverzeichnis [--copy (fuer cp statt ln -s)]
|
||||
|
||||
set -u
|
||||
set -e
|
||||
#set -x
|
||||
|
||||
DEFAULT_ACTION="ln -s"
|
||||
|
||||
|
||||
filtere_verzeichnisse()
|
||||
{
|
||||
cd "$1"
|
||||
find -xtype d -maxdepth 1 | sed 's#^\./##' | sed '/^.$/d ; /^\.svn/d; /^_/d ; /^_bilder$/d'
|
||||
}
|
||||
|
||||
filtere_dateien()
|
||||
{
|
||||
cd "$1"
|
||||
find -xtype f -maxdepth 1 | sed 's#^\./##' | sed '/^Makefile$/d ; /\.tex$/d ; /\.lyx$/d ; /^WARNINGS$/d ; /\.py$/d ; /\.make$/d ; /\.log$/d ; /\.pl$/d'
|
||||
}
|
||||
|
||||
bearbeiteVerzeichnis()
|
||||
{
|
||||
[ ! -e "$1" ] && return 0
|
||||
local old_pwd=`pwd`
|
||||
mkdir "$2"
|
||||
cd "$2"
|
||||
for a in `filtere_verzeichnisse "$1"`
|
||||
do [ "$a" != "." ] && bearbeiteVerzeichnis "$1/$a" "$2/$a"
|
||||
done
|
||||
|
||||
for a in `filtere_dateien "$1"`
|
||||
do $ACTION "$1/$a" .
|
||||
done
|
||||
cd "$old_pwd"
|
||||
}
|
||||
|
||||
#### hier geht es los ########
|
||||
|
||||
# eventuelle Parameter auswerten
|
||||
|
||||
FERTIG=nein
|
||||
|
||||
while [ "$FERTIG" == "nein" -a $# -gt 2 ]
|
||||
do case "$1" in
|
||||
--copy )
|
||||
ACTION="cp"
|
||||
shift
|
||||
;;
|
||||
--link )
|
||||
ACTION="ln -s"
|
||||
shift
|
||||
;;
|
||||
--help )
|
||||
echo "syntax: $0 [ --copy | --link ] DATENVERZEICHNIS ZIELVERZEICHNIS"
|
||||
exit 0
|
||||
;;
|
||||
--* )
|
||||
echo "unbekannter Parameter: $1"
|
||||
exit 1
|
||||
;;
|
||||
* )
|
||||
FERTIG=ja
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
[ $# -lt 2 ] && echo "falsche Anzahl von Parametern!" && exit 1
|
||||
|
||||
DATA=$1
|
||||
ZIEL=$2
|
||||
|
||||
set +u
|
||||
[ -z "$ACTION" ] && ACTION="$DEFAULT_ACTION"
|
||||
set -u
|
||||
|
||||
# Verzeichnis anlegen
|
||||
[ -d "$ZIEL" ] && rm -r "$ZIEL"
|
||||
mkdir -p "$ZIEL"
|
||||
cd "$ZIEL"
|
||||
|
||||
#### Wurzelverzeichnis ######
|
||||
ROOT_LIST="start.html autorun.inf NEWS.txt"
|
||||
for a in $ROOT_LIST
|
||||
do $ACTION "$DATA/$a" .
|
||||
done
|
||||
|
||||
###### die anderen Verzeichnisse #########
|
||||
|
||||
for a in ausLese doku cover
|
||||
do bearbeiteVerzeichnis "$DATA/$a" "$ZIEL/$a"
|
||||
done
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue