Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatibility with BSD tar by supporting both tar and gtar #1316

Merged
merged 2 commits into from
Dec 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
SHELL := /bin/bash

## Copyright 2016-2019, 2022 Colin B. Macdonald
## Copyright 2024 Swayam Shah
##
## Copying and distribution of this file, with or without modification,
## are permitted in any medium without royalty provided the copyright
Expand All @@ -23,6 +24,7 @@ HTML_TARBALL := ${HTML_DIR}.tar.gz

OCTAVE ?= octave
MATLAB ?= matlab
TAR ?= tar

.PHONY: help clean install test doctest dist dist_zip html matlab_test matlab_pkg

Expand All @@ -46,7 +48,7 @@ define create_tarball
$(shell cd $(dir $(1)) \
&& find $(notdir $(1)) -print0 \
| LC_ALL=C sort -z \
| tar c --mtime="$(GIT_DATE)" \
| $(TAR) c --mtime="$(GIT_DATE)" \
--owner=root --group=root --numeric-owner \
--no-recursion --null -T - -f - \
| gzip -9n > "$(2)")
Expand All @@ -61,7 +63,7 @@ endef
$(OCTAVE_RELEASE): .git/index | $(BUILD_DIR)
@echo "Creating package version $(VERSION) release ..."
-$(RM) -r "$@"
git archive --format=tar --prefix="$@/" HEAD | tar -x
git archive --format=tar --prefix="$@/" HEAD | $(TAR) -x
$(RM) "$@/README.matlab.md" \
"$@/HOWTO-release.md" \
"$@/TODO.md" \
Expand Down