summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas K. Hüttel <dilfridge@gentoo.org>2017-08-23 14:43:01 +0200
committerAndreas K. Hüttel <dilfridge@gentoo.org>2017-08-23 15:13:47 +0200
commit5022352f9f3664f7b105b787c76a4962f0abbd5f (patch)
treeb95bccc74303f79ea169807fb7a0c1902da55d17
parent[no-tarball] Add Gentoo-specific support files (diff)
downloadglibc-gentoo/glibc-2.26-0.tar.gz
glibc-gentoo/glibc-2.26-0.tar.bz2
glibc-gentoo/glibc-2.26-0.zip
[no-tarball] Add a rewritten Gentoo patch tarball creation scriptgentoo/glibc-2.26-0
-rw-r--r--scripts/gentoo/README.Gentoo.patches35
-rwxr-xr-xscripts/gentoo/make-tarball.sh97
2 files changed, 132 insertions, 0 deletions
diff --git a/scripts/gentoo/README.Gentoo.patches b/scripts/gentoo/README.Gentoo.patches
new file mode 100644
index 0000000000..8e9777238d
--- /dev/null
+++ b/scripts/gentoo/README.Gentoo.patches
@@ -0,0 +1,35 @@
+ ============
+ === What ===
+ ============
+
+Gentoo patchsets for glibc are maintained as vendor branches of the upstream
+glibc git repository. From there, we bundle all the commits into a tarball
+and distribute it via our public mirroring system.
+
+If you want specific info about a patch (like what it does or whose great idea
+it was to change the code), read the patch! We try to fill out the commit
+messages with useful info such as what it does, why it's needed, bug reports,
+original creators, etc...
+
+ =============
+ === Where ===
+ =============
+
+Currently, https://github.com/gentoo/glibc
+
+ ===========
+ === How ===
+ ===========
+
+For historical reasons, the patch naming convention is slightly different
+from Git. When "git format-patch" generates a patch file of the name
+ xxxx-commit-message.patch
+it is placed into the tarball as
+ xxxx_all_commit-message.patch
+
+This signifies that the patch should be applied on all Gentoo "arches".
+In the past also patches were included that should be applied only on one
+specific arch (say, hppa). We're trying hard to avoid that in the future.
+
+All patches should apply with -p1 (so they can be used both with the legacy
+epatch function and the new, more strict eapply function).
diff --git a/scripts/gentoo/make-tarball.sh b/scripts/gentoo/make-tarball.sh
new file mode 100755
index 0000000000..bb45835e1f
--- /dev/null
+++ b/scripts/gentoo/make-tarball.sh
@@ -0,0 +1,97 @@
+#!/bin/bash
+
+PN="glibc"
+PV=${1%/}
+pver=$2
+
+if [[ -z ${PV} ]] ; then
+ echo "Usage: $0 glibc-version patchset-version-to-be-created"
+ echo "Please read the script before trying to use it :)"
+ exit 1
+fi
+
+# check that we're in the root of a glibc git repo
+
+if [[ ! -f ChangeLog.old-ports-hppa ]] || [[ ! -d .git ]] ; then
+ echo "Error: You need to call this script in the main directory of a Gentoo glibc git clone"
+ exit 1
+fi
+
+# check that we're on a branch gentoo/${PV}
+
+mybranchinfo=$(git status --porcelain -b|grep '^##')
+mybranch=$(echo ${mybranchinfo}|sed -e 's:^## ::' -e 's:\.\.\..*$::')
+if [[ ! "gentoo/${PV}" == "${mybranch}" ]] ; then
+ echo "Error: Your git repository is on the incorrect branch ${mybranch}; should be gentoo/${PV}"
+ exit 1
+fi
+
+# check that the working directory is clean
+
+mystatusinfo=$(git status --porcelain)
+if [[ ! -z "${mystatusinfo}" ]] ; then
+ echo "Error: Your working directory is not clean"
+ exit 1
+fi
+
+# check if the tag already exists
+
+mytaginfo=$(git tag -l|grep "gentoo/glibc-${PV}-${pver}")
+if [[ ! -z "${mytaginfo}" ]] ; then
+ echo "Error: A tag corresponding to this patch level already exists (gentoo/glibc-${PV}-${pver})"
+ exit 1
+fi
+
+# luckily glibc git has no /tmp dir and no tar.bz2 files, but let's better check and be pathologically careful
+
+if [[ -e tmp ]] || [[ -e ${PN}-${PV}-patches-${pver}.tar.bz2 ]] ; then
+ echo "Error: tmp or ${PN}-${PV}-patches-${pver}.tar.bz2 exists in git"
+ exit 1
+fi
+rm -rf tmp
+rm -f ${PN}-${PV}-*.tar.bz2
+
+for myname in 00*.patch ; do
+ if [[ -e ${myname} ]]; then
+ echo "Error: ${myname} exists in git"
+ exit 1
+ fi
+done
+rm -f 00*.patch
+
+mkdir -p tmp/patches
+
+# copy README.Gentoo.patches
+
+cp scripts/gentoo/README.Gentoo.patches tmp/ || exit 1
+
+# create and rename patches
+
+git format-patch glibc-${PV}..HEAD > /dev/null
+
+# remove all patches where the summary line starts with [no-tarball]
+rm -f 00??-no-tarball-*.patch
+
+for myname in 00*.patch ; do
+ mv ${myname} tmp/patches/$(echo ${myname}|sed -e 's:^\(....\)-:\1_all_:') || exit 1
+done
+
+# copy support files
+
+cp -r scripts/gentoo/extra tmp/ || exit 1
+
+# add a history file
+
+git log --stat --decorate glibc-${PV}..HEAD > tmp/patches/README.history || exit 1
+
+# package everything up
+
+tar -jcf ${PN}-${PV}-patches-${pver}.tar.bz2 \
+ -C tmp patches extra README.Gentoo.patches || exit 1
+rm -r tmp
+
+du -b *.tar.bz2
+
+# tag the commit
+
+git tag -s -m "Gentoo patchset ${PV}-${pver}" "gentoo/glibc-${PV}-${pver}"