From eebbc9d4ec3c30a9609f5b878e79137607e14ddb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andrew=20Lee=20=28=E6=9D=8E=E5=81=A5=E7=A7=8B=29?=
 <ajqlee@debian.org>
Date: Tue, 20 Sep 2016 05:06:29 +0800
Subject: [PATCH] Check before create links.

---
 debian/obs-api.postinst | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/debian/obs-api.postinst b/debian/obs-api.postinst
index fbc4afb5ce..618b06381c 100644
--- a/debian/obs-api.postinst
+++ b/debian/obs-api.postinst
@@ -9,10 +9,10 @@ dbc_go obs-api $@
 
 chown www-data:root /etc/obs/api/config/environment.rb
 
-if [ ! -l /var/log/obs ] ; then
+if [ ! -f /var/log/obs ] ; then
   ln -fs /usr/share/obs/api/log /var/log/obs
 fi
-if [ ! -l /var/cache/obs/tmp ] ; then
+if [ ! -f /var/cache/obs/tmp ] ; then
   mkdir -p /var/cache/obs
   ln -fs /usr/share/obs/api/tmp /var/cache/obs/tmp
 fi
@@ -119,4 +119,3 @@ reload_apache()
 reload_apache restart
 
 #DEBHELPER#
-
-- 
GitLab