rpms/mysql/devel mysql.spec,1.140,1.141

Tom Lane tgl at fedoraproject.org
Tue Jan 26 18:34:23 UTC 2010


Author: tgl

Update of /cvs/pkgs/rpms/mysql/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv1166

Modified Files:
	mysql.spec 
Log Message:
Emit explicit error message if user tries to build RPM as root


Index: mysql.spec
===================================================================
RCS file: /cvs/pkgs/rpms/mysql/devel/mysql.spec,v
retrieving revision 1.140
retrieving revision 1.141
diff -u -p -r1.140 -r1.141
--- mysql.spec	20 Jan 2010 20:29:04 -0000	1.140
+++ mysql.spec	26 Jan 2010 18:34:23 -0000	1.141
@@ -1,6 +1,6 @@
 Name: mysql
 Version: 5.1.42
-Release: 5%{?dist}
+Release: 6%{?dist}
 Summary: MySQL client programs and shared libraries
 Group: Applications/Databases
 URL: http://www.mysql.com
@@ -189,6 +189,17 @@ autoconf
 autoheader
 
 %build
+
+# fail quickly and obviously if user tries to build as root
+%if %runselftest
+	if [ x"`id -u`" = x0 ]; then
+		echo "mysql's regression tests fail if run as root."
+		echo "If you really need to build the RPM as root, use"
+		echo "--define='runselftest 0' to skip the regression tests."
+		exit 1
+	fi
+%endif
+
 CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
 # MySQL 4.1.10 definitely doesn't work under strict aliasing; also,
 # gcc 4.1 breaks MySQL 5.0.16 without -fwrapv
@@ -655,6 +666,10 @@ fi
 %{_mandir}/man1/mysql_client_test.1*
 
 %changelog
+* Tue Jan 26 2010 Tom Lane <tgl at redhat.com> 5.1.42-6
+- Emit explicit error message if user tries to build RPM as root
+Related: #558915
+
 * Wed Jan 20 2010 Tom Lane <tgl at redhat.com> 5.1.42-5
 - Correct Source0: tag and comment to reflect how to get the tarball
 



More information about the scm-commits mailing list