From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: From: Michael Olbrich Date: Fri, 9 Dec 2011 15:20:00 +0100 Message-Id: <1323440400-29704-1-git-send-email-m.olbrich@pengutronix.de> In-Reply-To: <3944866A166FC34A948C72DD5EDDCA2A1DC7CF77@HQ0SBS01.airtag.local> References: <3944866A166FC34A948C72DD5EDDCA2A1DC7CF77@HQ0SBS01.airtag.local> Subject: [ptxdist] [PATCH] more pkg_xpkg_version sanitizing Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de Cc: Michael Olbrich Signed-off-by: Michael Olbrich --- Does this look right? I'm also checking for '~' before alpha etc. otherwise it will be duplicated if it's already there. Michael scripts/lib/ptxd_make_xpkg_common.sh | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/scripts/lib/ptxd_make_xpkg_common.sh b/scripts/lib/ptxd_make_xpkg_common.sh index deccd12..e1b7013 100644 --- a/scripts/lib/ptxd_make_xpkg_common.sh +++ b/scripts/lib/ptxd_make_xpkg_common.sh @@ -70,9 +70,11 @@ ptxd_make_xpkg_init() { # # sanitize pkg_version # + # separate (alpha|beta|gamma|rc) with "~" # replace "_" by "." + # replace "-" by "+" # - pkg_xpkg_version="${pkg_version//_/.}" + pkg_xpkg_version="$(sed -r 's/[~-]?(alpha|beta|gamma|rc)/~\1/g' <<< ${pkg_version} | tr '_-' '.+')" if [ -z ${pkg_xpkg_version} ]; then ptxd_bailout "${FUNCNAME}: please define _VERSION" fi -- 1.7.7.3 -- ptxdist mailing list ptxdist@pengutronix.de