From e162e41ee22937af70806af03565b17c66f0a2f1 Mon Sep 17 00:00:00 2001 From: joachimschmidt557 Date: Wed, 13 Nov 2019 23:06:25 +0100 Subject: [PATCH] WIP src --- src | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/src b/src index 7a04c54..54e72f3 100755 --- a/src +++ b/src @@ -1,11 +1,19 @@ #!/bin/sh +srcfile=$(pwd)/.srcfile + usage() { cat <> "$srcfile" +} + +rm_entry() { + ## Remove this entry from the srcfile + tmp="$srcfile.tmp" + + awk "\$3 == $1 { print }" "$srcfile" > "$tmp" + mv "$tmp" "$srcfile" +} + +update_gitrepo() { ## Update/clone this git repo if ! [ -d "$2" ] ; then git clone "$1" "$2" @@ -23,7 +44,7 @@ gitrepo() { fi } -tarfile() { +update_tarfile() { ## Download and extract this tarfile if it ## doesn't exist yet if ! [ -d "$2" ] ; then @@ -48,11 +69,11 @@ parse() { case "$type" in "git") echo "Updating: $path" - gitrepo "$url" "$path" + update_gitrepo "$url" "$path" ;; "tar") echo "Updating: $path" - #tarfile "$url" "$path" + #update_tarfile "$url" "$path" ;; *) echo "Not a valid source type: $type"