From ab1a69739680a3b439e64886ac7ef30055701238 Mon Sep 17 00:00:00 2001
From: Guido Trotter <ultrotter@google.com>
Date: Mon, 28 Sep 2009 10:23:53 +0100
Subject: [PATCH] devel/upload.in: make it more project generic

Only install ganeti specific files if they exist. This way we can call
ganeti's devel/upload in another sub-projects (eg. nbma) and have it
uploaded to a host as well, without having to create a new script there.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 devel/upload.in | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/devel/upload.in b/devel/upload.in
index 7dcd6feba..6c1986223 100644
--- a/devel/upload.in
+++ b/devel/upload.in
@@ -74,17 +74,20 @@ fi
 make $make_args install DESTDIR="$TXD"
 
 # copy additional needed files
+[ -f doc/examples/ganeti.initd ] && \
 install -D --mode=0755 doc/examples/ganeti.initd \
   "$TXD/$SYSCONFDIR/init.d/ganeti"
 
+[ -f doc/examples/bash_completion ] && \
 install -D --mode=0644 doc/examples/bash_completion \
   "$TXD/$SYSCONFDIR/bash_completion.d/ganeti"
 
-if [ -z "$NO_CRON" ]; then
+if [ -f doc/examples/ganeti.cron -a -z "$NO_CRON" ]; then
   install -D --mode=0644 doc/examples/ganeti.cron \
     "$TXD/$SYSCONFDIR/cron.d/ganeti"
 fi
 
+[ -f doc/examples/dumb-allocator ] && \
 install -D --mode=0755 doc/examples/dumb-allocator \
   "$TXD/$PKGLIBDIR/iallocators/dumb"
 
-- 
GitLab