Commit e627fe09 authored by Michael Hanselmann's avatar Michael Hanselmann

Makefile: Add new dist target for releases

A new script, autotools/check-tar, is used to check the resulting
.tar.gz file for unwanted contents like wrong file owners or
permissions.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 6920dd27
......@@ -282,6 +282,7 @@ EXTRA_DIST = \
autotools/build-bash-completion \
autotools/check-python-code \
autotools/check-man \
autotools/check-tar \
autotools/docbook-wrapper \
autotools/gen-coverage \
autotools/testrunner \
......@@ -669,9 +670,17 @@ distcheck-hook:
fi
# When building a release, stricter checks should be used
distcheck-release: export BUILD_RELEASE = 1
distcheck-release dist-release: export BUILD_RELEASE = 1
distcheck-release: distcheck
dist-release: dist
set -e; \
for i in $(DIST_ARCHIVES); do \
echo -n "Checking $$i ... "; \
autotools/check-tar < $$i; \
echo OK; \
done
install-exec-local:
@mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \
"$(DESTDIR)${localstatedir}/log/ganeti" \
......
#!/usr/bin/python
#
# Copyright (C) 2010 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
"""Script to check tarball generated by Automake.
"""
import sys
import stat
import tarfile
def ReportError(member, msg):
print >>sys.stderr, "%s: %s" % (member.name, msg)
def main():
tf = tarfile.open(fileobj=sys.stdin)
success = True
for member in tf.getmembers():
if member.uid != 0:
success = False
ReportError(member, "Owned by UID %s, not UID 0" % member.uid)
if member.gid != 0:
success = False
ReportError(member, "Owned by GID %s, not GID 0" % member.gid)
if member.mode & (stat.S_IWGRP | stat.S_IWOTH):
success = False
ReportError(member, "World or group writeable (mode is %o)" % member.mode)
if success:
sys.exit(0)
sys.exit(1)
if __name__ == "__main__":
main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment