Added updateList.sh

master release-2018-12-01-13-40
Felix Stupp 6 years ago
parent ba11517096
commit 5dda59041f
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -13,3 +13,19 @@ Usage: update.sh [dir]
Updates the current (or given) git repository to the newest tag with given prefix (defined inline, by default "*^release*"). Updates the current (or given) git repository to the newest tag with given prefix (defined inline, by default "*^release*").
Therefore, checks if the given tag is signed correctly by a gpg key with ultimate trust, Therefore, checks if the given tag is signed correctly by a gpg key with ultimate trust,
otherwise the script will abort the update and exit with error code 1. otherwise the script will abort the update and exit with error code 1.
## updateList.sh
```
Usage: updateList.sh [repository-path|repository-list]…
```
Updates all given git repositories (by using **update.sh**).
If given a file instead of a directory, the script will try to update each directory defined in the file.
Format of repository-list files:
```
/dir/**/repo
**/repo
[...]
```

@ -0,0 +1,30 @@
#!/bin/bash
EC=0
function update {
if [ -f "$1" ]; then
iterateFile "$1";
elif [ -d "$1" ]; then
if ./update.sh "$1"; then
echo "Updated $1";
else
echo "Failed $1";
EC=1;
fi
else
echo "Invalid entry \"$1\"" >&2;
fi
}
function iterateFile {
while read p; do
update "$p";
done < "$1"
}
for d in "$@"; do
update "$d";
done
exit $EC;
Loading…
Cancel
Save