summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2021-02-27 10:47:04 +0100
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2021-03-05 11:24:10 +0100
commit889f96a2390f258d5315c8cf0c687b3eebd47c4b (patch)
tree7cee16933d13fc98d0dd1a73cafee2597f6378b6
parent8858c4b407d6bda8184ae4f49c0c9a27941ef76e (diff)
downloadvendor_replicant-release-scripts-889f96a2390f258d5315c8cf0c687b3eebd47c4b.zip
vendor_replicant-release-scripts-889f96a2390f258d5315c8cf0c687b3eebd47c4b.tar.gz
vendor_replicant-release-scripts-889f96a2390f258d5315c8cf0c687b3eebd47c4b.tar.bz2
Add script to generate source code tarball
The following text is part of the GPLv2: If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. Since we currently host images (which contains many executable or object code) on ftp.osuosl.org, it would be best to also ship the corresponding source code on the exact same server. This way we could be pretty sure that the corresponding source code is available at the same place. This script can generate the corresponding source code tarballs for all the Replicant 4.2 and 6.0 versions. For that it simply downloads the Replicant source code of a given tag (which corresponds to a release). To save space it doesn't download the history (it uses --depth=1) and it compresses the results with xz -9e, but we still kept the git and repo information in case the build system uses it somehow. Keeping the repo and git information also makes it compatible with the current build instructions on the wiki. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rwxr-xr-xmake_source_tarball.sh55
1 files changed, 55 insertions, 0 deletions
diff --git a/make_source_tarball.sh b/make_source_tarball.sh
new file mode 100755
index 0000000..ec8b290
--- /dev/null
+++ b/make_source_tarball.sh
@@ -0,0 +1,55 @@
+#!/bin/sh
+#
+# Copyright (C) 2021 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
+#
+# 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 3 of the License, 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, see <http://www.gnu.org/licenses/>.
+
+set -e
+
+usage()
+{
+ echo "$0 <tag> <output directory>"
+ exit 1
+}
+
+tag="$1"
+outdir="$2"
+
+replicant_dir="${outdir}/${tag}"
+repo_branch="refs/tags/${tag}"
+
+if [ $# -ne 2 ] ; then
+ usage
+fi
+
+mkdir -p "${replicant_dir}"
+cd "${replicant_dir}"
+if [ ! -d .repo ] ; then
+ yes | repo init \
+ -u https://git.replicant.us/replicant/manifest.git \
+ -b "${repo_branch}" \
+ --depth=1 || rm -rf .repo/
+fi
+
+repo sync
+
+cd ..
+tarball="${tag}.tar"
+if [ ! -f "${tarball}" ] && [ ! -f "${tarball}.xz" ] ; then
+ tar cf "${tarball}" "${replicant_dir}" || rm -f "${tarball}"
+fi
+
+# TODO: Make the tarball reproducible by removing metadata
+
+xz -9e --verbose "${tarball}"