public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sven Vermeulen" <swift@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: gentoo/
Date: Thu, 26 Sep 2013 13:19:39 +0000 (UTC)	[thread overview]
Message-ID: <1380201555.1276eb6dbfad00e2056488989640fa9b6851dd63.swift@gentoo> (raw)

commit:     1276eb6dbfad00e2056488989640fa9b6851dd63
Author:     Sven Vermeulen <sven.vermeulen <AT> siphos <DOT> be>
AuthorDate: Thu Sep 26 13:19:15 2013 +0000
Commit:     Sven Vermeulen <swift <AT> gentoo <DOT> org>
CommitDate: Thu Sep 26 13:19:15 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-refpolicy.git;a=commit;h=1276eb6d

Adding release-prepare.sh script

---
 gentoo/README             |   6 ++
 gentoo/release-prepare.sh | 150 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 156 insertions(+)

diff --git a/gentoo/README b/gentoo/README
index a0b1298..bf64f66 100644
--- a/gentoo/README
+++ b/gentoo/README
@@ -11,3 +11,9 @@ STATE
 
 The STATE file contains the commit id's of upstream up to which point our
 repository is synchronized/merged. 
+
+release-prepare.sh
+------------------
+
+The release-prepare.sh script handles the creation of a new policy release, from
+creating the new ebuilds, patchbundle to tagging the repository.

