mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Michael Olbrich <m.olbrich@pengutronix.de>
Subject: [ptxdist] [PATCH] more pkg_xpkg_version sanitizing
Date: Fri,  9 Dec 2011 15:20:00 +0100	[thread overview]
Message-ID: <1323440400-29704-1-git-send-email-m.olbrich@pengutronix.de> (raw)
In-Reply-To: <3944866A166FC34A948C72DD5EDDCA2A1DC7CF77@HQ0SBS01.airtag.local>

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---

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 <PKG>_VERSION"
     fi
-- 
1.7.7.3


-- 
ptxdist mailing list
ptxdist@pengutronix.de

  parent reply	other threads:[~2011-12-09 14:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-29 15:59 [ptxdist] [PATCH] ptxdist-2011.01.0 bug in make ipkg-push Benoît BURNICHON
2011-12-02 15:26 ` Michael Olbrich
2011-12-03  4:46   ` [ptxdist] [PATCH] ptxd_ipkg_rev_smaller: fix compare Jon Ringle
2011-12-05 10:35   ` [ptxdist] [PATCH] ptxdist-2011.01.0 bug in make ipkg-push Benoît BURNICHON
2011-12-08 15:37 ` Michael Olbrich
2011-12-08 15:41   ` Michael Olbrich
2011-12-08 15:45   ` Jon Ringle
2011-12-08 15:55     ` Michael Olbrich
2011-12-08 17:38       ` Benoît BURNICHON
2011-12-09 10:09         ` Michael Olbrich
2011-12-09 14:20         ` Michael Olbrich [this message]
2011-12-12 16:51           ` [ptxdist] [PATCH] more pkg_xpkg_version sanitizing Jon Ringle

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=1323440400-29704-1-git-send-email-m.olbrich@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /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