diff --git a/Makefile.am b/Makefile.am index 5f822b2462f0c4d0a8152d78212bd0d5c58b6f9f..21f06ab5e92f44b0fb38e3066f64d7a07d5e4ccd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -333,6 +333,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 \ @@ -767,9 +768,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" \ diff --git a/autotools/check-tar b/autotools/check-tar new file mode 100755 index 0000000000000000000000000000000000000000..d540763f1d7a2603295e5a4ebb96dcc9b2eee09b --- /dev/null +++ b/autotools/check-tar @@ -0,0 +1,60 @@ +#!/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() diff --git a/devel/release b/devel/release index 7e0ef335338401bcdf1b57ba0190487617c67b53..dee9f6cac099247d0490b81e789817f1b897279c 100755 --- a/devel/release +++ b/devel/release @@ -71,8 +71,8 @@ done VERSION=$(sed -n -e '/^PACKAGE_VERSION =/ s/^PACKAGE_VERSION = // p' Makefile) -make distcheck -fakeroot make dist +make distcheck-release +fakeroot make dist-release tar tzvf ganeti-$VERSION.tar.gz echo