From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mediacenter.hi.pengutronix.de ([2001:6f8:1178:2::65]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1RYg2U-0004wA-MH for ptxdist@pengutronix.de; Thu, 08 Dec 2011 16:37:38 +0100 Received: from mol by mediacenter.hi.pengutronix.de with local (Exim 4.72) (envelope-from ) id 1RYg2U-0004jw-L9 for ptxdist@pengutronix.de; Thu, 08 Dec 2011 16:37:38 +0100 Date: Thu, 8 Dec 2011 16:37:38 +0100 From: Michael Olbrich Message-ID: <20111208153738.GF11859@pengutronix.de> References: <3944866A166FC34A948C72DD5EDDCA2A1DC6A97C@HQ0SBS01.airtag.local> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <3944866A166FC34A948C72DD5EDDCA2A1DC6A97C@HQ0SBS01.airtag.local> Subject: Re: [ptxdist] [PATCH] ptxdist-2011.01.0 bug in make ipkg-push Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de Hi, so I accidentally pushed it before I could really review it... I had some time today and I think it's at least better than before. On Tue, Nov 29, 2011 at 03:59:41PM +0000, Beno=EEt BURNICHON wrote: > Now, ptxd_ipkg_rev_smaller does not enforce a revision to be 1.2.3-4 but > allows everything debian like. Well, not everything debian like, '~' is not handled correctly, right? Maybe something like this: ------------------------------------------------------------------------ --- libptxdist.sh 2011-12-08 16:11:21.143970557 +0100 +++ libptxdist.sh 2011-12-08 16:15:00.300421956 +0100 @@ -741,13 +741,14 @@ # ptxd_ipkg_rev_decimal_convert() { local ver=3D$* - while echo $ver | grep -q '[^0-9.]' + while echo $ver | grep -q '[^0-9.~]' do - local char=3D`echo -n $ver | sed 's/.*\([^0-9.]\).*/\1/'` + local char=3D`echo -n $ver | sed 's/.*\([^0-9.~]\).*/\1/'` local char_dec=3D`echo -n $char | od -b | head -n 1 | awk '{print $2}'` ver=3D`echo $ver | sed "s/$char/.$char_dec/g"` done = + ver=3D`echo $ver | sed -r "s/\.?~/.-1/g"` ver=3D`echo $ver | sed 's/\.\./.0/g'` = echo "$ver" ------------------------------------------------------------------------ So I've been thinking about this whole version issue. The next step would be all versions with '-'. Maybe we should always add '-1' as packages revision. That would solve the problem for most of the packages is the list, you posted some time ago. What remains are 'broken' versions. For those few we could do, e.g.: MYSQL_VERSION :=3D 5.1.14-beta MYSQL_XPKG_VERSION :=3D 5.1.14~beta For that we would need something like the patch above. Comments? Michael > --- > scripts/libptxdist.sh | 76 ++++++++++++++++++++++++++++++++++++++++---= ----- > 1 files changed, 63 insertions(+), 13 deletions(-) > = > diff --git a/scripts/libptxdist.sh b/scripts/libptxdist.sh > index 4385566..6b196cb 100644 > --- a/scripts/libptxdist.sh > +++ b/scripts/libptxdist.sh > @@ -739,6 +739,49 @@ ptxd_ipkg_arch() { > = > # > # > +ptxd_ipkg_rev_decimal_convert() { > + local ver=3D$* > + while echo $ver | grep -q '[^0-9.]' > + do > + local char=3D`echo -n $ver | sed 's/.*\([^0-9.]\).*/\1/'` > + local char_dec=3D`echo -n $char | od -b | head -n 1 | awk= '{print $2}'` > + ver=3D`echo $ver | sed "s/$char/.$char_dec/g"` > + done > + > + ver=3D`echo $ver | sed 's/\.\./.0/g'` > + > + echo "$ver" > +} > + > +# > +# > +ptxd_ipkg_do_version_check() { > + local ver1=3D$1 > + local ver2=3D$2 > + > + [ "$ver1" =3D=3D "$ver2" ] && return 10 > + > + local ver1front=3D`echo $ver1 | cut -d . -f 1` > + local ver1back=3D`echo $ver1 | cut -d . -f 2-` > + local ver2front=3D`echo $ver2 | cut -d . -f 1` > + local ver2back=3D`echo $ver2 | cut -d . -f 2-` > + > + if [ "$ver1front" !=3D "$ver1" -o "$ver2front" !=3D "$ver2" ] > + then > + [ "$ver1front" -lt "$ver2front" ] && return 9 > + [ "$ver1front" -gt "$ver2front" ] && return 11 > + > + [ "$ver1front" =3D=3D "$ver1" ] || [ -z "$ver1back" ] && = ver1back=3D0 > + [ "$ver2front" =3D=3D "$ver2" ] || [ -z "$ver2back" ] && = ver2back=3D0 > + ptxd_ipkg_do_version_check "$ver1back" "$ver2back" > + return $? > + else > + [ "$ver1" -lt "$ver2" ] && return 9 || return 11 > + fi > +} > + > +# > +# > ptxd_ipkg_rev_smaller() { > = > local first=3D`ptxd_ipkg_split $1` > @@ -747,19 +790,26 @@ ptxd_ipkg_rev_smaller() { > local second=3D`ptxd_ipkg_split $2` > local second_rev_upstream=3D`ptxd_ipkg_rev_upstream $second` > local second_rev_packet=3D`ptxd_ipkg_rev_package $second` > - local first_major=3D`echo $first_rev_upstream | awk -F. '{print $= 1}'` > - local first_minor=3D`echo $first_rev_upstream | awk -F. '{print $= 2}'` > - local first_micro=3D`echo $first_rev_upstream | awk -F. '{print $= 3}'` > - local second_major=3D`echo $second_rev_upstream | awk -F. '{print= $1}'` > - local second_minor=3D`echo $second_rev_upstream | awk -F. '{print= $2}'` > - local second_micro=3D`echo $second_rev_upstream | awk -F. '{print= $3}'` > - > - [ $first_major -lt $second_major ] && return 0 > - [ $first_major -gt $second_major ] && return 1 > - [ $first_minor -lt $second_minor ] && return 0 > - [ $first_minor -gt $second_minor ] && return 1 > - [ $first_micro -lt $second_micro ] && return 0 > - [ $first_micro -gt $second_micro ] && return 1 > + > + if [ "$first_rev_upstream" !=3D "$second_rev_upstream" ] > + then > + local first_rev_upstream_decimal=3D`ptxd_ipkg_rev_decimal= _convert $first_rev_upstream` > + local second_rev_upstream_decimal=3D`ptxd_ipkg_rev_decima= l_convert $second_rev_upstream` > + ptxd_ipkg_do_version_check "$first_rev_upstream_decimal" = "$second_rev_upstream_decimal" > + case "$?" in > + 9) > + return 0; > + ;; > + 10) > + ;; > + 11) > + return 1; > + ;; > + *) > + ptxd_error "issue while checking upstream= revisions" > + esac > + fi > + > [ $first_rev_packet -lt $second_rev_packet ] && return 0 > [ $first_rev_packet -gt $second_rev_packet ] && return 1 > = > -- > 1.7.2.5 -- = Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- = ptxdist mailing list ptxdist@pengutronix.de