- If run under sudo, allow user to delete the build directory
Mark Huang [Thu, 1 Sep 2005 17:36:54 +0000 (17:36 +0000)]
vserver-reference.spec

index c7ba4cd..9a4298c 100644 (file)
@@ -34,6 +34,11 @@ RPM_BUILD_DIR=$RPM_BUILD_DIR ./%{name}.init
 rm -rf $RPM_BUILD_ROOT
 find vservers/vserver-reference | cpio -p -d -u $RPM_BUILD_ROOT/
 
+# If run under sudo, allow user to delete the build directory
+if [ -n "$SUDO_USER" ] ; then
+    chown -R $SUDO_USER .
+fi
+
 %clean
 rm -rf $RPM_BUILD_ROOT