Allow mk-sbuild to be run by root if a configuration file exists

(LP: #888736)
This commit is contained in:
Stefano Rivera 2012-05-06 12:40:47 +02:00
parent 314ed77d77
commit b84c4d8530
2 changed files with 11 additions and 3 deletions

2
debian/changelog vendored
View File

@ -16,6 +16,8 @@ ubuntu-dev-tools (0.142) UNRELEASED; urgency=low
possible.
* backportpackage: Avoid uploading orig tarballs if they are already present
in the destination PPA (LP: #691897)
* Allow mk-sbuild to be run by root if a configuration file exists
(LP: #888736)
-- Stefano Rivera <stefanor@debian.org> Wed, 25 Apr 2012 17:38:58 +0200

View File

@ -175,9 +175,15 @@ done
# will not exist in the chroot.
cd /
# Make sure we've got a regular user
if [ -w /etc/passwd ]; then
echo "Please run this script as a regular user, not root." >&2
if [ -w /etc/passwd -a ! -e ~/.sbuildrc -a ! -e ~/.mk-sbuild.rc ]; then
cat >&2 <<EOF
It's recommended to run this script as a regular user, not root, so that it
uses the configuration files in your home directory.
It will use sudo to escalate to root as necessary.
If you really do want to use it as root, create a .sbuildrc or .mk-sbuild.rc
in root's home.
EOF
exit 1
fi