From 8080f0d48a23f9e450741cfd64d94694b37e2d7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Thu, 28 Dec 2017 20:10:17 +0000 Subject: Add scripts to split security-tracker into data and "binaries" git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@59003 e39458fd-73e7-0310-bf30-c45bca0a0e42 --- .../add-security-tracker-bin-submodule | 25 +++++++++++++++++++++ tools/git-migration/filter-sec-tracker-data | 26 ++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100755 tools/git-migration/add-security-tracker-bin-submodule create mode 100755 tools/git-migration/filter-sec-tracker-data (limited to 'tools') diff --git a/tools/git-migration/add-security-tracker-bin-submodule b/tools/git-migration/add-security-tracker-bin-submodule new file mode 100755 index 0000000000..23a9de17a8 --- /dev/null +++ b/tools/git-migration/add-security-tracker-bin-submodule @@ -0,0 +1,25 @@ +#!/bin/sh +# +# Wire up the security-tracker-bin submodule in security-tracker (the data) +# +# For the moment we create compat symlinks so everything stays in place. +# In the long run we should be able to get rid of most of them. +# +# This will be run only once when migrating from svn to git + +set -e + +SUBMODULE=security-tracker-bin + +# From salsa +#git submodule add ../${SUBMODULE} +# Local copy for testing +git submodule add file://$PWD/../$SUBMODULE + +git submodule update +for d in bin check-external lib static templates tools website; do + rm -f $d + ln -s $SUBMODULE/$d $d +done + +make check-syntax diff --git a/tools/git-migration/filter-sec-tracker-data b/tools/git-migration/filter-sec-tracker-data new file mode 100755 index 0000000000..e834d4e3a9 --- /dev/null +++ b/tools/git-migration/filter-sec-tracker-data @@ -0,0 +1,26 @@ +#!/bin/bash +# +# Separate security tracker data form the "binaries" +# +# With no option the data repo will be built, with +# "--binary" the binary repo will be built +# +# This will be run only once when migrating from svn to git + +FILTER='^(conf|data|doc|org|packages|stamps)/|^TODO.gitmigration|^Makefile|^.gitignore' +BRANCH=master + +OUT=v +if [ "$1" == "--binary" ]; then + OUT= +fi + +git filter-branch \ + --prune-empty \ + --index-filter " + git ls-tree -z -r --name-only --full-tree \$GIT_COMMIT \ + | grep -zZE'${OUT}' '"${FILTER}"' \ + | xargs -0 -r git rm --cached -r + " \ + -- \ +"${BRANCH}" -- cgit v1.2.3