[pacman-dev] [PATCH 01/11] makepkg: add mtree file into package

Allan McRae allan at archlinux.org
Thu Dec 13 22:43:52 EST 2012


Add an mtree file to the package with all file information. This
can be added to the local pacman database on install allowing full
package verification.

Signed-off-by: Allan McRae <allan at archlinux.org>
---

Added sha256 sum to the mtree file in addition to the md5sum following the
example of our package checksums in the repo db.

 scripts/makepkg.sh.in | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index e4e76cd..c057905 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1810,8 +1810,6 @@ create_package() {
 	done
 
 	# tar it up
-	msg2 "$(gettext "Compressing package...")"
-
 	local fullver=$(get_full_version)
 	local pkg_file="$PKGDEST/${pkgname}-${fullver}-${pkgarch}${PKGEXT}"
 	local ret=0
@@ -1822,6 +1820,14 @@ create_package() {
 	# when fileglobbing, we want * in an empty directory to expand to
 	# the null string rather than itself
 	shopt -s nullglob
+
+	msg2 "$(gettext "Generating .MTREE file...")"
+	bsdtar -czf .MTREE --format=mtree \
+		--options='!all,use-set,type,uid,gid,mode,time,size,md5,sha256,link' \
+		"${comp_files[@]}" *
+	comp_files+=(".MTREE")
+
+	msg2 "$(gettext "Compressing package...")"
 	# TODO: Maybe this can be set globally for robustness
 	shopt -s -o pipefail
 	# bsdtar's gzip compression always saves the time stamp, making one
-- 
1.8.0.2



More information about the pacman-dev mailing list