From a3f0c6821a077c8a03712fe7a47831f65045eccf Mon Sep 17 00:00:00 2001 From: Andrew Gaffney Date: Tue, 2 Dec 2008 23:03:57 +0000 Subject: [PATCH] Change the handling of version_stamp a bit to preserve the existing prefix, such as hardened- svn path=/trunk/; revision=597 --- tools/ChangeLog | 4 ++++ tools/catalyst-auto | 11 +++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/ChangeLog b/tools/ChangeLog index ae39d1ec..e3c0e5dc 100644 --- a/tools/ChangeLog +++ b/tools/ChangeLog @@ -2,6 +2,10 @@ # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 # $Id$ + 02 Dec 2008; Andrew Gaffney catalyst-auto: + Change the handling of version_stamp a bit to preserve the existing + prefix, such as hardened- + 01 Dec 2008; Andrew Gaffney catalyst-auto-sparc64.conf: Change paths for sparc64 to match bender setup diff --git a/tools/catalyst-auto b/tools/catalyst-auto index ea6733dc..9f9e24c5 100755 --- a/tools/catalyst-auto +++ b/tools/catalyst-auto @@ -145,17 +145,20 @@ cd ${TMPDIR}/specs for i in $(find -name '*.spec'); do # Grab current version_stamp and source_subpath old_version_stamp=$(grep version_stamp ${i} | sed -e 's|^version_stamp: *||') - old_source_subpath=$(grep source_subpath ${i} | sed -e 's|^source_subpath: .\+-||') + old_source_subpath=$(grep source_subpath ${i} | sed -e 's|^source_subpath: *||') - sed -i 's|^version_stamp:.*$|version_stamp: '${DATESTAMP}'|' ${i} + new_version_stamp=$(echo "${old_version_stamp}" | sed -e 's|^\(.*-\)\?.*$|\1'${DATESTAMP}'|') + new_source_subpath=$(echo "${old_source_subpath}" | sed -e 's|'${old_version_stamp}'$|\1'${new_version_stamp}'|') + + sed -i 's|^version_stamp:.*$|version_stamp: '${new_version_stamp}'|' ${i} sed -i 's|^snapshot:.*$|snapshot: '${DATESTAMP}'|' ${i} # We don't want to mangle the source_subpath for our stage1 spec if ! grep -q '^target: *stage1$' ${i}; then - sed -i 's|^source_subpath: \(.\+-\).\+$|source_subpath: \1'${DATESTAMP}'|' ${i} + sed -i 's|^source_subpath:.*$|source_subpath: '${new_source_subpath}'|' ${i} fi - sed -i '/^livecd\/iso/s|'${old_version_stamp}'|'${DATESTAMP}'|' ${i} + sed -i '/^livecd\/iso/s|'${old_version_stamp}'|'${new_version_stamp}'|' ${i} kconfig_line=$(grep '^boot/kernel/[^/]\+/config:' ${i}) if [ -n "${kconfig_line}" ]; then