From f2334e9e16bc2aa85a619e606cc2a38211544675 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 27 Nov 2013 11:27:20 -0200 Subject: Development: debian branch tagging --- development.mdwn | 1 + 1 file changed, 1 insertion(+) (limited to 'development.mdwn') diff --git a/development.mdwn b/development.mdwn index 3400643..1f475b6 100644 --- a/development.mdwn +++ b/development.mdwn @@ -60,6 +60,7 @@ Update the debian branch: git-import-orig --upstream-vcs-tag=$VERSION ../tarballs/keyringer-$VERSION.tar.bz2 dch -e # fine tune the changelog prepared by git-dch git commit -a -m "Updating debian/changelog" + git tag -s debian_keyringer_$VERSION-1 -m "Keyringer debian package $VERSION-1" Push everything: -- cgit v1.2.3 From 21e393464645c76c949d74180ce04b7507e0d738 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 10 Dec 2013 22:13:25 -0200 Subject: Adding 'teardown' action --- development.mdwn | 4 +--- lib/keyringer/actions/teardown | 27 +++++++++++++++++++++++++++ lib/keyringer/functions | 13 ++++++++++--- share/man/keyringer.1.mdwn | 4 ++++ 4 files changed, 42 insertions(+), 6 deletions(-) create mode 100755 lib/keyringer/actions/teardown (limited to 'development.mdwn') diff --git a/development.mdwn b/development.mdwn index 1f475b6..8366b59 100644 --- a/development.mdwn +++ b/development.mdwn @@ -102,9 +102,7 @@ Setup: Teardown: - rm -rf ~/code/tests/keyringer - rm ~/.keyringer/test - sed -i -e '/^test=/d' ~/.keyringer/config + keyringer test teardown -y Translation ----------- diff --git a/lib/keyringer/actions/teardown b/lib/keyringer/actions/teardown new file mode 100755 index 0000000..3d33da4 --- /dev/null +++ b/lib/keyringer/actions/teardown @@ -0,0 +1,27 @@ +#!/bin/bash +# +# Remove a keyring. +# + +# Load functions +LIB="`dirname $0`/../functions" +source "$LIB" || exit 1 + +# Options +CONFIRM="$2" + +if [ -z "$CONFIRM" ] || [ "$CONFIRM" != "-y" ]; then + echo "WARNING: about to remove the LOCAL copy of $KEYRING" + echo "WARNING: This will irrevocably destroy $KEYDIR" + echo "WARNING: the action cannot be undone!" + + read -rep "Are you sure to WIPE keyring $KEYRING (type YES to confirm)? " key + if [ "$key" != "YES" ]; then + exit 1 + fi +fi + +# Teardown +keyringer_shred `dirname $KEYDIR` +keyringer_shred $HOME/.keyringer/$KEYRING +sed -i -e "/^$KEYRING=/d" $HOME/.keyringer/config diff --git a/lib/keyringer/functions b/lib/keyringer/functions index 872dac9..0e795ee 100755 --- a/lib/keyringer/functions +++ b/lib/keyringer/functions @@ -206,10 +206,17 @@ function keyringer_shred { echo "$message $path using $tool..." if [ -d "$path" ]; then - find $path -exec $tool -f {} \; - rmdir $path + if [ "$tool" == "wipe" ] || [ "$tool" == "rm" ]; then + $tool -rf $path + else + find $path -exec $tool -uf {} \; + fi else - $tool -f "$path" + if [ "$tool" == "wipe" ] || [ "$tool" == "rm" ]; then + $tool -f "$path" + else + $tool -uf "$path" + fi fi } diff --git a/share/man/keyringer.1.mdwn b/share/man/keyringer.1.mdwn index f8d243e..ad9569b 100644 --- a/share/man/keyringer.1.mdwn +++ b/share/man/keyringer.1.mdwn @@ -74,6 +74,10 @@ shell All <*secret*> parameters from actions invoked from the shell are called relatively from the current selected directory. +teardown +: Remove permanently a local copy of a repository, very dangerous if you + have just a single copy. + # SECRET MANIPULATION ACTIONS All secret manipulation actions operate upon a *secret* which is the pathname -- cgit v1.2.3 From 457c714dfa4a533074e51f91e90aea6b5cac78f9 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 15 Dec 2013 13:27:56 -0200 Subject: Simplifying debian branch tagging --- development.mdwn | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'development.mdwn') diff --git a/development.mdwn b/development.mdwn index 8366b59..cf969fe 100644 --- a/development.mdwn +++ b/development.mdwn @@ -60,7 +60,7 @@ Update the debian branch: git-import-orig --upstream-vcs-tag=$VERSION ../tarballs/keyringer-$VERSION.tar.bz2 dch -e # fine tune the changelog prepared by git-dch git commit -a -m "Updating debian/changelog" - git tag -s debian_keyringer_$VERSION-1 -m "Keyringer debian package $VERSION-1" + git-buildpackage --git-tag-only --git-sign-tags Push everything: @@ -75,10 +75,6 @@ Run lintian (or [add it to your pbuilder hooks](http://askubuntu.com/questions/1 lintian --info --display-info --pedantic --color auto \ ../build-area/keyringer_$VERSION*.changes -Create a signed tag in the debian branch: - - git-buildpackage --git-tag-only --git-sign-tags - Notes: * `git-import-orig` takes care of running `pristine-tar commit`, of merging of the tag and orig tarball into the upstream branch, and then it merges the result into the debian branch. With the above configuration, it also runs git-dch to do the bulk of the work in `debian/changelog`. -- cgit v1.2.3