te mando por privado por los attachs lo que me pediste<br><br>ahi te encontre un ejemplo mas o menos interesante de ututo, esto produce el programita en perl que llama al que realmente separa el nombre en componentes y las compara de dos paquetes<br>
<br>las dos columnas son el nombre canonico, un invento mio, que seria como el nombre universal del paquete<br>y el nombre original de ututo/gentoo<br><br> ordenada: <br> baselayout_2.0.1_5.0__tbz2 => baselayout-2.0.1.tbz2<br>
baselayout_2.0.0_5.0__tbz2 => baselayout-2.0.0.tbz2<br> baselayout_2.0.0_1.3.1__tbz2 => baselayout-2.0.0_alpha3-r1.tbz2<br> baselayout_1.13.0_1.12.0__tbz2 => baselayout-1.13.0_alpha12.tbz2<br>
baselayout_1.13.0_1.10.2__tbz2 => baselayout-1.13.0_alpha10-r2.tbz2<br> baselayout_1.13.0_1.7.1__tbz2 => baselayout-1.13.0_alpha7-r1.tbz2<br> baselayout_1.13.0_1.5.1__tbz2 => baselayout-1.13.0_alpha5-r1.tbz2<br>
baselayout_1.13.0_1.3.0__tbz2 => baselayout-1.13.0_alpha3.tbz2<br> baselayout_1.13.0_1.1.1__tbz2 => baselayout-1.13.0_alpha1-r1.tbz2<br> baselayout_1.12.12_5.0__tbz2 => baselayout-1.12.12.tbz2<br>
baselayout_1.12.11.1_5.0__tbz2 => baselayout-1.12.11.1.tbz2<br> baselayout_1.12.10_5.5__tbz2 => baselayout-1.12.10-r5.tbz2<br> baselayout_1.12.10_5.4__tbz2 => baselayout-1.12.10-r4.tbz2<br>
baselayout_1.12.5_5.0__tbz2 => baselayout-1.12.5.tbz2<br> baselayout_1.12.4_5.7__tbz2 => baselayout-1.12.4-r7.tbz2<br> baselayout_1.12.4_5.3__tbz2 => baselayout-1.12.4-r3.tbz2<br><br>te lo acomode un poco al programa para que te sea mas significativo<br>
<br>se me quemo la fuente de mi pc donde tengo muchos sistemas instalados asi que solo te lo mando con ututo, que es lo que tengo a mano<br><br><br><br><div class="gmail_quote">2010/7/5 Diego Saravia <span dir="ltr"><<a href="mailto:dsa@unsa.edu.ar">dsa@unsa.edu.ar</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">bueno, en un rato te lo paso<br><br><div class="gmail_quote">2010/7/4 Pablo Manuel Rizzo <span dir="ltr"><<a href="mailto:info@pablorizzo.com" target="_blank">info@pablorizzo.com</a>></span><div>
<div></div><div class="h5"><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Me los pasas como adjuntos en un correo directo? porque pegando de acá<br>
me quedó con errores<br>
<br>
<br>
<br>
<br>
2010/7/3 Diego Saravia <<a href="mailto:dsa@unsa.edu.ar" target="_blank">dsa@unsa.edu.ar</a>>:<br>
<div><div></div><div>> dado que nos fuimos del mundial, te mando pablo un par de programas<br>
><br>
> el primero es uno en perl que llama al segundo para ordenar un archivo que<br>
> contiene una lista de archivos de ututo<br>
><br>
> es un ls *.tbz2 efectuado en un /ututo/i686, o sea un repositorio de<br>
> paquetes<br>
><br>
> al segundo si le das un argumento lo "canoniza"<br>
><br>
> o sea lo transforma en un nombre facilmente separable en sus variables y<br>
> ordenable<br>
><br>
> si le das dos argumentos, un paquete y un canonico los ordena, o sea da 1 si<br>
> a>b, 0 si son iguales y -1 si a<b<br>
><br>
> espero te sriva<br>
><br>
><br>
> #!/usr/bin/perl<br>
><br>
><br>
> sub first{<br>
> #my ($data2,$data1)=@_;<br>
> $data1=$a;<br>
> $data2=$b;<br>
> my $pack=`/home/dsa/dsatex/ubuild/scripts/upackname -o ${data2}.can<br>
> $data1`;<br>
> #print "/home/dsa/dsatex/ubuild/scripts/upackname -o ${data2}.can<br>
> $data1";<br>
> #print "pack:$pack";<br>
> my ($normresp,$order)=split(/ /,$pack);<br>
> #print "O:$order";<br>
> return $order+0;<br>
> }<br>
> use Data::Dumper;<br>
> open(FILE, "/home/dsa/ubtest/listapack");<br>
> while(<FILE>){<br>
><br>
> $count++;<br>
> if ($count>10){last}<br>
> chomp $_;<br>
> $pack=`/home/dsa/dsatex/ubuild/scripts/upackname -o $_`;<br>
> chomp $pack;<br>
> ($nombre,$version,$release,$system,$ext)=split(/_/,$pack);<br>
> $datos=[$nombre,$version,$release,$system,$ext,$pack,$_];<br>
> print "Pro: $nombre,$version,$release,$system,$ext\n";<br>
> $dat->{$nombre}=[@{$dat->{$nombre}},$datos];<br>
> $lista->{$nombre}=[@{$lista->{$nombre}},$pack];<br>
> }<br>
> close(FILE);<br>
><br>
> #print"hh", Dumper $dat;<br>
><br>
> foreach my $nombre (keys %$dat){<br>
> print $nombre,"\n";<br>
> $datacomp=$dat->{$nombre}->[0]->[5];<br>
> print " ingresa: @{$lista->{$nombre}} \n";<br>
> @ordenada=sort first @{$lista->{$nombre}};<br>
> print "ordenada: @ordenada \n";<br>
> foreach my $data (@{$dat->{$nombre}}){<br>
><br>
> ($n,$v,$r,$s,$e,$p,$o)=@$data;<br>
><br>
> $pack2=`/home/dsa/dsatex/ubuild/scripts/upackname -o $o $datacomp`;<br>
> #print "BBBB$pack2\n";<br>
> ($normresp,$order)=split(/ /,$pack2);<br>
> ($nc,$vc,$rc,$sc,$ec)=split(/_/,$datacomp);<br>
> print " $v $r $s $e $p $o \n";<br>
> print " $vc $rc $sc $ec - $normresp - $datacomp : $order \n";<br>
><br>
> #$normresp - $datacomp - $order\n";<br>
> }<br>
><br>
> }<br>
><br>
><br>
> ######################################<br>
><br>
> #!/bin/bash<br>
><br>
> version(){<br>
> cat <<EOF<br>
> upackname $PROG_VERSION<br>
> Copyright (C) 2010 Diego Saravia <<a href="mailto:dsa@unsa.edu.ar" target="_blank">dsa@unsa.edu.ar</a>><br>
> License: $PROG_LICENCE<br>
> <<a href="http://gnu.org/licenses/gpl.html" target="_blank">http://gnu.org/licenses/gpl.html</a>><br>
> EOF<br>
> }<br>
><br>
> help(){<br>
> cat <<EOF<br>
> upackname PACKAGE<br>
><br>
> Splits package string in name, version and extension<br>
><br>
> Prints<br>
> PACKSTRING: Complete file name<br>
> PACKDIR: Directories preceding file name<br>
> PACKTYPE: NOEXT|UNKNOWNPKGEXT|BINPKGEXT|LISTEXT|METAEXT<br>
> PACKEXT: Extension (rpm, deb, ebuild, tbz2, etc)<br>
> PACKSYSTEM: i686, x86_64, hurd-i386, etc<br>
> PACKNAME: Packname<br>
> PACKVERSION: Complete version<br>
> PACKSV: Source Version<br>
> PACKRV: Release Version<br>
> PACKRVORDER: Release Version in Gentoo transformed for comparisson.<br>
><br>
> PACKCOMPLETENAME: without extension<br>
> PACKCOMPLETENORMALIZEDNAME: without extension in a normalized fashion<br>
> EOF<br>
> }<br>
><br>
> usage(){<br>
> cat <<EOF<br>
> Usage:<br>
> upackname PACKAGE<br>
> EOF<br>
> }<br>
><br>
> extsep(){<br>
> for ext in $2 ; do<br>
> rext=`echo $ext | sed 's|\.|\\\.|' `<br>
> first=`echo $1 | sed "s/\.$rext\$//"`<br>
> if test "x$first" != "x$1"; then<br>
> PACKEXT=$ext<br>
> PACKTYPE=$3<br>
> PACKNOEXT=$first<br>
> break<br>
> fi<br>
> done<br>
> }<br>
><br>
> PROG_VERSION=0.1<br>
> PROG_LICENCE="AGPLv3+: GNU AGPL version 3 or later"<br>
> oneline=0<br>
> while test $# -gt 0 ; do<br>
> case "$1" in<br>
> -h|--help)<br>
> help<br>
> ;;<br>
> -v|-V|--version)<br>
> version<br>
> ;;<br>
> -u|--usage)<br>
> usage<br>
> ;;<br>
> -o|--oneline)<br>
> oneline=1<br>
> ;;<br>
> *)<br>
> FILES=$@<br>
> break<br>
> ;;<br>
> esac<br>
> shift<br>
> done<br>
><br>
><br>
> if test x"$1" = x ; then<br>
> usage<br>
> exit<br>
> fi<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> anachar(){<br>
> local CADENA=$1<br>
> local char=$2<br>
><br>
> estext=`expr "$char" : '\([a-zA-Z0\.]\)'`<br>
> if test x"$estext" != x ; then<br>
> #echo CHAR $char<br>
> ES=CHAR<br>
> saca=$char<br>
> nume= # no es necesario<br>
> else<br>
> nume=`expr "$CADENA" : '\([0-9]\+\)'`<br>
> if test x"$nume" = x ; then<br>
> saca=$char<br>
> # lo pongo como char<br>
> #ES=OTHER<br>
> ES=CHAR<br>
> #echo CHAR OTHER $char<br>
> # es al vicio, solo preguntar por numeros<br>
> #echo SEPARA $char<br>
> #char=''<br>
> else<br>
> #echo NUM $nume<br>
> ES=NUMB<br>
> saca=$nume<br>
> fi<br>
> fi<br>
><br>
><br>
> }<br>
><br>
><br>
> # ver caracter ~ en debian<br>
> order(){<br>
> # returns first as compared to second<br>
> CADENA1=$1<br>
> CADENA2=$2<br>
> #echo 1: $CADENA1 - 2: $CADENA2<br>
><br>
> while true ; do<br>
> char1=${CADENA1:0:1}<br>
> char2=${CADENA2:0:1}<br>
> #echo CHAR1: $char1 - CHAR2: $char2<br>
> if test x"$char1" = x -a x"$char2" = x ; then<br>
> #echo SON IGUALES<br>
> ORDER=0<br>
> break<br>
> elif test x"$char1" = x -a x"$char2" != x ; then<br>
> #echo CADENA1 PRIMERO T<br>
> ORDER=-1<br>
> break<br>
> elif test x"$char1" != x -a x"$char2" = x ; then<br>
> #echo CADENA2 PRIMERO T<br>
> ORDER=1<br>
> break<br>
> fi<br>
><br>
> anachar $CADENA1 $char1<br>
> CADENA1=${CADENA1#$saca}<br>
> ES1=$ES<br>
> nume1=$nume<br>
><br>
> anachar $CADENA2 $char2<br>
> CADENA2=${CADENA2#$saca}<br>
> ES2=$ES<br>
> nume2=$nume<br>
> #RES="$ES1 - $ES2 - $char1 - $char2 - $nume1 - $nume2"<br>
><br>
> if test x"$ES1" = xNUMB -a x"$ES2" = xNUMB ; then<br>
> if test x"$nume1" = x"$nume2" ; then<br>
> #echo continue IGUALES NUMB: $RES<br>
> continue<br>
> elif test $nume1 -gt $nume2; then<br>
> #echo "CADENA2 PRI 2 : $RES"<br>
> ORDER=1<br>
> else<br>
> #echo "CADENA1 PRI 2 : $RES"<br>
> ORDER=-1<br>
> fi<br>
> break<br>
><br>
> elif test x"$ES1" = xCHAR -a x"$ES2" = xCHAR ; then<br>
> if test x"$char1" = x"$char2" ; then<br>
> #echo continue IGUALES CHAR: $RES<br>
> continue<br>
> elif test $char1 > $char2; then<br>
> #echo "CADENA1 PRI 3 : $RES"<br>
> ORDER=-1<br>
> else<br>
> #echo "CADENA2 PRI 3 : $RES"<br>
> ORDER=1<br>
> fi<br>
> break<br>
><br>
> elif test x"$ES1" = xCHAR -a x"$ES2" = xNUMB ; then<br>
> if test x"$char1" = x0 ; then<br>
> #echo "CADENA1 PRI 4 0 : $RES"<br>
> ORDER=-1<br>
> break<br>
> else<br>
> #echo "CADENA2 PRI 4 : $RES"<br>
> ORDER=1<br>
> fi<br>
> break<br>
> elif test x"$ES1" = xNUMB -a x"$ES2" = xCHAR ; then<br>
> if test x"$char2" = x0 ; then<br>
> #echo "CADENA2 PRI 4 0 : $RES"<br>
> ORDER=1<br>
> else<br>
> #echo "CADENA1 PRI 4 : $RES"<br>
> ORDER=-1<br>
> fi<br>
> break<br>
> fi<br>
><br>
> #echo lll $char - $nume - $EST - $estext - $CADENA1<br>
> done<br>
> }<br>
><br>
> #order apo1002300.001.45g.ui67 apo1002300.001.45g.ui68b<br>
><br>
> #echo OOO $ORDER<br>
> #exit<br>
><br>
><br>
> PACK=$1<br>
> COMPPACK=$2<br>
><br>
> #echo NNN $1 JJJ $2 KKK<br>
> #PACKSTRING=`basename $PACK`<br>
> PACKSTRING=`echo $PACK | awk -F/ '{print $NF}'`<br>
> PACKDIRPRE=${PACK%${PACKSTRING}} # en dos pasos por si no tiene /<br>
><br>
> if test x"$PACKDIRPRE" = x/ ; then<br>
> PACKDIR=/<br>
> else<br>
> PACKDIR=${PACKDIRPRE%/}<br>
> fi<br>
><br>
> # 4 kind: file list (lf), metapacks (ebuild ubuild suma), binary packs,<br>
> source packs<br>
> METAEXT="ebuild ubuild summa"<br>
> LISTEXT="lf can"<br>
> # esto no es asi, cambiar<br>
><br>
> #KNOWN:<br>
> BINPKGEXT="tgz tbz2 deb rpm"<br>
> #SEE:<br>
> PKGEXT="tar.gz tgz <a href="http://tar.bz" target="_blank">tar.bz</a> tar.bz2 tbz tbz2 ZIP sip jar gz Z z bz2 bz 7Z 7z<br>
> RAR rar LHa LHA lha lzh a deb lzma xz rpm"<br>
><br>
> PACKTYPE=0 # EXIST EXTENSION<br>
> PACKEXT=""<br>
> # packtype<br>
> PACKNAMEVERS=$PACKSTRING<br>
><br>
><br>
> ########################################3 test sobre archivos reales, ver<br>
> que pasa si no se quiere esto<br>
> # o sea proveer<br>
><br>
><br>
> # basename?<br>
><br>
> extsep $PACKSTRING "$BINPKGEXT" BINPKGEXT<br>
><br>
> if test x"$PACKEXT" = x ; then<br>
> extsep $PACKSTRING "$LISTEXT" LISTEXT<br>
> fi<br>
> if test x"$PACKEXT" = x ; then<br>
> extsep $PACKSTRING "$METAEXT" METAEXT<br>
> fi<br>
><br>
><br>
> if test x"$PACKEXT" = x ; then<br>
> PACKEXT=`echo $PACKSTRING | awk -F. '{print $NF}'`<br>
> PACKNOEXT=${PACKSTRING%.${PACKEXT}}<br>
> PACKTYPE=UNKNOWNPKGEXT<br>
> fi<br>
> if test x"$PACKEXT" = x ; then<br>
> PACKNOEXT=$PACKSTRING<br>
> PACKTYPE=NOEXT<br>
> fi<br>
><br>
><br>
> #echo mmmmmmmmmmmmmmm $PACKEXT<br>
> PACKERROR=''<br>
><br>
><br>
> case $PACKEXT in<br>
> can)<br>
> `echo $PACKNOEXT| sed 's/\(.*\)_\(.*\)_\(.*\)_\(.*\)_\(.*\)$/export<br>
> PACKNAME\=\1 PACKSV\=\2 PACKRVORDER\=\3 PACKSYSTEM\=\4 PACKEXT\=\5'/`<br>
><br>
> #echo CAN $PACKNAME $PACKSV $PACKRVORDER $PACKEXT<br>
> ;;<br>
> ebuild|ubuild|tbz2)<br>
> # en build info o ebuild no parece haber info sobre nombre o version<br>
><br>
> #<a href="http://distfiles.gentoo.org/distfiles/pms-3.pdf" target="_blank">http://distfiles.gentoo.org/distfiles/pms-3.pdf</a><br>
><br>
> `echo $PACKNOEXT | sed -e<br>
> 's/\(.*\)-\(\([[:digit:]]\+\(\.[[:digit:]]\+\)*\+[a-z]\?\)\(\(_\(alpha\|beta\|pre\|rc\|p\)[[:digit:]]*\)*\(-r\([[:digit:]]\+\)\)\?\)\)$/export<br>
> PACKNAME=\1 PACKVERSION=\2 PACKSV=\3 PACKRVPRE=\5 PACKGENTOOPRE=\6<br>
> PACKGENTOORE=\8 PACKGENTOORENUM=\9/'`<br>
><br>
> if test x"$PACKNAME" = x ; then<br>
> echo ERROR, NO ES UN ARCHIVO GENTOO<br>
> PACKERROR="No es Gentoo"<br>
> fi<br>
><br>
> if test x"$PACKGENTOOPRE" = x ; then<br>
> #PACKRV=${PACKRVPRE#-} # no porque a veces debbiera agregar _ y otras -<br>
> PACKSRORDER=5<br>
> else<br>
> #PACKRV=$PACKRVPRE<br>
> PACKSRORDERPRE=`echo $PACKGENTOOPRE| sed -r -e "s/_alpha/1./" \<br>
> -e "s/_beta/2./" \<br>
> -e "s/_pre/3./" \<br>
> -e "s/_rc/4./" \<br>
> -e "s/_p/6./" `<br>
><br>
> PACKSRORDER=`echo $PACKSRORDERPRE| sed -e 's/\.$//' `<br>
><br>
> fi<br>
><br>
> PACKRV=$PACKRVPRE<br>
><br>
> if test x"$PACKGENTOORE" = x ; then<br>
> PACKRVORDER=$PACKSRORDER.0<br>
> else<br>
> PACKRVORDER=$PACKSRORDER.$PACKGENTOORENUM<br>
> fi<br>
><br>
> #echo bbbbbbbbbbbbbbb $PACKGENTOOPRE $PACKGENTOORE - $PACKGENTOORENUM -<br>
> $PACKSRORDER - $PACKSRORDERPRE<br>
><br>
><br>
> #PACKNAME=sed -e<br>
> 's/(.*\)\(-[[:digit:]]\+\(\.[[:digit:]]\+\)*\+[a-z]\?\(_\(alpha\|beta\|pre\|rc\|p\)[[:digit:]]*\)*\(-r[[:digit:]]\+\)\?\)$//'`<br>
> #PACKVERSION=`echo $PACK|cut -d- -f2-`<br>
> #if test x"$PACKVERSION" = x"$PACKNAME" ; then # esto es raro,<br>
> # PACKVERSION=''<br>
> # # que el cut ponga el primer campo si no hay segundo ver<br>
> # #PACKVERSION=0<br>
> # fi<br>
><br>
> #sed 's/-[0-9]\{1,\}.*$//'<br>
> ;;<br>
><br>
> #Ebuild file names consist of four logical subsections:<br>
><br>
> #pkg-ver{_suf{#}}{-r#}.ebuild<br>
><br>
> #Note: The brackets ({}) delineate optional fields and do not appear in the<br>
> literal package name. # represents any non-zero positive integer.<br>
><br>
> #The first subsection, pkg, is the package name, which should only contain<br>
> lowercase letters, the digits 0-9, and any number of single hyphen (-),<br>
> underscore (_) or plus (+) characters. Examples: util-linux, sysklogd and<br>
> gtk+. We have some packages in Portage that don't follow these rules, but<br>
> your packages should.<br>
><br>
> #The second subsection, ver, is the version of the package, which should<br>
> normally be same as the version on the main source tarball. The version is<br>
> normally made up of two or three (or more) numbers separated by periods,<br>
> such as 1.2 or 4.5.2, and may have a single letter immediately following the<br>
> last digit; e.g., 1.4b or 2.6h. The package version is joined to the package<br>
> name with a hyphen. For example: foo-1.0, bar-2.4.6.<br>
><br>
> #Important: If you're thinking of using a trailing letter in your version<br>
> string, note that the trailing letter should not be used to signify alpha or<br>
> beta status for the package, since alphas and betas are prereleases and<br>
> letter revisions are newer versions. This is an important distinction<br>
> because Portage uses an ebuild's version number to determine if it is newer<br>
> or older than other packages with the same category and name. It's very<br>
> important that version numbers faithfully represent the version of the<br>
> package so that Portage properly performs its dependency checking duties.<br>
><br>
> #The third subsection, {_suf{#}}, is optional and may contain one of these<br>
> predefined suffixes, listed in least-recent to most-recent order:<br>
> #Suffix Meaning<br>
> #_alpha Alpha release<br>
> #_beta Beta release<br>
> #_pre Prerelease<br>
> #_rc Release candidate<br>
> #(none) Normal release<br>
> #_p Patch level (normally accompanied by trailing integer)<br>
><br>
> #Any of these suffixes may be immediately followed by a non-zero positive<br>
> integer, e.g., linux-2.4.0_pre10. Assuming identical version parts, the<br>
> suffixes are ordered as follows (lower means older): _alpha < _beta < _pre <<br>
> _rc < (no suffix) < _p.<br>
><br>
> #When comparing identical suffixes with trailing integers, the one with the<br>
> larger integer will be considered most recent. Example: foo-1.0_alpha4 is<br>
> more recent than foo-1.0_alpha3.<br>
><br>
> #The fourth subsection of the package name is the Gentoo Linux-specific<br>
> revision number ({-r#}). This subsection, like the suffix, is also optional.<br>
> # is a non-zero positive integer; e.g., package-4.5.3-r3.<br>
><br>
> #This revision number is independent of the version of the source tarball<br>
> and is used to inform people that a new and improved Gentoo Linux revision<br>
> of a particular package is available. Initial releases of ebuilds must have<br>
> no revision number; e.g., package-4.5.3 and are considered by Portage to<br>
> have a revision number of zero. This means that counting goes as follows:<br>
> 1.0 (initial version), 1.0-r1, 1.0-r2, etc.<br>
><br>
> #If you make non-trivial improvements to an existing ebuild file, you should<br>
> copy the ebuild file to a new file with the revision number incremented by<br>
> 1. Remember to always make mentions of your changes in the ChangeLog when<br>
> you bump a revision and in your CVS commit message; not doing so is against<br>
> policy.<br>
><br>
> #... and I suppose that we actually have a fifth section of the ebuild name<br>
> as well -- the .ebuild extension itself.<br>
><br>
> rpm)<br>
> # spec si hay nombre, version y release, verificar que esto funcione bien al<br>
> abrir cada paquete<br>
><br>
> # PACKNAME=`echo $PACKNOEXT |sed 's/-[^-]*-[^-]*$//'`<br>
> PACKNAME=`echo $PACKNOEXT |sed 's/-[^-]*-.*$//'`<br>
> PACKVERSIONPRE=${PACKNOEXT#${PACKNAME}} # primero el nombre por si es<br>
> todo<br>
> PACKVERSIONSYS=${PACKVERSIONPRE#-}<br>
><br>
> if test x"$PACKNAME" = x ; then<br>
> echo ERROR, NO ES UN ARCHIVO RPM<br>
> PACKERROR="No es RPM"<br>
> fi<br>
><br>
><br>
> PACKVERSION=`echo $PACKVERSIONSYS | sed<br>
> 's/\.\(\(darwin\|freebsd\|netbsd\|kfreebsd\|knetbsd\|openbsd\|hurd\|gnu\|linux\)-\)\?\(noarch\|src\|i486\|i586\|i686\|athlon\|ppc\|x86_64\|i386\|ia64\|alpha\|amd64\|armeb\|arm\|hppa\|m32r\|m68k\|mips\|mipsel\|powerpc\|ppc64\|s390\|s390x\|sh3\|sh3eb\|sh4\|sh4eb\|sparc\)$//'`<br>
> PACKSYSTEMPRE=${PACKVERSIONSYS#${PACKVERSION}} # primero el nombre por<br>
> si es todo<br>
> PACKSYSTEM=${PACKSYSTEMPRE#.}<br>
><br>
> PACKNOSYSTEM=$PACKNAME-$PACKVERSION<br>
><br>
> `echo $PACKVERSION| sed 's/\([^-]*\)-\(.*\)$/export PACKSV\=\1<br>
> PACKRV\=\2/'`<br>
><br>
><br>
><br>
><br>
><br>
><br>
> # echo KKKK $PACKSV KKKKK $PACKSYSTEM KKKKKK $PACKRV<br>
><br>
><br>
><br>
> # `echo $PACKNOEXT | sed -e<br>
> 's/\([a-zA-Z0-9_\-\+]*\)-\([a-zA-Z0-9_\.]*\)-\([a-zA-Z0-9_\.]*\)\.\(noarch\|src\|i386\|i686\|athlon\|ppc\|x86_64\)$/export<br>
> PACKNAME\="\1" PACKVERSION\="\2-\3.\4" PACKOV\="\2" PACKRV\="\3"<br>
> PACKARCH\="\4"/'`<br>
><br>
> #older systems do not have arch part, see<br>
> # my $name = $1;<br>
> # my $version = $2;<br>
> # my $release = $3;<br>
> # my $arch = $4;<br>
><br>
> #$ rpm -qp --qf '%{NAME}' some.rpm<br>
><br>
> #rpm -qa|sed 's/-[^-]*-[^-]*$//'<br>
><br>
> #RPM <name>-<version>-<release>.<architecture>.rpm nano-0.98-2.i386.rpm<br>
> libgnomeuimm-2.0-2.0.0-3.src.rpm<br>
><br>
> #A package label is contained within the file and does not necessarily<br>
> #need to match the name of the file.<br>
><br>
> #Additionally, libraries are distributed in two separate packages for<br>
> #each version. One contains the precompiled code, while the second one<br>
> #contains the development files such as headers, static library files,<br>
> #etc. for the library in question. Those packages have "-devel" appended<br>
> to their name field. Users need to carefully check so that<br>
> #the version of the development package matches that of the binary<br>
> #package, otherwise the library may not work very well.<br>
> ;;<br>
><br>
> deb)<br>
><br>
> # en control parece haber info sobre el nombre, no sobre las versiones, usar<br>
> para verificar<br>
><br>
> #DEB<br>
> <foo>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb<br>
><br>
> PACKNAME=`echo $PACKNOEXT | awk -F_ '{print $1}'`<br>
> PACKVERSIONSYSPRE=${PACKNOEXT#${PACKNAME}} # en dos pasos por si el<br>
> nombre debian esta mal y no usa _<br>
> PACKVERSIONSYS=${PACKVERSIONSYSPRE#_}<br>
><br>
> if test x"$PACKNAME" = x ; then<br>
> echo ERROR, NO ES UN ARCHIVO DEB<br>
> PACKERROR="No es deb"<br>
> fi<br>
><br>
> #echo MMMMM $PACKVERSION<br>
> #igual que el rpm con _ en vez de .<br>
> PACKVERSION=`echo $PACKVERSIONSYS | sed<br>
> 's/_\(\(darwin\|freebsd\|netbsd\|kfreebsd\|knetbsd\|openbsd\|hurd\|gnu\|linux\)-\)\?\(noarch\|src\|i486\|i586\|i686\|athlon\|ppc\|x86_64\|i386\|ia64\|alpha\|amd64\|armeb\|arm\|hppa\|m32r\|m68k\|mips\|mipsel\|powerpc\|ppc64\|s390\|s390x\|sh3\|sh3eb\|sh4\|sh4eb\|sparc\)$//'`<br>
><br>
> if test x"$PACKVERSION" = x ; then<br>
> echo ERROR, NO ES UN ARCHIVO DEB<br>
> PACKERROR="No es deb"<br>
> fi<br>
><br>
> PACKNOSYSTEM=$PACKNAME_$PACKVERSION<br>
> echo MMMMM $PACKVERSION - $PACKNOSYSTEM<br>
> PACKSYSTEMPRE=${PACKVERSIONSYS#${PACKVERSION}} # primero el nombre por<br>
> si es todo<br>
> PACKSYSTEM=${PACKSYSTEMPRE#_}<br>
><br>
> `echo $PACKVERSION| sed 's/\([^-]*\)-\(.*\)$/export PACKSV\=\1<br>
> PACKRV\=\2/'`<br>
><br>
> if test x"$PACKSV" = x ; then<br>
> echo ERROR, NO ES UN ARCHIVO DEB<br>
> PACKERROR="No es deb"<br>
> fi<br>
><br>
> # echo KKKK $PACKSV KKKKK $PACKSYSTEM KKKKKK $PACKRV KKKK<br>
> $PACKNOSYSTEM<br>
><br>
><br>
> #\([a-z][a-z0-9\+\-\.]+\)_\([a-zA-Z0-9_\.]*\)-\([0-9a-zA-Z\+\.\~]+\)_\(noarch\|src\|noarch\|i386\|i686\|athlon\|ppc\|x86_64\)<br>
><br>
> #The name of the package itself (not the filename, just the name of the<br>
> package) can contain lowercase letters, numbers, and the "-" and "+"<br>
> characters.<br>
> #debian_revision<br>
><br>
> #This part of the version number specifies the version of the Debian<br>
> package based on the upstream version.<br>
> #It may contain only alphanumerics and the characters + . ~ (plus, full<br>
> stop, tilde) and is compared in the same way as the upstream_version is.<br>
> #It is optional; if it isn't present then the upstream_version may not<br>
> contain a hyphen.<br>
> #This format represents the case where a piece of software was written<br>
> specifically to be turned into a Debian package,<br>
> #and so there is only one "debianisation" of it and therefore no<br>
> revision indication is required.<br>
> #It is conventional to restart the debian_revision at 1 each time the<br>
> upstream_version is increased.<br>
> #The package management system will break the version number apart at<br>
> the last hyphen in the string<br>
> #(if there is one) to determine the upstream_version and<br>
> debian_revision. The absence of a debian_revision is equivalent to a<br>
> debian_revision of 0<br>
><br>
> #The VVV component is the version number specified by the upstream<br>
> #developer. There are no standards in place here, so the version number<br>
> #may have formats as different as "19990513" and "1.3.8pre1".<br>
><br>
> #The RRR component is the Debian revision number, and is specified by<br>
> #the Debian developer (or an individual user if he chooses to build the<br>
> #package himself). This number corresponds to the revision level of the<br>
> #Debian package, thus, a new revision level usually signifies changes<br>
> #in the Debian Makefile (debian/rules), the Debian control file<br>
> #(debian/control), the installation or removal scripts (debian/p*), or<br>
> #in the configuration files used with the package.<br>
><br>
> #The AAA component identifies the processor for which the package was<br>
> #built. This is commonly i386, which refers to chips compatible to<br>
> #Intel's 386 or later versions. For other possibilities review Debian's<br>
> #FTP directory structure at What are all those directories at the<br>
> #Debian FTP archives?, Section 6.7. For details, see the description of<br>
> #"Debian architecture" in the manual page dpkg-architecture(1).<br>
><br>
> #<br>
><br>
> #i386 ia64 alpha amd64 armeb arm hppa m32r m68k mips mipsel powerpc<br>
> ppc64 s390 s390x sh3 sh3eb sh4 sh4eb sparc darwin-i386 darwin-ia64<br>
> darwin-alpha darwin-amd64 darwin-armeb darwin-arm darwin-hppa darwin-m32r<br>
> darwin-m68k darwin-mips darwin-mipsel darwin-powerpc darwin-ppc64<br>
> darwin-s390 darwin-s390x darwin-sh3 darwin-sh3eb darwin-sh4 darwin-sh4eb<br>
> darwin-sparc freebsd-i386 freebsd-ia64 freebsd-alpha freebsd-amd64<br>
> freebsd-armeb freebsd-arm freebsd-hppa freebsd-m32r freebsd-m68k<br>
> freebsd-mips freebsd-mipsel freebsd-powerpc freebsd-ppc64 freebsd-s390<br>
> freebsd-s390x freebsd-sh3 freebsd-sh3eb freebsd-sh4 freebsd-sh4eb<br>
> freebsd-sparc kfreebsd-i386 kfreebsd-ia64 kfreebsd-alpha kfreebsd-amd64<br>
> kfreebsd-armeb kfreebsd-arm kfreebsd-hppa kfreebsd-m32r kfreebsd-m68k<br>
> kfreebsd-mips kfreebsd-mipsel kfreebsd-powerpc kfreebsd-ppc64 kfreebsd-s390<br>
> kfreebsd-s390x kfreebsd-sh3 kfreebsd-sh3eb kfreebsd-sh4 kfreebsd-sh4eb<br>
> kfreebsd-sparc knetbsd-i386 knetbsd-ia64 knetbsd-alpha knetbsd-amd64<br>
> knetbsd-armeb knetbsd-arm knetbsd-hppa knetbsd-m32r knetbsd-m68k<br>
> knetbsd-mips knetbsd-mipsel knetbsd-powerpc knetbsd-ppc64 knetbsd-s390<br>
> knetbsd-s390x knetbsd-sh3 knetbsd-sh3eb knetbsd-sh4 knetbsd-sh4eb<br>
> knetbsd-sparc netbsd-i386 netbsd-ia64 netbsd-alpha netbsd-amd64 netbsd-armeb<br>
> netbsd-arm netbsd-hppa netbsd-m32r netbsd-m68k netbsd-mips netbsd-mipsel<br>
> netbsd-powerpc netbsd-ppc64 netbsd-s390 netbsd-s390x netbsd-sh3 netbsd-sh3eb<br>
> netbsd-sh4 netbsd-sh4eb netbsd-sparc openbsd-i386 openbsd-ia64 openbsd-alpha<br>
> openbsd-amd64 openbsd-armeb openbsd-arm openbsd-hppa openbsd-m32r<br>
> openbsd-m68k openbsd-mips openbsd-mipsel openbsd-powerpc openbsd-ppc64<br>
> openbsd-s390 openbsd-s390x openbsd-sh3 openbsd-sh3eb openbsd-sh4<br>
> openbsd-sh4eb openbsd-sparc hurd-i386 hurd-ia64 hurd-alpha hurd-amd64<br>
> hurd-armeb hurd-arm hurd-hppa hurd-m32r hurd-m68k hurd-mips hurd-mipsel<br>
> hurd-powerpc hurd-ppc64 hurd-s390 hurd-s390x hurd-sh3 hurd-sh3eb hurd-sh4<br>
> hurd-sh4eb hurd-sparc ;;<br>
><br>
><br>
><br>
> ;;<br>
><br>
> esac<br>
> #\(\(darwin\|freebsd\|netbsd\|kfreebsd\|knetbsd\|openbsd\|hurd\|gnu\|linux\)-\)\?<br>
> ### aqui seguro tenemos PACKNOEXT<br>
><br>
> ## si no tenemos PACKNOSYSTEM lo buscamos<br>
> if test x"$PACKSYSTEM" = x ; then<br>
> PACKNOSYSTEM=`echo $PACKNOEXT | sed<br>
> 's/[\._-]\(noarch\|src\|i486\|i586\|i686\|athlon\|ppc\|x86_64\|i386\|ia64\|alpha\|amd64\|armeb\|arm\|hppa\|m32r\|m68k\|mips\|mipsel\|powerpc\|ppc64\|s390\|s390x\|sh3\|sh3eb\|sh4\|sh4eb\|sparc\)$//'`<br>
><br>
> # if apears something identifing origin as ubuntu, ututo, pacman etc must be<br>
> extracted here<br>
><br>
><br>
><br>
> #echo MMMM $PACKNAME - $PACKNOSYSTEM -$PACKNOEXT<br>
> PACKSYSTEMPRE=${PACKNOEXT#${PACKNOSYSTEM}} # primero el nombre por si es<br>
> todo<br>
> PACKSYSTEMPRE3=${PACKSYSTEMPRE#-}<br>
> PACKSYSTEMPRE2=${PACKSYSTEMPRE3#_}<br>
> PACKSYSTEM=${PACKSYSTEMPRE2#.}<br>
><br>
><br>
> fi<br>
><br>
> if test x"$PACKNOSYSTEM" = x ; then<br>
> PACKNOSYSTEM=$PACKNOEXT<br>
> fi<br>
><br>
> # aqui seguro tenemos PACKNOSYSTEM<br>
> # si no tenemos PACKVERSION (PACKNONAME) lo buscamos<br>
><br>
> #echo MMMM $PACKNAME - $PACKNOSYSTEM -$PACKNOEXT<br>
><br>
><br>
> if test x"$PACKNAME" = x ; then<br>
> PACKVERSION=`echo $PACKNOSYSTEM | awk -F- '{print $NF}'`<br>
> if test x"$PACKVERSION" = x"$PACKNOSYSTEM" ; then<br>
> PACKVERSION=''<br>
> fi<br>
> PACKNAMEPRE=${PACKNOSYSTEM%${PACKVERSION}} # en dos pasos por si no<br>
> tiene -<br>
> PACKNAME=${PACKNAMEPRE%-}<br>
><br>
> #echo MMMM $PACKNAME<br>
> fi<br>
><br>
> ## si no conseguimos una PACKNAME diferente la buscamos de nuevo<br>
> if test x"$PACKNAME" = x"$PACKNOSYSTEM" ; then<br>
> PACKVERSION=`echo $PACKNOSYSTEM | awk -F- '{print $NF}'`<br>
> if test x"$PACKVERSION" = x"$PACKNOSYSTEM" ; then<br>
> PACKVERSION=''<br>
> fi<br>
> PACKNAMEPRE=${PACKNOSYSTEM%${PACKVERSION}} # en dos pasos por si no<br>
> tiene -<br>
> PACKNAME=${PACKNAMEPRE%_}<br>
> fi<br>
><br>
> #echo MMM $PACKSV<br>
> if test x"$PACKSV" = x -a x"$PACKVERSION" != x ; then<br>
><br>
> PACKRV=''<br>
> PACKSV=`echo $PACKVERSION| sed 's/_\(.*\)$//'`<br>
> if test x"$PACKVERSION" = x"$PACKSV" ; then<br>
> ### PACKSV='' # no better to have this as VERSION if not RV<br>
> :<br>
> else<br>
> PACKRVPRE=${PACKVERSION%$PACKSV}<br>
> PACKRV=${PACKRVPRE%$_}<br>
> fi<br>
><br>
> fi<br>
><br>
> if test x"$PACKRVORDER" = x ; then<br>
> PACKRVORDER=$PACKRV<br>
> fi<br>
><br>
><br>
> SLASH=_<br>
> #if test x"$PACKSV" = x ; then<br>
> # SLASH=''<br>
> #fi<br>
> SSLASH=_<br>
> #if test x"$PACKRVORDER" = x ; then<br>
> # SSLASH=''<br>
> #fi<br>
> PACKCOMPLETENORMALIZEDNAME="$PACKNAME$SLASH$PACKSV$SSLASH${PACKRVORDER}_${PACKSYSTEM}_$PACKEXT"<br>
><br>
> if test x"$COMPPACK" != x ; then<br>
> `echo $COMPPACK| sed 's/\(.*\)_\(.*\)_\(.*\)_\(.*\)_\(.*\)$/export<br>
> COMPPN\=\1 COMPPV\=\2 COMPPR\=\3 COMPPS\=\4 COMPPE\=\5'/`<br>
><br>
> #echo COMP $COMPPV - $COMPPR<br>
> #echo PACK $PACKSV - $PACKRVORDER<br>
><br>
> order ${PACKSV}_$PACKRVORDER ${COMPPV}_$COMPPR<br>
><br>
> fi<br>
><br>
><br>
> if test x"$oneline" = x0 ; then<br>
><br>
> echo "PACKSTRING='$PACKSTRING'"<br>
> echo "PACKDIR='$PACKDIR'"<br>
> echo "PACKNAME='$PACKNAME'"<br>
> echo "PACKVERSION='$PACKVERSION'" #version and release<br>
> # no: si no hay version , version debe ser 0<br>
> echo "PACKEXT='$PACKEXT'"<br>
> echo "PACKTYPE='$PACKTYPE'"<br>
> echo "PACKCOMPLETENAME='$PACKNOSYSTEM'" # without extension<br>
><br>
><br>
> echo "PACKSYSTEM='$PACKSYSTEM'"<br>
> echo "PACKSV='$PACKSV'"<br>
> echo "PACKRV='$PACKRV'"<br>
> echo "PACKERROR='$PACKERROR'"<br>
> echo "PACKRVORDER='$PACKRVORDER'"<br>
><br>
> echo "PACKCOMPLETENORMALIZEDNAME='$PACKCOMPLETENORMALIZEDNAME'" # without<br>
> extension<br>
> echo "ORDER='$ORDER'"<br>
> echo "COMPPN='$COMPPN'"<br>
> echo "COMPPV='$COMPPV'"<br>
> echo "COMPPR='$COMPPR'"<br>
> echo "COMPPS='$COMPPS'"<br>
> echo "COMPPE='$COMPPE'"<br>
> else<br>
><br>
> #echo "$PACKNAME:$PACKSV:$PACKRVORDER:$PACKTYPE"<br>
> if test x"$ORDER" != x ; then<br>
> echo "$PACKCOMPLETENORMALIZEDNAME $ORDER"<br>
> else<br>
> echo "$PACKCOMPLETENORMALIZEDNAME"<br>
> fi<br>
> fi<br>
><br>
><br>
><br>
><br>
><br>
> #No me fije en otros sistemas, pero los paquetes versionados al estilo<br>
> #gentoo tiene una dificultad cuando corresponden a releases,<br>
> #prereleases, betas, etc. Salvo por eso, se ordenarían fácilmente con<br>
> #ls -v , que compara versiones numéricas en los nombres de archivos.<br>
> #Pero cuando las versiones son cosas como paquete-0.3.7-alpha1 y<br>
> #paquete-0.3.7 allí falla.<br>
><br>
> #Lo que hice para resolver eso es previamente hacer una lista de los<br>
> #archivos a ordenar, en la lista reemplazar esas cosas por números,<br>
> #para que el ls los pueda ordenar, así:<br>
><br>
> #sed -r -e "s/(-[0-9.]+)_alpha/\1_000_/" \<br>
> # -e "s/(-[0-9.]+)_beta/\1_001_/" \<br>
> # -e "s/(-[0-9.]+)_pre/\1_002_/" \<br>
> # -e "s/(-[0-9.]+)_rc/\1_003_/" \<br>
> # -e "s/(-[0-9.]+)_p/\1_004_/")<br>
> #On Sunday 07 September 2008 08:28:11 Jim Meyering wrote:<br>
> #> IMHO, changing sort -V to produce more intuitively-correct results<br>
> #> is the way to go.<br>
> #><br>
> #> With ls -v, I'm willing to make the change as well, *assuming*<br>
> #> no one produces a counterargument.<br>
> #><br>
> #> The question is what ordering function to use.<br>
> #> The more generally-useful the better. i.e., I hope<br>
> #> it can be compatible with both the rpm and deb version sorters.<br>
> #I made an investigation of existing functions which sort version strings:<br>
> #strverscmp - from glibc (now with its equivalent in gnulib)<br>
> #rpmvercmp - from rpm<br>
> #ververcmp - from dpkg##<br>
><br>
> #The main problem of all these functions is dealing with suffixes. So I<br>
> #modified them to drop the suffixes. So it is 6 implementations together (3<br>
> #original + 3 modified).<br>
><br>
> #Then I ran a few series of tests with all implementations. I think the<br>
> #modified version of ververcmp (from dpkg) gives the best results - consider<br>
> #attached results of an example - results.tar.bz2#<br>
><br>
> #So I propose a new function filevercmp (attachment filevercmp.c) as the<br>
> #predicate function for new sort --version-sort.<br>
><br>
> #In the attachment is also the whole "testing framework" which I used to<br>
> #compare these functions - strverscmp.tar.bz2 - follow the steps in README<br>
> #inside archive. It is developed a bit quickly but I hope it could be<br>
> #useful :-)#<br>
><br>
><br>
> #Kamil<br>
> #<a href="http://www.opensubscriber.com/message/bug-coreutils@gnu.org/10201323.html" target="_blank">http://www.opensubscriber.com/message/bug-coreutils@gnu.org/10201323.html</a><br>
><br>
> #<a href="http://old.nabble.com/Possible-bug-in-sort--V-td26804985.html" target="_blank">http://old.nabble.com/Possible-bug-in-sort--V-td26804985.html</a><br>
><br>
> #> cat a | /build/toolchain/lin32/coreutils-8.2/bin/sort -V<br>
> #> kernel-2.6.18-164.2.1.el5.x86_64.rpm<br>
> #> kernel-2.6.18-164.6.1.el5.x86_64.rpm<br>
> #> kernel-2.6.18-164.el5.x86_64.rpm<br>
> #><br>
> #> The result should be<br>
> #> kernel-2.6.18-164.el5.x86_64.rpm<br>
> #> kernel-2.6.18-164.2.1.el5.x86_64.rpm<br>
> #> kernel-2.6.18-164.6.1.el5.x86_64.rpm<br>
> #><br>
> #> Is it a bug is sort -V?<br>
><br>
><br>
> #I agree the behavior is pretty awkward. Nevertheless the behavior<br>
> #is well documented:<br>
><br>
> #<a href="http://www.gnu.org/software/coreutils/manual/html_node/Details-about-version-sort.html" target="_blank">http://www.gnu.org/software/coreutils/manual/html_node/Details-about-version-sort.html</a><br>
><br>
> #The "bug" is triggered by the underscore in "x86_64". It's not treated as<br>
> file<br>
> #suffix in that case. However it works fairly well when you replace "x86_64"<br>
> by<br>
> #"i686".<br>
> #From 3069d50b766a2db8b86406904b7327e5de5e315f Mon Sep 17 00:00:00 2001<br>
> #From: =?utf-8?q?P=C3=A1draig=20Brady?= <P@...><br>
> #Date: Thu, 17 Dec 2009 10:48:54 +0000<br>
> #Subject: [PATCH] doc: enhance and reference info about version comparison<br>
><br>
> #* doc/coreutils.texi (sort invocation): Reference the additional<br>
> #info about filevercmp rather than the unused strverscmp.<br>
> #(Details about version sort): Add some examples that are not<br>
> #handled well by fileversmp.<br>
> #* src/ls.c: Change a comment referencing the now unused strverscmp.<br>
> #---<br>
> # doc/coreutils.texi | 33 ++++++++++++++++++++++++---------<br>
> # src/ls.c | 2 +-<br>
> # 2 files changed, 25 insertions(+), 10 deletions(-)<br>
><br>
> #-This functionality is implemented using gnulib's @code{filevercmp}<br>
> function.<br>
> #-One result of that implementation decision is that @samp{ls -v}<br>
> #-and @samp{sort -V} do not use the locale category, @env{LC_COLLATE},<br>
> #-which means non-numeric prefixes are sorted as if @env{LC_COLLATE} were<br>
> set<br>
> #-to @samp{C}.<br>
> #+This functionality is implemented using gnulib's @code{filevercmp}<br>
> function,<br>
> #+which has some caveats worth noting.<br>
> #+<br>
> #+@itemize @bullet<br>
> #+@item @env{LC_COLLATE} is ignored, which means @samp{ls -v} and @samp{sort<br>
> -V}<br>
> #+will sort non-numeric prefixes as if the @env{LC_COLLATE} locale category<br>
> #+was set to @samp{C}.<br>
> #+@item Some suffixes will not be matched by the regular<br>
> #+expression mentioned above. Consequently these examples may<br>
> #+not sort as you expect:<br>
> #+<br>
> #+@example<br>
> #+abc-1.2.3.4.7z<br>
> #+abc-1.2.3.7z<br>
> #+@end example<br>
> #+<br>
> #+@example<br>
> #+abc-1.2.3.4.x86_64.rpm<br>
> #+abc-1.2.3.x86_64.rpm<br>
> #+@end example<br>
> #+@end itemize<br>
><br>
> # @node General output formatting<br>
> # @subsection General output formatting<br>
> #diff --git a/src/ls.c b/src/ls.c<br>
> #index aeaa584..5c7f6aa 100644<br>
> #--- a/src/ls.c<br>
> #+++ b/src/ls.c<br>
> #@@ -3272,7 +3272,7 @@ DEFINE_SORT_FUNCTIONS (extension, cmp_extension)<br>
> # All the other sort options, in fact, need xstrcoll and strcmp variants,<br>
> # because they all use a string comparison (either as the primary or<br>
> secondary<br>
> # sort key), and xstrcoll has the ability to do a longjmp if strcoll<br>
> fails for<br>
> #- locale reasons. Last, strverscmp is ALWAYS available in coreutils,<br>
> #+ locale reasons. Last, filevercmp is ALWAYS available in coreutils,<br>
> # thanks to the gnulib library. */<br>
> # static inline int<br>
> # cmp_version (struct fileinfo const *a, struct fileinfo const *b)<br>
> #--<br>
> #1.6.2.5<br>
><br>
> #como compilar a partir de un ebuild, de un spec y de un control<br>
> #category no esta en ebuild, si en ubuild<br>
><br>
> #<a href="http://www.redhat.com/archives/rpm-list/2003-January/msg00006.html" target="_blank">http://www.redhat.com/archives/rpm-list/2003-January/msg00006.html</a><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> #RES1=`echo ".$CADENA1" |sed -e 's/[^0-9a-zA-Z]\+/./g'| sed -e<br>
> 's/\([a-zA-Z]\+\)/\1:./g' | sed -e 's/\([0-9]\+\)/\1;./g' | sed -e<br>
> 's/.\([0]\+\)/.\1:./g'`<br>
> #RES2=`echo ".$CADENA2" |sed -e 's/[^0-9a-zA-Z]\+/./g'| sed -e<br>
> 's/\([a-zA-Z]\+\)/\1:./g' | sed -e 's/\([0-9]\+\)/\1;./g' | sed -e<br>
> 's/.\([0]\+\)/.\1:./g'`<br>
> #echo $RES1<br>
> #echo $RES2<br>
><br>
> #FIN=0<br>
> ##IFS=.<br>
><br>
><br>
><br>
><br>
><br>
> #RES1=${RES1#.}<br>
> #RES2=${RES2#.}<br>
> #coma=`echo "$RES1" |sed -e 's/\..\+$//'`<br>
> #RES1=${RES1#$coma}<br>
><br>
> #comb=`echo "$RES2" |sed -e 's/\..\+$//'`<br>
> #RES2=${RES2#$comb}<br>
><br>
> #echo $coma $comb - $RES1 $RES2<br>
> #if test x"$coma" != x"$comb" ; then<br>
> # echo SON DISTINTOS $coma $comb<br>
> # FIN=1<br>
> #fi#<br>
><br>
> #if test x"$RES1" = x -o x"$RES2" = x ; then<br>
> # echo junto termino: $coma - $comb<br>
> # FIN=1<br>
> #fi<br>
> #bbb=s<br>
> #<br>
> # if test x"$item" != x; then<br>
> # echo $item<br>
><br>
> # fi<br>
><br>
> #done<br>
><br>
><br>
><br>
><br>
><br>
><br>
> El 1 de julio de 2010 17:26, Pablo Manuel Rizzo <<a href="mailto:info@pablorizzo.com" target="_blank">info@pablorizzo.com</a>><br>
> escribió:<br>
>><br>
>> 2010/7/1 Diego Saravia <<a href="mailto:dsa@unsa.edu.ar" target="_blank">dsa@unsa.edu.ar</a>><br>
>>><br>
>>><br>
>>> hay que integrarlo con el programa que deduce las versiones, para eso lo<br>
>>> escribi<br>
>>><br>
>>> no es mi idea generar un nuevo sort, con el tiempo el sort -V seguramente<br>
>>> andara<br>
>>><br>
>>> solamente poder saber si un paquete es posterior o anterior a lo que ya<br>
>>> esta instalado.<br>
>>><br>
>>> supongo que el programa que dado un paquete indica su nombre y versiones,<br>
>>> cuando le digas cual es la versin instalada de ese mismo paquete te dira<br>
>>> adicionalmente si es anterior o posterior<br>
>>><br>
>>> esa es mi idea,<br>
>>><br>
>>> se te ocurre algo mejor<br>
>>><br>
>><br>
>> Ah, está bien, había entendido otra cosa.<br>
>><br>
>> --<br>
>> Pablo Manuel Rizzo<br>
>> -------------------------------<br>
>> <a href="http://pablorizzo.com" target="_blank">http://pablorizzo.com</a><br>
>> -------------------------------<br>
>><br>
>><br>
>> ________________________________________________<br>
>><br>
>><br>
>> Solar-General es una lista abierta a toda la comunidad, sin ninguna<br>
>> moderación, por lo que se apela a la tolerancia y al respeto mutuo.<br>
>> Las opiniones expresadas son responsabilidad exclusiva de sus<br>
>> respectivos/as autores/as. La Asociación Solar no se hace responsable por<br>
>> los mensajes vertidos, ni representan necesariamente el punto de vista de la<br>
>> Asociación Solar.<br>
>><br>
>> <a href="mailto:Solar-general@lists.ourproject.org" target="_blank">Solar-general@lists.ourproject.org</a><br>
>> <a href="https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general" target="_blank">https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general</a><br>
><br>
><br>
><br>
> --<br>
> Diego Saravia<br>
> <a href="mailto:Diego.Saravia@gmail.com" target="_blank">Diego.Saravia@gmail.com</a><br>
> NO FUNCIONA-><a href="mailto:dsa@unsa.edu.ar" target="_blank">dsa@unsa.edu.ar</a><br>
><br>
> ________________________________________________<br>
><br>
><br>
> Solar-General es una lista abierta a toda la comunidad, sin ninguna<br>
> moderación, por lo que se apela a la tolerancia y al respeto mutuo.<br>
> Las opiniones expresadas son responsabilidad exclusiva de sus respectivos/as<br>
> autores/as. La Asociación Solar no se hace responsable por los mensajes<br>
> vertidos, ni representan necesariamente el punto de vista de la Asociación<br>
> Solar.<br>
><br>
> <a href="mailto:Solar-general@lists.ourproject.org" target="_blank">Solar-general@lists.ourproject.org</a><br>
> <a href="https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general" target="_blank">https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general</a><br>
><br>
<br>
<br>
<br>
--<br>
Pablo Manuel Rizzo<br>
-------------------------------<br>
<a href="http://pablorizzo.com" target="_blank">http://pablorizzo.com</a><br>
-------------------------------<br>
<br>
________________________________________________<br>
<br>
<br>
Solar-General es una lista abierta a toda la comunidad, sin ninguna moderación, por lo que se apela a la tolerancia y al respeto mutuo.<br>
Las opiniones expresadas son responsabilidad exclusiva de sus respectivos/as autores/as. La Asociación Solar no se hace responsable por los mensajes vertidos, ni representan necesariamente el punto de vista de la Asociación Solar.<br>
<br>
<a href="mailto:Solar-general@lists.ourproject.org" target="_blank">Solar-general@lists.ourproject.org</a><br>
<a href="https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general" target="_blank">https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general</a><br>
</div></div></blockquote></div></div></div><br><br clear="all"><br>-- <br><div><div></div><div class="h5">Diego Saravia<br><a href="mailto:Diego.Saravia@gmail.com" target="_blank">Diego.Saravia@gmail.com</a><br>NO FUNCIONA-><a href="mailto:dsa@unsa.edu.ar" target="_blank">dsa@unsa.edu.ar</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Diego Saravia<br><a href="mailto:Diego.Saravia@gmail.com">Diego.Saravia@gmail.com</a><br>NO FUNCIONA-><a href="mailto:dsa@unsa.edu.ar">dsa@unsa.edu.ar</a><br>