wip src
This commit is contained in:
parent
55f28f21fa
commit
085809f7d3
1 changed files with 30 additions and 6 deletions
36
src
36
src
|
|
@ -28,8 +28,7 @@ add_item() {
|
||||||
}
|
}
|
||||||
|
|
||||||
rm_item() {
|
rm_item() {
|
||||||
## Remove this entry from the srcfile
|
## Remove this entry from the srcfile and delete the source files afterwards
|
||||||
## and delete the source files afterwards
|
|
||||||
tmp="$srcfile.tmp"
|
tmp="$srcfile.tmp"
|
||||||
|
|
||||||
awk "\$3 != \"$1\" { print }" "$srcfile" > "$tmp"
|
awk "\$3 != \"$1\" { print }" "$srcfile" > "$tmp"
|
||||||
|
|
@ -52,8 +51,7 @@ update_gitrepo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
update_tarfile() {
|
update_tarfile() {
|
||||||
## Download and extract this tarfile if it
|
## Download and extract this tarfile if it doesn't exist yet
|
||||||
## doesn't exist yet
|
|
||||||
if ! [ -d "$2" ] ; then
|
if ! [ -d "$2" ] ; then
|
||||||
wget "$1"
|
wget "$1"
|
||||||
tar -xf "$1" -C "$2"
|
tar -xf "$1" -C "$2"
|
||||||
|
|
@ -64,8 +62,7 @@ update_tarfile() {
|
||||||
}
|
}
|
||||||
|
|
||||||
update_zipfile() {
|
update_zipfile() {
|
||||||
## Download and extract this tarfile if it
|
## Download and extract this zipfile if it doesn't exist yet
|
||||||
## doesn't exist yet
|
|
||||||
if ! [ -d "$2" ] ; then
|
if ! [ -d "$2" ] ; then
|
||||||
wget "$1"
|
wget "$1"
|
||||||
unzip "$1" -d "$2"
|
unzip "$1" -d "$2"
|
||||||
|
|
@ -150,6 +147,30 @@ list_all() {
|
||||||
cleanup
|
cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
|
diff_all() {
|
||||||
|
## Show the difference of the sourcefile and the actual content of the
|
||||||
|
## directory
|
||||||
|
preproc
|
||||||
|
|
||||||
|
want=".src_want"
|
||||||
|
actual=".src_actual"
|
||||||
|
|
||||||
|
true > "$want"
|
||||||
|
true > "$actual"
|
||||||
|
|
||||||
|
# Set up want
|
||||||
|
cut -d' ' -f3 < "$tmp" | sort > "$want"
|
||||||
|
|
||||||
|
# Set up actual
|
||||||
|
find . -maxdepth 1 -type d | tail -n +2 | sed 's|^./||' | sort > "$actual"
|
||||||
|
|
||||||
|
# Diff
|
||||||
|
diff -u0 "$want" "$actual"
|
||||||
|
|
||||||
|
rm "$want" "$actual"
|
||||||
|
cleanup
|
||||||
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"u"|"update")
|
"u"|"update")
|
||||||
update_all
|
update_all
|
||||||
|
|
@ -164,6 +185,9 @@ case "$1" in
|
||||||
"ls"|"list")
|
"ls"|"list")
|
||||||
list_all
|
list_all
|
||||||
;;
|
;;
|
||||||
|
"d"|"diff")
|
||||||
|
diff_all
|
||||||
|
;;
|
||||||
"--help"|"-h")
|
"--help"|"-h")
|
||||||
usage
|
usage
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue