From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: MIME-Version: 1.0 In-Reply-To: <1323440400-29704-1-git-send-email-m.olbrich@pengutronix.de> References: <3944866A166FC34A948C72DD5EDDCA2A1DC7CF77@HQ0SBS01.airtag.local> <1323440400-29704-1-git-send-email-m.olbrich@pengutronix.de> Date: Mon, 12 Dec 2011 11:51:30 -0500 Message-ID: From: Jon Ringle Subject: Re: [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: , Content-Type: multipart/mixed; boundary="===============0203591037==" Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de Cc: Michael Olbrich --===============0203591037== Content-Type: multipart/alternative; boundary=f46d0438920b4a476204b3e7f246 --f46d0438920b4a476204b3e7f246 Content-Type: text/plain; charset=ISO-8859-1 On Fri, Dec 9, 2011 at 9:20 AM, Michael Olbrich wrote: > 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 > I tested this with the dialog package and it worked as expected. Jon --f46d0438920b4a476204b3e7f246 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Fri, Dec 9, 2011 at 9:20 AM, Michael Olbrich = <m.olbrich= @pengutronix.de> wrote:
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---

Does this look right? I'm also checking for '~' before alpha et= c. otherwise
it will be duplicated if it's already there.

Michael

=A0scripts/lib/ptxd_make_xpkg_common.sh | =A0 =A04 +++-
=A01 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/scripts/lib/ptxd_make_xpkg_common.sh b/scripts/lib/ptxd_make_x= pkg_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() {
=A0 =A0 #
=A0 =A0 # sanitize pkg_version
=A0 =A0 #
+ =A0 =A0# separate (alpha|beta|gamma|rc) with "~"
=A0 =A0 # replace "_" by "."
+ =A0 =A0# replace "-" by "+"
=A0 =A0 #
- =A0 =A0pkg_xpkg_version=3D"${pkg_version//_/.}"
+ =A0 =A0pkg_xpkg_version=3D"$(sed -r 's/[~-]?(alpha|beta|gamma|rc= )/~\1/g' <<< ${pkg_version} | tr '_-' '.+')&qu= ot;
=A0 =A0 if [ -z ${pkg_xpkg_version} ]; then
=A0 =A0 =A0 =A0ptxd_bailout "${FUNCNAME}: please define <PKG>_V= ERSION"
=A0 =A0 fi

I tested this with the dial= og package and it worked as expected.

Jon
--f46d0438920b4a476204b3e7f246-- --===============0203591037== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- ptxdist mailing list ptxdist@pengutronix.de --===============0203591037==--