diff --git a/gentoo/release-prepare.sh b/gentoo/release-prepare.sh
new file mode 100644
index 0000000..7f9ade2
--- /dev/null
+++ b/gentoo/release-prepare.sh
@@ -0,0 +1,150 @@
+#!/bin/sh
+
+# Copyright 2013 Sven Vermeulen <swift@gentoo.org>
+# Licensed under the GPL-3 license
+
+# Prepare new policy release
+
+TRANSLATE="s:\(${HARDENEDREFPOL}\|${REFPOLRELEASE}\):refpolicy:g";
+OLDVERSION="${1}";
+NEWVERSION="${2}";
+REMOTELOCATION="swift@dev.gentoo.org:public_html/patches/selinux-base-policy";
+
+usage() {
+  echo "Usage: $0 <oldversion> <newversion>";
+  echo "";
+  echo "Example: $0 2.20130424-r2 2.20130424-r3"
+  echo "";
+  echo "The script will copy the ebuilds of the <oldversion> towards the";
+  echo "<newversion> and update the string occurrences of that version";
+  echo "(mostly for the BASEPOL variable).";
+  echo "";
+  echo "The following environment variables must be declared correctly for the script";
+  echo "to function properly:";
+  echo "  - GENTOOX86 should point to the gentoo-x86 checkout";
+  echo "    E.g. export GENTOOX86=\"/home/user/dev/gentoo-x86\"";
+  echo "  - HARDENEDREFPOL should point to the hardened-refpolicy.git checkout";
+  echo "    E.g. export HARDENEDREFPOL=\"/home/user/dev/hardened-refpolicy\"";
+  echo "  - REFPOLRELEASE should point to the current latest /release/ of the reference"
+  echo "    policy (so NOT to a checkout), extracted somewhere on the file system."
+  echo "    E.g. export REFPOLRELEASE=\"/home/user/local/refpolicy-20130424\"";
+}
+
+assertDirEnvVar() {
+  VARNAME="${1}";
+  eval VARVALUE='$'${VARNAME};
+  if [ -z "${VARVALUE}" ] || [ ! -d "${VARVALUE}" ];
+  then
+    echo "Variable ${VARNAME} (value \"${VARVALUE}\") does not point to a valid directory.";
+    exit 1;
+  fi
+}
+
+# cleanTmp - Clean up TMPDIR
+cleanTmp() {
+  if [ -z "${NOCLEAN}" ];
+  then
+    echo "Not cleaning TMPDIR (${TMPDIR}) upon request.";
+  else
+    [ -d "${TMPDIR}" ] && [ -f "${TMPDIR}/.istempdir" ] && rm -rf "${TMPDIR}"
+  fi
+}
+
+die() {
+  printf "\n";
+  echo "!!! $*";
+  cleanTmp;
+  exit 2;
+};
+
+# buildpatch - Create the patch set to be applied for the new release
+buildpatch() {
+  printf "Creating patch 0001-full-patch-against-stable-release.patch... ";
+  diff -uNr -x ".git*" -x "CVS" -x "*.autogen*" -x "*.part" ${REFPOLRELEASE} ${HARDENEDREFPOL} | sed -e ${TRANSLATE} > ${TMPDIR}/0001-full-patch-against-stable-release.patch || die "Failed to create patch";
+  printf "done\n"
+
+  printf "Creating patch bundle for ${NEWVERSION}... ";
+  cd ${TMPDIR};
+  tar cvjf patchbundle-selinux-base-policy-${NEWVERSION}.tar.bz2 *.patch > /dev/null 2>&1 || die "Failed to create patchbundle";
+  printf "done\n";
+
+  printf "Copying patch bundle into /usr/portage/distfiles and dev.g.o... ";
+  cp patchbundle-selinux-base-policy-${NEWVERSION}.tar.bz2 /usr/portage/distfiles || die "Failed to copy patchbundle to /usr/portage/distfiles";
+  scp patchbundle-selinux-base-policy-${NEWVERSION}.tar.bz2 ${REMOTELOCATION} > /dev/null 2>&1 || die "Failed to scopy patchbundle to ${REMOTELOCATION}";
+  printf "done\n";
+}
+
+# Create (or modify) the new ebuilds
+createEbuilds() {
+  cd ${GENTOOX86}/sec-policy;
+  printf "Removing old patchbundle references in Manifest (in case of rebuild)... ";
+  for PKG in *;
+  do
+    [[ -f "${PKG}/Manifest}" ]] || continue;
+    sed -i -e "/patchbundle-selinux-base-policy-${NEWVERSION}/d" ${PKG}/Manifest;
+  done
+  printf "done\n";
+
+  printf "Creating new ebuilds based on old version... ";
+  for PKG in *;
+  do
+    [[ -f "${PKG}/${PKG}-${OLDVERSION}.ebuild" ]] || continue;
+    cp ${PKG}/${PKG}-${OLDVERSION}.ebuild ${PKG}/${PKG}-${NEWVERSION}.ebuild;
+    sed -i -e "s/BASEPOL=\"${OLDVERSION}\"/BASEPOL=\"${NEWVERSION}\"/g" ${PKG}/${PKG}-${NEWVERSION}.ebuild;
+  done
+  printf "done\n";
+
+  printf "Marking ebuilds as ~arch... ";
+  for PKG in *;
+  do
+    [[ -f "${PKG}/${PKG}-${NEWVERSION}.ebuild" ]] || continue;
+    sed -i -e "s/KEYWORDS=\"amd64 x86\"/KEYWORDS=\"~amd64 ~x86\"/g" ${PKG}/${PKG}-${NEWVERSION}.ebuild;
+  done
+  printf "done\n";
+}
+
+# Create and push tag for new release
+tagRelease() {
+  printf "Creating tag ${NEWVERSION} in our repository... ";
+  cd ${HARDENEDREFPOL};
+  git tag -a ${NEWVERSION} -m "Release set of ${NEWVERSION}" > /dev/null 2>&1 || die "Failed to create tag";
+  git push origin ${NEWVERSION} > /dev/null 2>&1 || die "Faield to push tag to origin repository";
+  printf "done\n";
+};
+
+if [ $# -ne 2 ];
+then
+  usage;
+  exit 3;
+fi
+
+# Assert that all needed information is available
+assertDirEnvVar GENTOOX86;
+assertDirEnvVar HARDENEDREFPOL;
+assertDirEnvVar REFPOLRELEASE;
+
+TMPDIR=$(mktemp -d);
+touch ${TMPDIR}/.istempdir;
+
+# Build the patch
+buildpatch;
+# Create ebuilds
+createEbuilds;
+# Tag release
+tagRelease;
+
+cat << EOF
+The release has now been prepared.
+
+Please go do the following to finish up:
+- In ${GENTOOX86}/sec-policy go "cvs add" all the new ebuilds
+- In ${GENTOOX86}/sec-policy run "repoman manifest" and "repoman full"
+
+Then, before finally committing - do a run yourself, ensuring that the right
+version is deployed of course:
+- "emerge -1 $(qlist -IC sec-policy)"
+
+Only then do a 'repoman commit -m 'Release of ${NEWVERSION}''.
+EOF
+
+cleanTmp;


             reply	other threads:[~2013-09-26 13:19 UTC|newest]

Thread overview: 198+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-26 13:19 Sven Vermeulen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-03-08 23:55 [gentoo-commits] proj/hardened-refpolicy:master commit in: gentoo/ Jason Zaman
2025-01-06 21:08 Kenton Groombridge
2024-12-15  0:30 Jason Zaman
2024-09-22  0:03 Jason Zaman
2024-05-14 19:42 Kenton Groombridge
2024-03-01 19:56 Kenton Groombridge
2023-10-20 22:05 Kenton Groombridge
2023-10-06 16:44 Kenton Groombridge
2023-03-31 23:07 Kenton Groombridge
2023-02-13 15:35 Kenton Groombridge
2022-12-13 20:55 Kenton Groombridge
2022-11-02 14:42 Kenton Groombridge
2022-09-03 19:54 Jason Zaman
2022-09-03 19:10 Jason Zaman
2022-06-03 18:36 Kenton Groombridge
2022-06-03 18:36 Kenton Groombridge
2022-05-26 13:38 Jason Zaman
2022-04-09 19:28 Jason Zaman
2022-03-31  3:31 Jason Zaman
2022-02-27  2:52 Jason Zaman
2022-02-07  2:14 Jason Zaman
2022-01-31 19:31 Jason Zaman
2022-01-30  1:22 Jason Zaman
2021-11-21  3:00 Jason Zaman
2021-11-11 21:27 Jason Zaman
2021-11-11 21:27 Jason Zaman
2021-09-05 16:00 Jason Zaman
2021-04-03  3:10 Jason Zaman
2021-03-21 22:10 Jason Zaman
2021-03-21 22:10 Jason Zaman
2021-02-07  3:21 Jason Zaman
2021-02-01  2:10 Jason Zaman
2021-01-11  1:27 Jason Zaman
2021-01-11  1:27 Jason Zaman
2020-11-30  4:10 Jason Zaman
2020-11-28 23:09 Jason Zaman
2020-11-28 23:09 Jason Zaman
2020-10-13  3:02 Jason Zaman
2020-02-15 13:19 Jason Zaman
2020-02-15  7:33 Jason Zaman
2019-12-24 10:00 Jason Zaman
2019-12-16 17:48 Jason Zaman
2019-07-13  7:01 Jason Zaman
2019-07-13  7:01 Jason Zaman
2019-03-26 10:17 Jason Zaman
2019-02-10  6:21 Jason Zaman
2018-12-09 11:48 Jason Zaman
2018-11-11 23:29 Jason Zaman
2018-09-11  9:06 Jason Zaman
2018-07-12 14:37 Jason Zaman
2018-07-08 11:47 Jason Zaman
2018-06-25  5:33 Jason Zaman
2018-06-24  8:46 Jason Zaman
2018-06-24  8:46 Jason Zaman
2018-06-08 10:07 Jason Zaman
2018-04-26 11:21 Jason Zaman
2018-04-22 12:00 Jason Zaman
2018-03-25 10:29 Sven Vermeulen
2018-02-18 11:30 Jason Zaman
2018-01-18 16:37 Sven Vermeulen
2017-12-14  5:15 Jason Zaman
2017-12-14  5:15 Jason Zaman
2017-12-12  7:59 Jason Zaman
2017-11-17 14:59 Jason Zaman
2017-11-05  8:01 Jason Zaman
2017-10-31  5:40 Jason Zaman
2017-10-29 20:42 Jason Zaman
2017-09-17  4:21 Jason Zaman
2017-09-15  3:42 Jason Zaman
2017-09-09  3:02 Jason Zaman
2017-09-09  2:43 Jason Zaman
2017-06-13  8:25 Jason Zaman
2017-06-05 17:25 Jason Zaman
2017-05-25 16:43 Jason Zaman
2017-05-18 17:03 Sven Vermeulen
2017-05-07 16:09 Jason Zaman
2017-04-30 14:20 Jason Zaman
2017-04-30  9:40 [gentoo-commits] proj/hardened-refpolicy:next " Jason Zaman
2017-04-30  9:32 ` [gentoo-commits] proj/hardened-refpolicy:master " Jason Zaman
2017-04-10 16:59 Sven Vermeulen
2017-03-30 17:09 [gentoo-commits] proj/hardened-refpolicy:next " Jason Zaman
2017-03-30 17:06 ` [gentoo-commits] proj/hardened-refpolicy:master " Jason Zaman
2017-03-02 10:17 Sven Vermeulen
2017-02-27 10:50 Jason Zaman
2017-02-25 16:58 Jason Zaman
2017-02-25 14:59 [gentoo-commits] proj/hardened-refpolicy:next " Jason Zaman
2017-02-25 14:51 ` [gentoo-commits] proj/hardened-refpolicy:master " Jason Zaman
2017-02-21  7:11 Jason Zaman
2017-02-17  8:44 Jason Zaman
2017-02-05  6:29 Jason Zaman
2017-01-25 11:59 Jason Zaman
2017-01-23 15:44 Jason Zaman
2017-01-13 18:43 Sven Vermeulen
2017-01-01 16:36 Jason Zaman
2016-12-11 15:05 Jason Zaman
2016-12-08  5:03 Jason Zaman
2016-12-06 14:25 [gentoo-commits] proj/hardened-refpolicy:next " Jason Zaman
2016-12-06 13:39 ` [gentoo-commits] proj/hardened-refpolicy:master " Jason Zaman
2016-12-06 12:26 Jason Zaman
2016-10-24 16:02 Sven Vermeulen
2016-10-03  6:20 Jason Zaman
2016-08-31 16:38 Jason Zaman
2016-08-17 16:59 Jason Zaman
2016-08-13 18:32 Jason Zaman
2016-07-31 10:40 Sven Vermeulen
2016-07-31 10:38 Sven Vermeulen
2016-07-03 11:34 [gentoo-commits] proj/hardened-refpolicy:swift " Sven Vermeulen
2016-07-03 11:27 ` [gentoo-commits] proj/hardened-refpolicy:master " Sven Vermeulen
2016-07-03 11:33 Sven Vermeulen
2016-06-02  6:32 Jason Zaman
2016-05-13  5:37 Jason Zaman
2016-03-23 18:36 Jason Zaman
2016-03-11 17:20 Jason Zaman
2016-02-12  3:51 Jason Zaman
2016-01-30 17:21 Jason Zaman
2015-12-18  4:23 Jason Zaman
2015-10-26  5:36 [gentoo-commits] proj/hardened-refpolicy:next " Jason Zaman
2015-10-26  5:48 ` [gentoo-commits] proj/hardened-refpolicy:master " Jason Zaman
2015-10-13 14:50 Jason Zaman
2015-10-11 10:48 [gentoo-commits] proj/hardened-refpolicy:next " Jason Zaman
2015-09-20  7:00 ` [gentoo-commits] proj/hardened-refpolicy:master " Jason Zaman
2015-09-06 11:25 [gentoo-commits] proj/hardened-refpolicy:next " Jason Zaman
2015-09-06 11:25 ` [gentoo-commits] proj/hardened-refpolicy:master " Jason Zaman
2015-08-27 19:34 [gentoo-commits] proj/hardened-refpolicy:next " Jason Zaman
2015-08-27 19:52 ` [gentoo-commits] proj/hardened-refpolicy:master " Jason Zaman
2015-08-27 19:11 [gentoo-commits] proj/hardened-refpolicy:next " Jason Zaman
2015-08-27 19:11 ` [gentoo-commits] proj/hardened-refpolicy:master " Jason Zaman
2015-08-02 19:26 [gentoo-commits] proj/hardened-refpolicy:next " Jason Zaman
2015-08-02 19:23 ` [gentoo-commits] proj/hardened-refpolicy:master " Jason Zaman
2015-06-09 13:33 Jason Zaman
2015-06-07  9:06 Jason Zaman
2015-05-22 19:32 Jason Zaman
2015-04-22 21:46 Jason Zaman
2015-04-13 20:27 Jason Zaman
2015-03-25 16:01 [gentoo-commits] proj/hardened-refpolicy:next " Jason Zaman
2015-03-25 15:55 ` [gentoo-commits] proj/hardened-refpolicy:master " Jason Zaman
2015-02-19 10:46 Sven Vermeulen
2015-02-15 17:39 Sven Vermeulen
2015-01-29 20:53 Sven Vermeulen
2015-01-29 20:51 Sven Vermeulen
2015-01-02 17:22 Sven Vermeulen
2014-12-20 12:11 Sven Vermeulen
2014-12-07  9:56 Sven Vermeulen
2014-12-04 16:44 Jason Zaman
2014-12-03 12:54 Jason Zaman
2014-11-24 10:15 Jason Zaman
2014-11-22 16:25 Sven Vermeulen
2014-11-01 18:00 Sven Vermeulen
2014-11-01 18:00 Sven Vermeulen
2014-11-01 16:54 Sven Vermeulen
2014-10-31 15:32 Sven Vermeulen
2014-10-12  8:27 Sven Vermeulen
2014-09-21 14:04 Sven Vermeulen
2014-09-13  9:38 Sven Vermeulen
2014-09-13  9:38 Sven Vermeulen
2014-08-26 14:55 Sven Vermeulen
2014-08-26 14:55 Sven Vermeulen
2014-08-21 17:31 Sven Vermeulen
2014-08-19 20:07 Sven Vermeulen
2014-08-19 20:06 Sven Vermeulen
2014-08-19  9:19 Jason Zaman
2014-08-15 10:04 [gentoo-commits] proj/hardened-refpolicy:salt " Sven Vermeulen
2014-08-15 10:04 ` [gentoo-commits] proj/hardened-refpolicy:master " Sven Vermeulen
2014-08-09 19:24 Sven Vermeulen
2014-08-08 18:57 Sven Vermeulen
2014-07-29 14:07 Sven Vermeulen
2014-07-05 16:06 Sven Vermeulen
2014-06-30 19:03 Sven Vermeulen
2014-06-25 19:06 Sven Vermeulen
2014-06-10 18:17 Sven Vermeulen
2014-05-28 15:40 Sven Vermeulen
2014-05-22 16:33 Sven Vermeulen
2014-05-16 18:43 Sven Vermeulen
2014-04-30 17:14 Sven Vermeulen
2014-04-27 15:34 Sven Vermeulen
2014-04-21 15:25 Sven Vermeulen
2014-04-21 15:25 Sven Vermeulen
2014-04-17 19:04 Sven Vermeulen
2014-04-11 17:48 Sven Vermeulen
2014-04-11 17:48 Sven Vermeulen
2014-04-08 16:02 Sven Vermeulen
2014-03-17  8:24 Sven Vermeulen
2014-03-10 18:19 Sven Vermeulen
2014-03-06 15:20 Sven Vermeulen
2014-03-04 15:30 Sven Vermeulen
2014-03-04 15:30 Sven Vermeulen
2014-02-17 19:55 Sven Vermeulen
2014-02-09 10:54 Sven Vermeulen
2014-02-09 10:54 Sven Vermeulen
2014-02-01 10:00 Sven Vermeulen
2014-02-01  9:56 Sven Vermeulen
2014-01-28  8:09 Sven Vermeulen
2014-01-23 20:00 Sven Vermeulen
2014-01-19 19:08 Sven Vermeulen
2014-01-19 19:08 Sven Vermeulen
2013-12-20 21:00 Sven Vermeulen
2013-12-20 21:00 Sven Vermeulen
2013-12-20 19:47 Sven Vermeulen
2013-12-17  8:12 Sven Vermeulen
2013-12-12 12:37 Sven Vermeulen
2013-12-08 13:16 Sven Vermeulen
2013-12-06 17:33 Sven Vermeulen
2013-11-30 15:05 Sven Vermeulen
2013-11-25 19:16 Sven Vermeulen
2013-11-17 17:26 Sven Vermeulen
2013-11-17 17:26 Sven Vermeulen
2013-11-11 13:45 Sven Vermeulen
2013-09-30 19:04 Sven Vermeulen
2013-09-27 13:27 Sven Vermeulen
2013-09-26 13:19 Sven Vermeulen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1380201555.1276eb6dbfad00e2056488989640fa9b6851dd63.swift@gentoo \
    --to=swift@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox