Showing 1 changed files with 19 additions and 0 deletions
+19
.fgfs/fgaddon
... ...
@@ -195,12 +195,31 @@ case ${1:-rss} in
195 195
         latest_revision=$(sqlite_request "select max(revision) from aircrafts")
196 196
         wget -qO- https://sourceforge.net/p/flightgear/fgaddon/feed > $aircrafts
197 197
         eval "$(get_updates_from_rss)"
198
+    ;;
199
+    get)
200
+        test -z "$2" && exit 1
201
+        ac=$(sqlite_request "select distinct(name) from aircrafts inner join setxml where aircrafts.id = setxml.variantof and (setxml.file = '$2' or aircrafts.name = '$2');")
202
+        if test -n "$ac"; then
203
+            if test -d $fgaddon_path/$ac; then
204
+                echo "$ac already installed"
205
+                test -d $fgaddon_path/$ac/.svn && echo "and seems to already be a subversion clone"
206
+                exit
207
+            elif test ! -w $fgaddon_path; then
208
+                echo "can't write in $fgaddon_path"
209
+            else
210
+                svn clone $fgaddon_svn/$ac $fgaddon_path/$ac
211
+            fi
212
+        else
213
+            echo "unknown aircraft $2"
214
+        fi
198 215
     ;;
199 216
         *)
200 217
             echo "usage: [DB=path/to/database] $0 [rss|full]"
218
+            echo "usage: [DB=path/to/database] $0 get <aircraft>"
201 219
             echo
202 220
             echo "rss: updates only last repo changes"
203 221
             echo "full: updates from all repo"
222
+            echo "get <aircraft>: svn clone aircraft if not installed"
204 223
             exit 1
205 224
     ;;
206 225
 esac