summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitattributes1
-rwxr-xr-x__root__/run-sdist3
-rw-r--r--misc/clufter.spec3
-rwxr-xr-xmisc/run-sdist-per-commit19
4 files changed, 25 insertions, 1 deletions
diff --git a/.gitattributes b/.gitattributes
index 62bcb0c..0b524d3 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1 +1,2 @@
__init__.py export-subst
+misc/run-sdist-per-commit export-subst
diff --git a/__root__/run-sdist b/__root__/run-sdist
index e7923a7..c89901a 100755
--- a/__root__/run-sdist
+++ b/__root__/run-sdist
@@ -1,5 +1,6 @@
#/bin/sh
-# for locally-commited-only round-trip
+# for locally-commited-only round-trip,
+# for pushed-code round-trip, see REPO/misc/run-sdist-per-commit
pushd "$(git rev-parse --show-toplevel)"
git archive --format=tar HEAD | (
cd $(mktemp -d '/var/tmp/pkg-XXXXX') \
diff --git a/misc/clufter.spec b/misc/clufter.spec
index b2c035c..cc71bad 100644
--- a/misc/clufter.spec
+++ b/misc/clufter.spec
@@ -77,6 +77,9 @@ BuildRequires: python-lxml
Source0: %{clufter_url_dist}%{name}/%{name}-%{version}.tar.gz
%else
Source0: %{clufter_source}.tar.gz
+# Source0 is created by Source1, just pass particular commit hash
+# via GITHASH env. variable
+Source1: https://raw.githubusercontent.com/jnpkrn/clufter/master/misc/run-sdist-per-commit
%endif
diff --git a/misc/run-sdist-per-commit b/misc/run-sdist-per-commit
new file mode 100755
index 0000000..986b7a9
--- /dev/null
+++ b/misc/run-sdist-per-commit
@@ -0,0 +1,19 @@
+#/bin/bash
+# for pushed-code round-trip only,
+# for locally-commited-only round-trip, see REPO/__root__/run-sdist
+#
+# pre-release package how-to (requires bash, coreutils, curl, tar
+# and assumes clufter_version is correctly set to correspond $GITHASH below):
+
+: ${GITHASH:=$Format:%h$}
+GHREPO=jnpkrn/clufter
+pushd $(LC=C \
+ curl -qL -o >(tar xzf -) "https://github.com/${GHREPO}/tarball/${GITHASH}" \
+ 2>&1 \
+ | sed -e '/< Content-Disposition:/!d' \
+ -e 's|.*filename=\([^-]\+-[^-]\+-\)\(v[^g]\+\)\?g\([0-9a-z]\+\)\.tar\.gz|\1\3|' \
+ | tr -d '\r\n'
+)/__root__
+python setup.py sdist -d "${OLDPWD}"
+popd
+echo "New source tarball created: $(ls -1t | head -n1)"