summaryrefslogtreecommitdiff
path: root/src/compare.mk.in
diff options
context:
space:
mode:
Diffstat (limited to 'src/compare.mk.in')
-rw-r--r--src/compare.mk.in47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/compare.mk.in b/src/compare.mk.in
new file mode 100644
index 0000000..625c0e2
--- /dev/null
+++ b/src/compare.mk.in
@@ -0,0 +1,47 @@
+# -*- mode: makefile; coding: utf-8 -*-
+
+# Copyright (c) 2007-2008 Fabien Tassin <fta@sofaraway.org>
+# Description: The 'compare' module of mozilla-devscripts
+#
+# 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, 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.
+
+#####################################################################
+
+# Don't include this file directly, include one of the project.mk
+# file instead, which will include this file for you.
+
+# The following target is available to the caller:
+# compare: check the difference between what has been installed in debian/tmp
+# by the (upstream) make install rule and what has been put in the debs.
+#
+# The following variable are available:
+# COMPARE_FILTER_IN and COMPARE_FILTER_OUT
+# By default, both are 'sed' commands that could be augmented (+=) or
+# overwritten by the caller.
+
+TEMP := $(shell echo $$$$)
+LIST_INSTALLED := /tmp/installed.$(TEMP)
+LIST_IN_DEBS := /tmp/in_debs.$(TEMP)
+
+PKG_DIRS = $(addprefix debian/,$(shell grep ^Package debian/control | cut -d' ' -f2))
+
+compare:
+ @echo "# Compare..."
+ find debian/tmp -type f | cut -d/ -f3- | $(COMPARE_FILTER_IN) | sort > $(LIST_INSTALLED)
+ find $(PKG_DIRS) -type f | cut -d/ -f3- | $(COMPARE_FILTER_OUT) | sort > $(LIST_IN_DEBS)
+ -diff -u $(LIST_INSTALLED) $(LIST_IN_DEBS) | grep -E '^(\+|-).' | tail -n +3
+ @rm -f $(LIST_INSTALLED) $(LIST_IN_DEBS)
+ @echo "# End"
+