Skip to content

Commit

Permalink
Normalized release archive generation.
Browse files Browse the repository at this point in the history
* Now using gzip -n to compress the release tarball.
* Forcing gzip compression level to 6.
* Setting the timestamp for all files in the archive to the last commit's one.
* Feeding a sorted list of files to tar.
* Forcing numerid UIDs in tarball and original owner/group to be uid 0.
* Forcing gnu archive format.
* Forcing blocking factor.
* Forcing name quoting style.
* Preserves git archive permissions.
  • Loading branch information
tramjoe committed Sep 22, 2011
1 parent c4ba14f commit 2a819bd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ build/release-stamp:
@mkdir -p build
@echo "Exporting the repository files..."
@git archive ${GIT_BRANCH} --prefix ${NAME}-${VERSION}/ \
| (cd build; tar xf -)
| (cd build; tar xfp -)
@echo "Cleaning up the target tree..."
@rm -f build/${NAME}-${VERSION}/Makefile
@rm -f build/${NAME}-${VERSION}/.gitignore
Expand Down Expand Up @@ -95,8 +95,15 @@ build/release-stamp:
echo " -- $${author} $${date}"; \
echo ; \
done > build/${NAME}-${VERSION}/debian/changelog
@find build/${NAME}-${VERSION}/ -exec \
touch -t $$(date -d @$$(git show -s --format="format:%at") \
+"%Y%m%d%H%M.%S") {} \;
@mkdir -p dist
@cd build; tar zcf ../dist/${NAME}-${VERSION}.tar.gz ${NAME}-${VERSION}
@cd build; tar -c --owner=0 --group=0 --numeric-owner \
--format=gnu -b20 --quoting-style=escape \
-f ../dist/${NAME}-${VERSION}.tar \
$$(find ${NAME}-${VERSION} -type f | sort)
@gzip -6 -n dist/${NAME}-${VERSION}.tar
@echo "Generated release tarball:"
@echo " $$(ls dist/${NAME}-${VERSION}.tar.gz)"
@touch build/release-stamp
Expand Down

0 comments on commit 2a819bd

Please sign in to comment.