Make the apt repo directory structure exist if it doesn't already.
[invirt/packages/invirt-dev.git] / debian / invirt-dev.init
index 5f85efe..4888008 100755 (executable)
@@ -28,10 +28,13 @@ do_start()
     ret=0
 
     gen_files || ret=2
-    chown -R repository:nogroup /srv/repository/db \
-        /srv/repository/dists \
-        /srv/repository/lists \
-        /srv/repository/pool
+    for d in db dists lists pool; do
+        dir="/srv/repository/$d"
+        if ! [ -e "$dir" ]; then
+            mkdir -p "$dir"
+        fi
+        chown -R repository:nogroup "$dir"
+    done
     reprepro-env export || ret=2
 
     invirt-build-conf || ret=2