en relacion a lo que me sugirio pablo del ls -v, bueno resulta que el sort usa la misma funcion, pero me pasa lo siguiente echo -e "100\n12" | sort -V en un suse da 100 12 en ubuntu 12 100 (que es lo esperable) quien se anima a probarlo en su maquina? -- Diego Saravia [email protected] NO FUNCIONA->[email protected]
El 23/06/10, Diego Saravia <[email protected]> escribió:
en relacion a lo que me sugirio pablo del ls -v, bueno resulta que el sort usa la misma funcion, pero me pasa lo siguiente
echo -e "100\n12" | sort -V
en un suse da 100 12 en ubuntu 12 100 (que es lo esperable)
quien se anima a probarlo en su maquina?
$> echo -e "100\n12" | sort -V 12 100 $> sort --version sort (GNU coreutils) 8.5 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Mike Haertel and Paul Eggert. $> uname -a Linux aiferricorti 2.6.33-ARCH #1 SMP PREEMPT Thu May 13 12:06:25 CEST 2010 i686 Intel(R) Pentium(R) Dual CPU T2370 @ 1.73GHz GenuineIntel GNU/Linux -- Facundo Andrés Bianco (Vando.) GNUPG ID: 0x89C1B42F XMPP: [email protected] omb: identi.ca/vando SoftwareLibre.org.ar BuenosAiresLibre.org.ar
en suse la version es 7.1 en ubuntu, 7.4 cuando llegue a casa probare en ututo redhat y otras no se si sera un problema de la version o como esta compilado 2010/6/23 Facundo Andrés Bianco <[email protected]>:
El 23/06/10, Diego Saravia <[email protected]> escribió:
en relacion a lo que me sugirio pablo del ls -v, bueno resulta que el sort usa la misma funcion, pero me pasa lo siguiente
echo -e "100\n12" | sort -V
en un suse da 100 12 en ubuntu 12 100 (que es lo esperable)
quien se anima a probarlo en su maquina?
$> echo -e "100\n12" | sort -V 12 100 $> sort --version sort (GNU coreutils) 8.5 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
Written by Mike Haertel and Paul Eggert. $> uname -a Linux aiferricorti 2.6.33-ARCH #1 SMP PREEMPT Thu May 13 12:06:25 CEST 2010 i686 Intel(R) Pentium(R) Dual CPU T2370 @ 1.73GHz GenuineIntel GNU/Linux
-- Facundo Andrés Bianco (Vando.) GNUPG ID: 0x89C1B42F XMPP: [email protected] omb: identi.ca/vando SoftwareLibre.org.ar BuenosAiresLibre.org.ar
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
en debian usan la version 6.1 y ni siquiera tiene esa opcion El día 23 de junio de 2010 12:50, Diego Saravia <[email protected]> escribió:
en suse la version es 7.1 en ubuntu, 7.4
cuando llegue a casa probare en ututo redhat y otras
no se si sera un problema de la version o como esta compilado
2010/6/23 Facundo Andrés Bianco <[email protected]>:
El 23/06/10, Diego Saravia <[email protected]> escribió:
en relacion a lo que me sugirio pablo del ls -v, bueno resulta que el sort usa la misma funcion, pero me pasa lo siguiente
echo -e "100\n12" | sort -V
en un suse da 100 12 en ubuntu 12 100 (que es lo esperable)
quien se anima a probarlo en su maquina?
$> echo -e "100\n12" | sort -V 12 100 $> sort --version sort (GNU coreutils) 8.5 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
Written by Mike Haertel and Paul Eggert. $> uname -a Linux aiferricorti 2.6.33-ARCH #1 SMP PREEMPT Thu May 13 12:06:25 CEST 2010 i686 Intel(R) Pentium(R) Dual CPU T2370 @ 1.73GHz GenuineIntel GNU/Linux
-- Facundo Andrés Bianco (Vando.) GNUPG ID: 0x89C1B42F XMPP: [email protected] omb: identi.ca/vando SoftwareLibre.org.ar BuenosAiresLibre.org.ar
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
Facundo Andrés Bianco escribió:
El 23/06/10, Diego Saravia <[email protected]> escribió:
en relacion a lo que me sugirio pablo del ls -v, bueno resulta que el sort usa la misma funcion, pero me pasa lo siguiente
echo -e "100\n12" | sort -V
en un suse da 100 12 en ubuntu 12 100 (que es lo esperable)
quien se anima a probarlo en su maquina?
A ami me da: 100 12 happy hacking!! -- Daniel Olivera (mate.cosido, aun fuera de la ley) Director Proyecto UTUTO (Argentina) Miembro Free Software Foundation (6839)(Estados Unidos) "Soy y seré comunista hasta el último dia de mi vida" "La vida no vale nada si no es para perecer porque otros puedan tener, lo que uno disfruta ya" Pablo Milanes. "Mientras alguien proponga muerte sobre esta tierra... yo pisare estos campos sobreviviendo..." "Ya no quiero ser solo un sobreviviente... quiero elegir el dia para mi muerte..." "No quiero ver un dia manifestando por la paz en el mundo a los animales... ellos manifestandose por la vida y nosotros apenas sobreviviendo... sobreviviendo" Victor Heredia "...la culpa ajena es barata, regalarla no nos cuesta..." "...al asesinato en masa, los hombres lo llaman guerra..." Netiquette? (Como convivir en la red) http://www.gaiasur.com.ar/infoteca/varios/netiquette.html#email Correo Electrónico : [email protected] - [email protected] Huella gpg: 3516 D65C 3E39 DE62 107B 34C7 7795 9313 A509 B533 Argentina - Teléfono: +54 11 5353-9494 Extension: 2943434 España - Teléfono: +34 957780957 (Ext: 2) Fax: +34 957 780645 Sistemas VoIP : ututo01 (Ekiga) SIP: [email protected] Mensajeros : Jabber: [email protected] ICQ: 836843 Gtalk: ututo01
que version del sort usas? El día 23 de junio de 2010 13:01, Daniel Olivera <[email protected]> escribió:
Facundo Andrés Bianco escribió:
El 23/06/10, Diego Saravia <[email protected]> escribió:
en relacion a lo que me sugirio pablo del ls -v, bueno resulta que el sort usa la misma funcion, pero me pasa lo siguiente
echo -e "100\n12" | sort -V
en un suse da 100 12 en ubuntu 12 100 (que es lo esperable)
quien se anima a probarlo en su maquina?
A ami me da:
100 12
happy hacking!! -- Daniel Olivera (mate.cosido, aun fuera de la ley) Director Proyecto UTUTO (Argentina) Miembro Free Software Foundation (6839)(Estados Unidos)
"Soy y seré comunista hasta el último dia de mi vida"
"La vida no vale nada si no es para perecer porque otros puedan tener, lo que uno disfruta ya" Pablo Milanes.
"Mientras alguien proponga muerte sobre esta tierra... yo pisare estos campos sobreviviendo..." "Ya no quiero ser solo un sobreviviente... quiero elegir el dia para mi muerte..." "No quiero ver un dia manifestando por la paz en el mundo a los animales... ellos manifestandose por la vida y nosotros apenas sobreviviendo... sobreviviendo" Victor Heredia
"...la culpa ajena es barata, regalarla no nos cuesta..." "...al asesinato en masa, los hombres lo llaman guerra..."
Netiquette? (Como convivir en la red) http://www.gaiasur.com.ar/infoteca/varios/netiquette.html#email
Correo Electrónico : [email protected] - [email protected] Huella gpg: 3516 D65C 3E39 DE62 107B 34C7 7795 9313 A509 B533
Argentina - Teléfono: +54 11 5353-9494 Extension: 2943434 España - Teléfono: +34 957780957 (Ext: 2) Fax: +34 957 780645 Sistemas VoIP : ututo01 (Ekiga) SIP: [email protected] Mensajeros : Jabber: [email protected] ICQ: 836843 Gtalk: ututo01
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
Diego Saravia escribió:
que version del sort usas?
El paquete que contien sort es Coreutils. La version que tengo instalada es la 8.5 happy hacking!! -- Daniel Olivera (mate.cosido, aun fuera de la ley) Director Proyecto UTUTO (Argentina) Miembro Free Software Foundation (6839)(Estados Unidos) "Soy y seré comunista hasta el último dia de mi vida" "La vida no vale nada si no es para perecer porque otros puedan tener, lo que uno disfruta ya" Pablo Milanes. "Mientras alguien proponga muerte sobre esta tierra... yo pisare estos campos sobreviviendo..." "Ya no quiero ser solo un sobreviviente... quiero elegir el dia para mi muerte..." "No quiero ver un dia manifestando por la paz en el mundo a los animales... ellos manifestandose por la vida y nosotros apenas sobreviviendo... sobreviviendo" Victor Heredia "...la culpa ajena es barata, regalarla no nos cuesta..." "...al asesinato en masa, los hombres lo llaman guerra..." Netiquette? (Como convivir en la red) http://www.gaiasur.com.ar/infoteca/varios/netiquette.html#email Correo Electrónico : [email protected] - [email protected] Huella gpg: 3516 D65C 3E39 DE62 107B 34C7 7795 9313 A509 B533 Argentina - Teléfono: +54 11 5353-9494 Extension: 2943434 España - Teléfono: +34 957780957 (Ext: 2) Fax: +34 957 780645 Sistemas VoIP : ututo01 (Ekiga) SIP: [email protected] Mensajeros : Jabber: [email protected] ICQ: 836843 Gtalk: ututo01
2010/6/23 Daniel Olivera <[email protected]>:
Facundo Andrés Bianco escribió:
El 23/06/10, Diego Saravia <[email protected]> escribió:
en relacion a lo que me sugirio pablo del ls -v, bueno resulta que el sort usa la misma funcion, pero me pasa lo siguiente
echo -e "100\n12" | sort -V
en un suse da 100 12 en ubuntu 12 100 (que es lo esperable)
quien se anima a probarlo en su maquina?
A ami me da:
100 12
A mí en ututo me da: $ echo -e "100\n12" | sort -V 12 100 Con estos locales LANG=es_ES.UTF-8 LC_CTYPE="es_ES.UTF-8" LC_NUMERIC="es_ES.UTF-8" LC_TIME="es_ES.UTF-8" LC_COLLATE="es_ES.UTF-8" LC_MONETARY="es_ES.UTF-8" LC_MESSAGES="es_ES.UTF-8" LC_PAPER="es_ES.UTF-8" LC_NAME="es_ES.UTF-8" LC_ADDRESS="es_ES.UTF-8" LC_TELEPHONE="es_ES.UTF-8" LC_MEASUREMENT="es_ES.UTF-8" LC_IDENTIFICATION="es_ES.UTF-8" LC_ALL=es_ES.UTF-8 -- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
Pablo Manuel Rizzo escribió: ..
A mí en ututo me da:
$ echo -e "100\n12" | sort -V 12 100
Pues sera algo de la version. Porque a mi en UTUTO XS 2010 Revision 18 me da: 100 12 happy hacking!! -- Daniel Olivera (mate.cosido, aun fuera de la ley) Director Proyecto UTUTO (Argentina) Miembro Free Software Foundation (6839)(Estados Unidos) "Soy y seré comunista hasta el último dia de mi vida" "La vida no vale nada si no es para perecer porque otros puedan tener, lo que uno disfruta ya" Pablo Milanes. "Mientras alguien proponga muerte sobre esta tierra... yo pisare estos campos sobreviviendo..." "Ya no quiero ser solo un sobreviviente... quiero elegir el dia para mi muerte..." "No quiero ver un dia manifestando por la paz en el mundo a los animales... ellos manifestandose por la vida y nosotros apenas sobreviviendo... sobreviviendo" Victor Heredia "...la culpa ajena es barata, regalarla no nos cuesta..." "...al asesinato en masa, los hombres lo llaman guerra..." Netiquette? (Como convivir en la red) http://www.gaiasur.com.ar/infoteca/varios/netiquette.html#email Correo Electrónico : [email protected] - [email protected] Huella gpg: 3516 D65C 3E39 DE62 107B 34C7 7795 9313 A509 B533 Argentina - Teléfono: +54 11 5353-9494 Extension: 2943434 España - Teléfono: +34 957780957 (Ext: 2) Fax: +34 957 780645 Sistemas VoIP : ututo01 (Ekiga) SIP: [email protected] Mensajeros : Jabber: [email protected] ICQ: 836843 Gtalk: ututo01
cosa e mandinga! segun la documentacion, el collate y otros no afectan -V El día 23 de junio de 2010 13:40, Daniel Olivera <[email protected]> escribió:
Pablo Manuel Rizzo escribió: ..
A mí en ututo me da:
$ echo -e "100\n12" | sort -V 12 100
Pues sera algo de la version. Porque a mi en UTUTO XS 2010 Revision 18 me da:
100 12
happy hacking!! -- Daniel Olivera (mate.cosido, aun fuera de la ley) Director Proyecto UTUTO (Argentina) Miembro Free Software Foundation (6839)(Estados Unidos)
"Soy y seré comunista hasta el último dia de mi vida"
"La vida no vale nada si no es para perecer porque otros puedan tener, lo que uno disfruta ya" Pablo Milanes.
"Mientras alguien proponga muerte sobre esta tierra... yo pisare estos campos sobreviviendo..." "Ya no quiero ser solo un sobreviviente... quiero elegir el dia para mi muerte..." "No quiero ver un dia manifestando por la paz en el mundo a los animales... ellos manifestandose por la vida y nosotros apenas sobreviviendo... sobreviviendo" Victor Heredia
"...la culpa ajena es barata, regalarla no nos cuesta..." "...al asesinato en masa, los hombres lo llaman guerra..."
Netiquette? (Como convivir en la red) http://www.gaiasur.com.ar/infoteca/varios/netiquette.html#email
Correo Electrónico : [email protected] - [email protected] Huella gpg: 3516 D65C 3E39 DE62 107B 34C7 7795 9313 A509 B533
Argentina - Teléfono: +54 11 5353-9494 Extension: 2943434 España - Teléfono: +34 957780957 (Ext: 2) Fax: +34 957 780645 Sistemas VoIP : ututo01 (Ekiga) SIP: [email protected] Mensajeros : Jabber: [email protected] ICQ: 836843 Gtalk: ututo01
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
pablo, estas usando los coreutils compilados por daniel? El día 23 de junio de 2010 13:47, Diego Saravia <[email protected]> escribió:
cosa e mandinga!
segun la documentacion, el collate y otros no afectan -V
El día 23 de junio de 2010 13:40, Daniel Olivera <[email protected]> escribió:
Pablo Manuel Rizzo escribió: ..
A mí en ututo me da:
$ echo -e "100\n12" | sort -V 12 100
Pues sera algo de la version. Porque a mi en UTUTO XS 2010 Revision 18 me da:
100 12
happy hacking!! -- Daniel Olivera (mate.cosido, aun fuera de la ley) Director Proyecto UTUTO (Argentina) Miembro Free Software Foundation (6839)(Estados Unidos)
"Soy y seré comunista hasta el último dia de mi vida"
"La vida no vale nada si no es para perecer porque otros puedan tener, lo que uno disfruta ya" Pablo Milanes.
"Mientras alguien proponga muerte sobre esta tierra... yo pisare estos campos sobreviviendo..." "Ya no quiero ser solo un sobreviviente... quiero elegir el dia para mi muerte..." "No quiero ver un dia manifestando por la paz en el mundo a los animales... ellos manifestandose por la vida y nosotros apenas sobreviviendo... sobreviviendo" Victor Heredia
"...la culpa ajena es barata, regalarla no nos cuesta..." "...al asesinato en masa, los hombres lo llaman guerra..."
Netiquette? (Como convivir en la red) http://www.gaiasur.com.ar/infoteca/varios/netiquette.html#email
Correo Electrónico : [email protected] - [email protected] Huella gpg: 3516 D65C 3E39 DE62 107B 34C7 7795 9313 A509 B533
Argentina - Teléfono: +54 11 5353-9494 Extension: 2943434 España - Teléfono: +34 957780957 (Ext: 2) Fax: +34 957 780645 Sistemas VoIP : ututo01 (Ekiga) SIP: [email protected] Mensajeros : Jabber: [email protected] ICQ: 836843 Gtalk: ututo01
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
2010/6/23 Diego Saravia <[email protected]>:
pablo, estas usando los coreutils compilados por daniel?
Si, los mismos, última versión del repositorio i686 de ututo
El día 23 de junio de 2010 13:47, Diego Saravia <[email protected]> escribió:
cosa e mandinga!
segun la documentacion, el collate y otros no afectan -V
El día 23 de junio de 2010 13:40, Daniel Olivera <[email protected]> escribió:
Pablo Manuel Rizzo escribió: ..
A mí en ututo me da:
$ echo -e "100\n12" | sort -V 12 100
Pues sera algo de la version. Porque a mi en UTUTO XS 2010 Revision 18 me da:
100 12
happy hacking!! -- Daniel Olivera (mate.cosido, aun fuera de la ley) Director Proyecto UTUTO (Argentina) Miembro Free Software Foundation (6839)(Estados Unidos)
"Soy y seré comunista hasta el último dia de mi vida"
"La vida no vale nada si no es para perecer porque otros puedan tener, lo que uno disfruta ya" Pablo Milanes.
"Mientras alguien proponga muerte sobre esta tierra... yo pisare estos campos sobreviviendo..." "Ya no quiero ser solo un sobreviviente... quiero elegir el dia para mi muerte..." "No quiero ver un dia manifestando por la paz en el mundo a los animales... ellos manifestandose por la vida y nosotros apenas sobreviviendo... sobreviviendo" Victor Heredia
"...la culpa ajena es barata, regalarla no nos cuesta..." "...al asesinato en masa, los hombres lo llaman guerra..."
Netiquette? (Como convivir en la red) http://www.gaiasur.com.ar/infoteca/varios/netiquette.html#email
Correo Electrónico : [email protected] - [email protected] Huella gpg: 3516 D65C 3E39 DE62 107B 34C7 7795 9313 A509 B533
Argentina - Teléfono: +54 11 5353-9494 Extension: 2943434 España - Teléfono: +34 957780957 (Ext: 2) Fax: +34 957 780645 Sistemas VoIP : ututo01 (Ekiga) SIP: [email protected] Mensajeros : Jabber: [email protected] ICQ: 836843 Gtalk: ututo01
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
2010/6/23 Daniel Olivera <[email protected]>:
Pablo Manuel Rizzo escribió: ..
A mí en ututo me da:
$ echo -e "100\n12" | sort -V 12 100
Pues sera algo de la version. Porque a mi en UTUTO XS 2010 Revision 18 me da:
100 12
Yo tengo esta versión instalada desde el repositorio i686: $ sort --version sort (GNU coreutils) 8.5 Packaged by Gentoo (8.5 (p1)) Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Escrito por Mike Haertel y Paul Eggert. -- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
https://bugzilla.novell.com/show_bug.cgi?id=616745#c1 ------------------------------ The right test would be 'echo -e "abc100\nabc25" | sort .V', but it is indeed not working because the i18n patch (improved handling of multibyte encoding) wasn't updated to handle the new option. A fix was submitted for 11.2 and 11.3. ------------------------------- esta es la respuesta de open suse al error que reporte no se porque mi test no serviria, pero bueno, no importa, parece que lo arreglaron, ni porque pusieron .V y no -V qrque mi test no serviria, pero bueno, no importa, parece que lo arreglaron lo interesante es que el parche esta en i18n El día 23 de junio de 2010 13:48, Pablo Manuel Rizzo <[email protected]> escribió:
2010/6/23 Daniel Olivera <[email protected]>:
Pablo Manuel Rizzo escribió: ..
A mí en ututo me da:
$ echo -e "100\n12" | sort -V 12 100
Pues sera algo de la version. Porque a mi en UTUTO XS 2010 Revision 18 me da:
100 12
Yo tengo esta versión instalada desde el repositorio i686:
$ sort --version sort (GNU coreutils) 8.5 Packaged by Gentoo (8.5 (p1)) Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
Escrito por Mike Haertel y Paul Eggert.
-- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
Bueno, y finalmente tenes el método para ordenar correctamente todos los casos? Lo describirías brevemente? Hasta hace un rato estuve con el uget1 y me acordaba de este asunto... 2010/6/29 Diego Saravia <[email protected]>
https://bugzilla.novell.com/show_bug.cgi?id=616745#c1 ------------------------------ The right test would be 'echo -e "abc100\nabc25" | sort .V', but it is indeed not working because the i18n patch (improved handling of multibyte encoding) wasn't updated to handle the new option. A fix was submitted for 11.2 and 11.3. -------------------------------
esta es la respuesta de open suse al error que reporte
no se porque mi test no serviria, pero bueno, no importa, parece que lo arreglaron, ni porque pusieron .V y no -V qrque mi test no serviria, pero bueno, no importa, parece que lo arreglaron
lo interesante es que el parche esta en i18n
El día 23 de junio de 2010 13:48, Pablo Manuel Rizzo <[email protected]> escribió:
2010/6/23 Daniel Olivera <[email protected]>:
Pablo Manuel Rizzo escribió: ..
A mí en ututo me da:
$ echo -e "100\n12" | sort -V 12 100
Pues sera algo de la version. Porque a mi en UTUTO XS 2010 Revision 18 me da:
100 12
Yo tengo esta versión instalada desde el repositorio i686:
$ sort --version sort (GNU coreutils) 8.5 Packaged by Gentoo (8.5 (p1)) Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later < http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
Escrito por Mike Haertel y Paul Eggert.
-- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
El día 29 de junio de 2010 15:39, Pablo Manuel Rizzo <[email protected]> escribió:
Bueno, y finalmente tenes el método para ordenar correctamente todos los casos? Lo describirías brevemente? Hasta hace un rato estuve con el uget1 y me acordaba de este asunto...
estoy haciendo un algoritmo propio, es poco confiable el sort -V apenas lo tenga probado lo comento
2010/6/29 Diego Saravia <[email protected]>
https://bugzilla.novell.com/show_bug.cgi?id=616745#c1 ------------------------------ The right test would be 'echo -e "abc100\nabc25" | sort .V', but it is indeed not working because the i18n patch (improved handling of multibyte encoding) wasn't updated to handle the new option. A fix was submitted for 11.2 and 11.3. -------------------------------
esta es la respuesta de open suse al error que reporte
no se porque mi test no serviria, pero bueno, no importa, parece que lo arreglaron, ni porque pusieron .V y no -V qrque mi test no serviria, pero bueno, no importa, parece que lo arreglaron
lo interesante es que el parche esta en i18n
El día 23 de junio de 2010 13:48, Pablo Manuel Rizzo <[email protected]> escribió:
2010/6/23 Daniel Olivera <[email protected]>:
Pablo Manuel Rizzo escribió: ..
A mí en ututo me da:
$ echo -e "100\n12" | sort -V 12 100
Pues sera algo de la version. Porque a mi en UTUTO XS 2010 Revision 18 me da:
100 12
Yo tengo esta versión instalada desde el repositorio i686:
$ sort --version sort (GNU coreutils) 8.5 Packaged by Gentoo (8.5 (p1)) Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
Escrito por Mike Haertel y Paul Eggert.
-- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
Pablo aparentementeesto hace lo que debiera hacer el sort -V, fijate igual hay que intgegrarlo con el separador de versione en el caso del gentoo, para corregir lo del alpha|beta etc eso ya te lo pase, ya lo integrare apenas tenga unos minutois si queres anda mirando esto CADENA1=apo1002300.001.45g.ui67 CADENA2=apo1002300.001.45g.ui68b anachar(){ local CADENA=$1 local char=$2 estext=`expr "$char" : '\([a-zA-Z0\.]\)'` if test x"$estext" != x ; then #echo CHAR $char ES=CHAR saca=$char nume= # no es necesario else nume=`expr "$CADENA" : '\([0-9]\+\)'` if test x"$nume" = x ; then saca=$char # lo pongo como char #ES=OTHER ES=CHAR #echo CHAR OTHER $char # es al vicio, solo preguntar por numeros #echo SEPARA $char #char='' else #echo NUM $nume ES=NUMB saca=$nume fi fi } FIN=0 echo 1: $CADENA1 - 2: $CADENA2 while test x"$FIN" = x0 ; do char1=${CADENA1:0:1} char2=${CADENA2:0:1} #echo CHAR1: $char1 - CHAR2: $char2 if test x"$char1" = x -a x"$char2" = x ; then echo SON IGUALES exit elif test x"$char1" = x -a x"$char2" != x ; then echo CADENA1 PRIMERO T exit elif test x"$char1" != x -a x"$char2" = x ; then echo CADENA2 PRIMERO T exit fi anachar $CADENA1 $char1 CADENA1=${CADENA1#$saca} ES1=$ES nume1=$nume anachar $CADENA2 $char2 CADENA2=${CADENA2#$saca} ES2=$ES nume2=$nume RES="$ES1 - $ES2 - $char1 - $char2 - $nume1 - $nume2" if test x"$ES1" = xNUMB -a x"$ES2" = xNUMB ; then if test x"$nume1" = x"$nume2" ; then echo continue IGUALES NUMB: $RES continue elif test $nume1 -gt $nume2; then echo "CADENA2 PRI 2 : $RES" else echo "CADENA1 PRI 2 : $RES" fi exit elif test x"$ES1" = xCHAR -a x"$ES2" = xCHAR ; then if test x"$char1" = x"$char2" ; then echo continue IGUALES CHAR: $RES continue elif test $char1 > $char2; then echo "CADENA1 PRI 3 : $RES" else echo "CADENA2 PRI 3 : $RES" fi exit elif test x"$ES1" = xCHAR -a x"$ES2" = xNUMB ; then if test x"$char1" = x0 ; then echo "CADENA1 PRI 4 0 : $RES" exit else echo "CADENA2 PRI 4 : $RES" fi exit elif test x"$ES1" = xNUMB -a x"$ES2" = xCHAR ; then if test x"$char2" = x0 ; then echo "CADENA2 PRI 4 0 : $RES" else echo "CADENA1 PRI 4 : $RES" fi exit fi #echo lll $char - $nume - $EST - $estext - $CADENA1 # saca1=$char1 # done El 29 de junio de 2010 16:12, Diego Saravia <[email protected]> escribió:
El día 29 de junio de 2010 15:39, Pablo Manuel Rizzo <[email protected]> escribió:
Bueno, y finalmente tenes el método para ordenar correctamente todos los casos? Lo describirías brevemente? Hasta hace un rato estuve con el uget1 y me acordaba de este asunto...
estoy haciendo un algoritmo propio, es poco confiable el sort -V
apenas lo tenga probado lo comento
2010/6/29 Diego Saravia <[email protected]>
https://bugzilla.novell.com/show_bug.cgi?id=616745#c1 ------------------------------ The right test would be 'echo -e "abc100\nabc25" | sort .V', but it is indeed not working because the i18n patch (improved handling of multibyte encoding) wasn't updated to handle the new option. A fix was submitted for 11.2
and
11.3. -------------------------------
esta es la respuesta de open suse al error que reporte
no se porque mi test no serviria, pero bueno, no importa, parece que lo arreglaron, ni porque pusieron .V y no -V qrque mi test no serviria, pero bueno, no importa, parece que lo arreglaron
lo interesante es que el parche esta en i18n
El día 23 de junio de 2010 13:48, Pablo Manuel Rizzo <[email protected]> escribió:
2010/6/23 Daniel Olivera <[email protected]>:
Pablo Manuel Rizzo escribió: ..
A mí en ututo me da:
$ echo -e "100\n12" | sort -V 12 100
Pues sera algo de la version. Porque a mi en UTUTO XS 2010 Revision 18 me da:
100 12
Yo tengo esta versión instalada desde el repositorio i686:
$ sort --version sort (GNU coreutils) 8.5 Packaged by Gentoo (8.5 (p1)) Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
Escrito por Mike Haertel y Paul Eggert.
-- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
2010/7/1 Diego Saravia <[email protected]>
Pablo aparentementeesto hace lo que debiera hacer el sort -V, fijate
igual hay que intgegrarlo con el separador de versione en el caso del gentoo, para corregir lo del alpha|beta etc
eso ya te lo pase, ya lo integrare apenas tenga unos minutois
Habrá que integrarlo? No serían dos cosas distintas ordenar versiones y adaptar la notación 'extraña' de gentoo a una notación deversionado numérico estandar?
si queres anda mirando esto
CADENA1=apo1002300.001.45g.ui67 CADENA2=apo1002300.001.45g.ui68b
anachar(){ local CADENA=$1 local char=$2
estext=`expr "$char" : '\([a-zA-Z0\.]\)'` if test x"$estext" != x ; then #echo CHAR $char ES=CHAR saca=$char nume= # no es necesario else nume=`expr "$CADENA" : '\([0-9]\+\)'` if test x"$nume" = x ; then saca=$char # lo pongo como char #ES=OTHER ES=CHAR #echo CHAR OTHER $char # es al vicio, solo preguntar por numeros #echo SEPARA $char #char='' else #echo NUM $nume ES=NUMB saca=$nume fi fi
}
FIN=0 echo 1: $CADENA1 - 2: $CADENA2 while test x"$FIN" = x0 ; do
char1=${CADENA1:0:1} char2=${CADENA2:0:1} #echo CHAR1: $char1 - CHAR2: $char2 if test x"$char1" = x -a x"$char2" = x ; then echo SON IGUALES exit elif test x"$char1" = x -a x"$char2" != x ; then echo CADENA1 PRIMERO T exit elif test x"$char1" != x -a x"$char2" = x ; then echo CADENA2 PRIMERO T exit fi
anachar $CADENA1 $char1 CADENA1=${CADENA1#$saca} ES1=$ES nume1=$nume
anachar $CADENA2 $char2 CADENA2=${CADENA2#$saca} ES2=$ES nume2=$nume RES="$ES1 - $ES2 - $char1 - $char2 - $nume1 - $nume2"
if test x"$ES1" = xNUMB -a x"$ES2" = xNUMB ; then if test x"$nume1" = x"$nume2" ; then echo continue IGUALES NUMB: $RES continue elif test $nume1 -gt $nume2; then echo "CADENA2 PRI 2 : $RES" else echo "CADENA1 PRI 2 : $RES" fi exit
elif test x"$ES1" = xCHAR -a x"$ES2" = xCHAR ; then if test x"$char1" = x"$char2" ; then echo continue IGUALES CHAR: $RES continue elif test $char1 > $char2; then echo "CADENA1 PRI 3 : $RES" else echo "CADENA2 PRI 3 : $RES" fi exit
elif test x"$ES1" = xCHAR -a x"$ES2" = xNUMB ; then if test x"$char1" = x0 ; then echo "CADENA1 PRI 4 0 : $RES" exit else echo "CADENA2 PRI 4 : $RES" fi exit elif test x"$ES1" = xNUMB -a x"$ES2" = xCHAR ; then if test x"$char2" = x0 ; then echo "CADENA2 PRI 4 0 : $RES" else echo "CADENA1 PRI 4 : $RES" fi exit fi
#echo lll $char - $nume - $EST - $estext - $CADENA1
# saca1=$char1
#
done
El 29 de junio de 2010 16:12, Diego Saravia <[email protected]> escribió:
El día 29 de junio de 2010 15:39, Pablo Manuel Rizzo
<[email protected]> escribió:
Bueno, y finalmente tenes el método para ordenar correctamente todos los casos? Lo describirías brevemente? Hasta hace un rato estuve con el uget1 y me acordaba de este asunto...
estoy haciendo un algoritmo propio, es poco confiable el sort -V
apenas lo tenga probado lo comento
2010/6/29 Diego Saravia <[email protected]>
https://bugzilla.novell.com/show_bug.cgi?id=616745#c1 ------------------------------ The right test would be 'echo -e "abc100\nabc25" | sort .V', but it is indeed not working because the i18n patch (improved handling of multibyte encoding) wasn't updated to handle the new option. A fix was submitted for 11.2
and
11.3. -------------------------------
esta es la respuesta de open suse al error que reporte
no se porque mi test no serviria, pero bueno, no importa, parece que lo arreglaron, ni porque pusieron .V y no -V qrque mi test no serviria, pero bueno, no importa, parece que lo arreglaron
lo interesante es que el parche esta en i18n
El día 23 de junio de 2010 13:48, Pablo Manuel Rizzo <[email protected]> escribió:
2010/6/23 Daniel Olivera <[email protected]>:
Pablo Manuel Rizzo escribió: ..
> > A mí en ututo me da: > > $ echo -e "100\n12" | sort -V > 12 > 100 > Pues sera algo de la version. Porque a mi en UTUTO XS 2010 Revision 18 me da:
100 12
Yo tengo esta versión instalada desde el repositorio i686:
$ sort --version sort (GNU coreutils) 8.5 Packaged by Gentoo (8.5 (p1)) Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
Escrito por Mike Haertel y Paul Eggert.
-- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
El 1 de julio de 2010 13:16, Pablo Manuel Rizzo <[email protected]>escribió:
2010/7/1 Diego Saravia <[email protected]>
Pablo aparentementeesto hace lo que debiera hacer el sort -V, fijate
igual hay que intgegrarlo con el separador de versione en el caso del gentoo, para corregir lo del alpha|beta etc
eso ya te lo pase, ya lo integrare apenas tenga unos minutois
Habrá que integrarlo? No serían dos cosas distintas ordenar versiones y adaptar la notación 'extraña' de gentoo a una notación deversionado numérico estandar?
hay que integrarlo con el programa que deduce las versiones, para eso lo escribi no es mi idea generar un nuevo sort, con el tiempo el sort -V seguramente andara solamente poder saber si un paquete es posterior o anterior a lo que ya esta instalado. supongo que el programa que dado un paquete indica su nombre y versiones, cuando le digas cual es la versin instalada de ese mismo paquete te dira adicionalmente si es anterior o posterior esa es mi idea, se te ocurre algo mejor -- Diego Saravia [email protected] NO FUNCIONA->[email protected]
2010/7/1 Diego Saravia <[email protected]>
hay que integrarlo con el programa que deduce las versiones, para eso lo escribi
no es mi idea generar un nuevo sort, con el tiempo el sort -V seguramente andara
solamente poder saber si un paquete es posterior o anterior a lo que ya esta instalado.
supongo que el programa que dado un paquete indica su nombre y versiones, cuando le digas cual es la versin instalada de ese mismo paquete te dira adicionalmente si es anterior o posterior
esa es mi idea,
se te ocurre algo mejor
Ah, está bien, había entendido otra cosa. -- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
dado que nos fuimos del mundial, te mando pablo un par de programas el primero es uno en perl que llama al segundo para ordenar un archivo que contiene una lista de archivos de ututo es un ls *.tbz2 efectuado en un /ututo/i686, o sea un repositorio de paquetes al segundo si le das un argumento lo "canoniza" o sea lo transforma en un nombre facilmente separable en sus variables y ordenable si le das dos argumentos, un paquete y un canonico los ordena, o sea da 1 si a>b, 0 si son iguales y -1 si a<b espero te sriva #!/usr/bin/perl sub first{ #my ($data2,$data1)=@_; $data1=$a; $data2=$b; my $pack=`/home/dsa/dsatex/ubuild/scripts/upackname -o ${data2}.can $data1`; #print "/home/dsa/dsatex/ubuild/scripts/upackname -o ${data2}.can $data1"; #print "pack:$pack"; my ($normresp,$order)=split(/ /,$pack); #print "O:$order"; return $order+0; } use Data::Dumper; open(FILE, "/home/dsa/ubtest/listapack"); while(<FILE>){ $count++; if ($count>10){last} chomp $_; $pack=`/home/dsa/dsatex/ubuild/scripts/upackname -o $_`; chomp $pack; ($nombre,$version,$release,$system,$ext)=split(/_/,$pack); $datos=[$nombre,$version,$release,$system,$ext,$pack,$_]; print "Pro: $nombre,$version,$release,$system,$ext\n"; $dat->{$nombre}=[@{$dat->{$nombre}},$datos]; $lista->{$nombre}=[@{$lista->{$nombre}},$pack]; } close(FILE); #print"hh", Dumper $dat; foreach my $nombre (keys %$dat){ print $nombre,"\n"; $datacomp=$dat->{$nombre}->[0]->[5]; print " ingresa: @{$lista->{$nombre}} \n"; @ordenada=sort first @{$lista->{$nombre}}; print "ordenada: @ordenada \n"; foreach my $data (@{$dat->{$nombre}}){ ($n,$v,$r,$s,$e,$p,$o)=@$data; $pack2=`/home/dsa/dsatex/ubuild/scripts/upackname -o $o $datacomp`; #print "BBBB$pack2\n"; ($normresp,$order)=split(/ /,$pack2); ($nc,$vc,$rc,$sc,$ec)=split(/_/,$datacomp); print " $v $r $s $e $p $o \n"; print " $vc $rc $sc $ec - $normresp - $datacomp : $order \n"; #$normresp - $datacomp - $order\n"; } } ###################################### #!/bin/bash version(){ cat <<EOF upackname $PROG_VERSION Copyright (C) 2010 Diego Saravia <[email protected]> License: $PROG_LICENCE <http://gnu.org/licenses/gpl.html> EOF } help(){ cat <<EOF upackname PACKAGE Splits package string in name, version and extension Prints PACKSTRING: Complete file name PACKDIR: Directories preceding file name PACKTYPE: NOEXT|UNKNOWNPKGEXT|BINPKGEXT|LISTEXT|METAEXT PACKEXT: Extension (rpm, deb, ebuild, tbz2, etc) PACKSYSTEM: i686, x86_64, hurd-i386, etc PACKNAME: Packname PACKVERSION: Complete version PACKSV: Source Version PACKRV: Release Version PACKRVORDER: Release Version in Gentoo transformed for comparisson. PACKCOMPLETENAME: without extension PACKCOMPLETENORMALIZEDNAME: without extension in a normalized fashion EOF } usage(){ cat <<EOF Usage: upackname PACKAGE EOF } extsep(){ for ext in $2 ; do rext=`echo $ext | sed 's|\.|\\\.|' ` first=`echo $1 | sed "s/\.$rext\$//"` if test "x$first" != "x$1"; then PACKEXT=$ext PACKTYPE=$3 PACKNOEXT=$first break fi done } PROG_VERSION=0.1 PROG_LICENCE="AGPLv3+: GNU AGPL version 3 or later" oneline=0 while test $# -gt 0 ; do case "$1" in -h|--help) help ;; -v|-V|--version) version ;; -u|--usage) usage ;; -o|--oneline) oneline=1 ;; *) FILES=$@ break ;; esac shift done if test x"$1" = x ; then usage exit fi anachar(){ local CADENA=$1 local char=$2 estext=`expr "$char" : '\([a-zA-Z0\.]\)'` if test x"$estext" != x ; then #echo CHAR $char ES=CHAR saca=$char nume= # no es necesario else nume=`expr "$CADENA" : '\([0-9]\+\)'` if test x"$nume" = x ; then saca=$char # lo pongo como char #ES=OTHER ES=CHAR #echo CHAR OTHER $char # es al vicio, solo preguntar por numeros #echo SEPARA $char #char='' else #echo NUM $nume ES=NUMB saca=$nume fi fi } # ver caracter ~ en debian order(){ # returns first as compared to second CADENA1=$1 CADENA2=$2 #echo 1: $CADENA1 - 2: $CADENA2 while true ; do char1=${CADENA1:0:1} char2=${CADENA2:0:1} #echo CHAR1: $char1 - CHAR2: $char2 if test x"$char1" = x -a x"$char2" = x ; then #echo SON IGUALES ORDER=0 break elif test x"$char1" = x -a x"$char2" != x ; then #echo CADENA1 PRIMERO T ORDER=-1 break elif test x"$char1" != x -a x"$char2" = x ; then #echo CADENA2 PRIMERO T ORDER=1 break fi anachar $CADENA1 $char1 CADENA1=${CADENA1#$saca} ES1=$ES nume1=$nume anachar $CADENA2 $char2 CADENA2=${CADENA2#$saca} ES2=$ES nume2=$nume #RES="$ES1 - $ES2 - $char1 - $char2 - $nume1 - $nume2" if test x"$ES1" = xNUMB -a x"$ES2" = xNUMB ; then if test x"$nume1" = x"$nume2" ; then #echo continue IGUALES NUMB: $RES continue elif test $nume1 -gt $nume2; then #echo "CADENA2 PRI 2 : $RES" ORDER=1 else #echo "CADENA1 PRI 2 : $RES" ORDER=-1 fi break elif test x"$ES1" = xCHAR -a x"$ES2" = xCHAR ; then if test x"$char1" = x"$char2" ; then #echo continue IGUALES CHAR: $RES continue elif test $char1 > $char2; then #echo "CADENA1 PRI 3 : $RES" ORDER=-1 else #echo "CADENA2 PRI 3 : $RES" ORDER=1 fi break elif test x"$ES1" = xCHAR -a x"$ES2" = xNUMB ; then if test x"$char1" = x0 ; then #echo "CADENA1 PRI 4 0 : $RES" ORDER=-1 break else #echo "CADENA2 PRI 4 : $RES" ORDER=1 fi break elif test x"$ES1" = xNUMB -a x"$ES2" = xCHAR ; then if test x"$char2" = x0 ; then #echo "CADENA2 PRI 4 0 : $RES" ORDER=1 else #echo "CADENA1 PRI 4 : $RES" ORDER=-1 fi break fi #echo lll $char - $nume - $EST - $estext - $CADENA1 done } #order apo1002300.001.45g.ui67 apo1002300.001.45g.ui68b #echo OOO $ORDER #exit PACK=$1 COMPPACK=$2 #echo NNN $1 JJJ $2 KKK #PACKSTRING=`basename $PACK` PACKSTRING=`echo $PACK | awk -F/ '{print $NF}'` PACKDIRPRE=${PACK%${PACKSTRING}} # en dos pasos por si no tiene / if test x"$PACKDIRPRE" = x/ ; then PACKDIR=/ else PACKDIR=${PACKDIRPRE%/} fi # 4 kind: file list (lf), metapacks (ebuild ubuild suma), binary packs, source packs METAEXT="ebuild ubuild summa" LISTEXT="lf can" # esto no es asi, cambiar #KNOWN: BINPKGEXT="tgz tbz2 deb rpm" #SEE: PKGEXT="tar.gz tgz tar.bz tar.bz2 tbz tbz2 ZIP sip jar gz Z z bz2 bz 7Z 7z RAR rar LHa LHA lha lzh a deb lzma xz rpm" PACKTYPE=0 # EXIST EXTENSION PACKEXT="" # packtype PACKNAMEVERS=$PACKSTRING ########################################3 test sobre archivos reales, ver que pasa si no se quiere esto # o sea proveer # basename? extsep $PACKSTRING "$BINPKGEXT" BINPKGEXT if test x"$PACKEXT" = x ; then extsep $PACKSTRING "$LISTEXT" LISTEXT fi if test x"$PACKEXT" = x ; then extsep $PACKSTRING "$METAEXT" METAEXT fi if test x"$PACKEXT" = x ; then PACKEXT=`echo $PACKSTRING | awk -F. '{print $NF}'` PACKNOEXT=${PACKSTRING%.${PACKEXT}} PACKTYPE=UNKNOWNPKGEXT fi if test x"$PACKEXT" = x ; then PACKNOEXT=$PACKSTRING PACKTYPE=NOEXT fi #echo mmmmmmmmmmmmmmm $PACKEXT PACKERROR='' case $PACKEXT in can) `echo $PACKNOEXT| sed 's/\(.*\)_\(.*\)_\(.*\)_\(.*\)_\(.*\)$/export PACKNAME\=\1 PACKSV\=\2 PACKRVORDER\=\3 PACKSYSTEM\=\4 PACKEXT\=\5'/` #echo CAN $PACKNAME $PACKSV $PACKRVORDER $PACKEXT ;; ebuild|ubuild|tbz2) # en build info o ebuild no parece haber info sobre nombre o version #http://distfiles.gentoo.org/distfiles/pms-3.pdf `echo $PACKNOEXT | sed -e 's/\(.*\)-\(\([[:digit:]]\+\(\.[[:digit:]]\+\)*\+[a-z]\?\)\(\(_\(alpha\|beta\|pre\|rc\|p\)[[:digit:]]*\)*\(-r\([[:digit:]]\+\)\)\?\)\)$/export PACKNAME=\1 PACKVERSION=\2 PACKSV=\3 PACKRVPRE=\5 PACKGENTOOPRE=\6 PACKGENTOORE=\8 PACKGENTOORENUM=\9/'` if test x"$PACKNAME" = x ; then echo ERROR, NO ES UN ARCHIVO GENTOO PACKERROR="No es Gentoo" fi if test x"$PACKGENTOOPRE" = x ; then #PACKRV=${PACKRVPRE#-} # no porque a veces debbiera agregar _ y otras - PACKSRORDER=5 else #PACKRV=$PACKRVPRE PACKSRORDERPRE=`echo $PACKGENTOOPRE| sed -r -e "s/_alpha/1./" \ -e "s/_beta/2./" \ -e "s/_pre/3./" \ -e "s/_rc/4./" \ -e "s/_p/6./" ` PACKSRORDER=`echo $PACKSRORDERPRE| sed -e 's/\.$//' ` fi PACKRV=$PACKRVPRE if test x"$PACKGENTOORE" = x ; then PACKRVORDER=$PACKSRORDER.0 else PACKRVORDER=$PACKSRORDER.$PACKGENTOORENUM fi #echo bbbbbbbbbbbbbbb $PACKGENTOOPRE $PACKGENTOORE - $PACKGENTOORENUM - $PACKSRORDER - $PACKSRORDERPRE #PACKNAME=sed -e 's/(.*\)\(-[[:digit:]]\+\(\.[[:digit:]]\+\)*\+[a-z]\?\(_\(alpha\|beta\|pre\|rc\|p\)[[:digit:]]*\)*\(-r[[:digit:]]\+\)\?\)$//'` #PACKVERSION=`echo $PACK|cut -d- -f2-` #if test x"$PACKVERSION" = x"$PACKNAME" ; then # esto es raro, # PACKVERSION='' # # que el cut ponga el primer campo si no hay segundo ver # #PACKVERSION=0 # fi #sed 's/-[0-9]\{1,\}.*$//' ;; #Ebuild file names consist of four logical subsections: #pkg-ver{_suf{#}}{-r#}.ebuild #Note: The brackets ({}) delineate optional fields and do not appear in the literal package name. # represents any non-zero positive integer. #The first subsection, pkg, is the package name, which should only contain lowercase letters, the digits 0-9, and any number of single hyphen (-), underscore (_) or plus (+) characters. Examples: util-linux, sysklogd and gtk+. We have some packages in Portage that don't follow these rules, but your packages should. #The second subsection, ver, is the version of the package, which should normally be same as the version on the main source tarball. The version is normally made up of two or three (or more) numbers separated by periods, such as 1.2 or 4.5.2, and may have a single letter immediately following the last digit; e.g., 1.4b or 2.6h. The package version is joined to the package name with a hyphen. For example: foo-1.0, bar-2.4.6. #Important: If you're thinking of using a trailing letter in your version string, note that the trailing letter should not be used to signify alpha or beta status for the package, since alphas and betas are prereleases and letter revisions are newer versions. This is an important distinction because Portage uses an ebuild's version number to determine if it is newer or older than other packages with the same category and name. It's very important that version numbers faithfully represent the version of the package so that Portage properly performs its dependency checking duties. #The third subsection, {_suf{#}}, is optional and may contain one of these predefined suffixes, listed in least-recent to most-recent order: #Suffix Meaning #_alpha Alpha release #_beta Beta release #_pre Prerelease #_rc Release candidate #(none) Normal release #_p Patch level (normally accompanied by trailing integer) #Any of these suffixes may be immediately followed by a non-zero positive integer, e.g., linux-2.4.0_pre10. Assuming identical version parts, the suffixes are ordered as follows (lower means older): _alpha < _beta < _pre < _rc < (no suffix) < _p. #When comparing identical suffixes with trailing integers, the one with the larger integer will be considered most recent. Example: foo-1.0_alpha4 is more recent than foo-1.0_alpha3. #The fourth subsection of the package name is the Gentoo Linux-specific revision number ({-r#}). This subsection, like the suffix, is also optional. # is a non-zero positive integer; e.g., package-4.5.3-r3. #This revision number is independent of the version of the source tarball and is used to inform people that a new and improved Gentoo Linux revision of a particular package is available. Initial releases of ebuilds must have no revision number; e.g., package-4.5.3 and are considered by Portage to have a revision number of zero. This means that counting goes as follows: 1.0 (initial version), 1.0-r1, 1.0-r2, etc. #If you make non-trivial improvements to an existing ebuild file, you should copy the ebuild file to a new file with the revision number incremented by 1. Remember to always make mentions of your changes in the ChangeLog when you bump a revision and in your CVS commit message; not doing so is against policy. #... and I suppose that we actually have a fifth section of the ebuild name as well -- the .ebuild extension itself. rpm) # spec si hay nombre, version y release, verificar que esto funcione bien al abrir cada paquete # PACKNAME=`echo $PACKNOEXT |sed 's/-[^-]*-[^-]*$//'` PACKNAME=`echo $PACKNOEXT |sed 's/-[^-]*-.*$//'` PACKVERSIONPRE=${PACKNOEXT#${PACKNAME}} # primero el nombre por si es todo PACKVERSIONSYS=${PACKVERSIONPRE#-} if test x"$PACKNAME" = x ; then echo ERROR, NO ES UN ARCHIVO RPM PACKERROR="No es RPM" fi PACKVERSION=`echo $PACKVERSIONSYS | sed '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\)$//'` PACKSYSTEMPRE=${PACKVERSIONSYS#${PACKVERSION}} # primero el nombre por si es todo PACKSYSTEM=${PACKSYSTEMPRE#.} PACKNOSYSTEM=$PACKNAME-$PACKVERSION `echo $PACKVERSION| sed 's/\([^-]*\)-\(.*\)$/export PACKSV\=\1 PACKRV\=\2/'` # echo KKKK $PACKSV KKKKK $PACKSYSTEM KKKKKK $PACKRV # `echo $PACKNOEXT | sed -e 's/\([a-zA-Z0-9_\-\+]*\)-\([a-zA-Z0-9_\.]*\)-\([a-zA-Z0-9_\.]*\)\.\(noarch\|src\|i386\|i686\|athlon\|ppc\|x86_64\)$/export PACKNAME\="\1" PACKVERSION\="\2-\3.\4" PACKOV\="\2" PACKRV\="\3" PACKARCH\="\4"/'` #older systems do not have arch part, see # my $name = $1; # my $version = $2; # my $release = $3; # my $arch = $4; #$ rpm -qp --qf '%{NAME}' some.rpm #rpm -qa|sed 's/-[^-]*-[^-]*$//' #RPM <name>-<version>-<release>.<architecture>.rpm nano-0.98-2.i386.rpm libgnomeuimm-2.0-2.0.0-3.src.rpm #A package label is contained within the file and does not necessarily #need to match the name of the file. #Additionally, libraries are distributed in two separate packages for #each version. One contains the precompiled code, while the second one #contains the development files such as headers, static library files, #etc. for the library in question. Those packages have "-devel" appended to their name field. Users need to carefully check so that #the version of the development package matches that of the binary #package, otherwise the library may not work very well. ;; deb) # en control parece haber info sobre el nombre, no sobre las versiones, usar para verificar #DEB <foo>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb PACKNAME=`echo $PACKNOEXT | awk -F_ '{print $1}'` PACKVERSIONSYSPRE=${PACKNOEXT#${PACKNAME}} # en dos pasos por si el nombre debian esta mal y no usa _ PACKVERSIONSYS=${PACKVERSIONSYSPRE#_} if test x"$PACKNAME" = x ; then echo ERROR, NO ES UN ARCHIVO DEB PACKERROR="No es deb" fi #echo MMMMM $PACKVERSION #igual que el rpm con _ en vez de . PACKVERSION=`echo $PACKVERSIONSYS | sed '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\)$//'` if test x"$PACKVERSION" = x ; then echo ERROR, NO ES UN ARCHIVO DEB PACKERROR="No es deb" fi PACKNOSYSTEM=$PACKNAME_$PACKVERSION echo MMMMM $PACKVERSION - $PACKNOSYSTEM PACKSYSTEMPRE=${PACKVERSIONSYS#${PACKVERSION}} # primero el nombre por si es todo PACKSYSTEM=${PACKSYSTEMPRE#_} `echo $PACKVERSION| sed 's/\([^-]*\)-\(.*\)$/export PACKSV\=\1 PACKRV\=\2/'` if test x"$PACKSV" = x ; then echo ERROR, NO ES UN ARCHIVO DEB PACKERROR="No es deb" fi # echo KKKK $PACKSV KKKKK $PACKSYSTEM KKKKKK $PACKRV KKKK $PACKNOSYSTEM #\([a-z][a-z0-9\+\-\.]+\)_\([a-zA-Z0-9_\.]*\)-\([0-9a-zA-Z\+\.\~]+\)_\(noarch\|src\|noarch\|i386\|i686\|athlon\|ppc\|x86_64\) #The name of the package itself (not the filename, just the name of the package) can contain lowercase letters, numbers, and the "-" and "+" characters. #debian_revision #This part of the version number specifies the version of the Debian package based on the upstream version. #It may contain only alphanumerics and the characters + . ~ (plus, full stop, tilde) and is compared in the same way as the upstream_version is. #It is optional; if it isn't present then the upstream_version may not contain a hyphen. #This format represents the case where a piece of software was written specifically to be turned into a Debian package, #and so there is only one "debianisation" of it and therefore no revision indication is required. #It is conventional to restart the debian_revision at 1 each time the upstream_version is increased. #The package management system will break the version number apart at the last hyphen in the string #(if there is one) to determine the upstream_version and debian_revision. The absence of a debian_revision is equivalent to a debian_revision of 0 #The VVV component is the version number specified by the upstream #developer. There are no standards in place here, so the version number #may have formats as different as "19990513" and "1.3.8pre1". #The RRR component is the Debian revision number, and is specified by #the Debian developer (or an individual user if he chooses to build the #package himself). This number corresponds to the revision level of the #Debian package, thus, a new revision level usually signifies changes #in the Debian Makefile (debian/rules), the Debian control file #(debian/control), the installation or removal scripts (debian/p*), or #in the configuration files used with the package. #The AAA component identifies the processor for which the package was #built. This is commonly i386, which refers to chips compatible to #Intel's 386 or later versions. For other possibilities review Debian's #FTP directory structure at What are all those directories at the #Debian FTP archives?, Section 6.7. For details, see the description of #"Debian architecture" in the manual page dpkg-architecture(1). # #i386 ia64 alpha amd64 armeb arm hppa m32r m68k mips mipsel powerpc ppc64 s390 s390x sh3 sh3eb sh4 sh4eb sparc darwin-i386 darwin-ia64 darwin-alpha darwin-amd64 darwin-armeb darwin-arm darwin-hppa darwin-m32r darwin-m68k darwin-mips darwin-mipsel darwin-powerpc darwin-ppc64 darwin-s390 darwin-s390x darwin-sh3 darwin-sh3eb darwin-sh4 darwin-sh4eb darwin-sparc freebsd-i386 freebsd-ia64 freebsd-alpha freebsd-amd64 freebsd-armeb freebsd-arm freebsd-hppa freebsd-m32r freebsd-m68k freebsd-mips freebsd-mipsel freebsd-powerpc freebsd-ppc64 freebsd-s390 freebsd-s390x freebsd-sh3 freebsd-sh3eb freebsd-sh4 freebsd-sh4eb freebsd-sparc kfreebsd-i386 kfreebsd-ia64 kfreebsd-alpha kfreebsd-amd64 kfreebsd-armeb kfreebsd-arm kfreebsd-hppa kfreebsd-m32r kfreebsd-m68k kfreebsd-mips kfreebsd-mipsel kfreebsd-powerpc kfreebsd-ppc64 kfreebsd-s390 kfreebsd-s390x kfreebsd-sh3 kfreebsd-sh3eb kfreebsd-sh4 kfreebsd-sh4eb kfreebsd-sparc knetbsd-i386 knetbsd-ia64 knetbsd-alpha knetbsd-amd64 knetbsd-armeb knetbsd-arm knetbsd-hppa knetbsd-m32r knetbsd-m68k knetbsd-mips knetbsd-mipsel knetbsd-powerpc knetbsd-ppc64 knetbsd-s390 knetbsd-s390x knetbsd-sh3 knetbsd-sh3eb knetbsd-sh4 knetbsd-sh4eb knetbsd-sparc netbsd-i386 netbsd-ia64 netbsd-alpha netbsd-amd64 netbsd-armeb netbsd-arm netbsd-hppa netbsd-m32r netbsd-m68k netbsd-mips netbsd-mipsel netbsd-powerpc netbsd-ppc64 netbsd-s390 netbsd-s390x netbsd-sh3 netbsd-sh3eb netbsd-sh4 netbsd-sh4eb netbsd-sparc openbsd-i386 openbsd-ia64 openbsd-alpha openbsd-amd64 openbsd-armeb openbsd-arm openbsd-hppa openbsd-m32r openbsd-m68k openbsd-mips openbsd-mipsel openbsd-powerpc openbsd-ppc64 openbsd-s390 openbsd-s390x openbsd-sh3 openbsd-sh3eb openbsd-sh4 openbsd-sh4eb openbsd-sparc hurd-i386 hurd-ia64 hurd-alpha hurd-amd64 hurd-armeb hurd-arm hurd-hppa hurd-m32r hurd-m68k hurd-mips hurd-mipsel hurd-powerpc hurd-ppc64 hurd-s390 hurd-s390x hurd-sh3 hurd-sh3eb hurd-sh4 hurd-sh4eb hurd-sparc ;; ;; esac #\(\(darwin\|freebsd\|netbsd\|kfreebsd\|knetbsd\|openbsd\|hurd\|gnu\|linux\)-\)\? ### aqui seguro tenemos PACKNOEXT ## si no tenemos PACKNOSYSTEM lo buscamos if test x"$PACKSYSTEM" = x ; then PACKNOSYSTEM=`echo $PACKNOEXT | sed '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\)$//'` # if apears something identifing origin as ubuntu, ututo, pacman etc must be extracted here #echo MMMM $PACKNAME - $PACKNOSYSTEM -$PACKNOEXT PACKSYSTEMPRE=${PACKNOEXT#${PACKNOSYSTEM}} # primero el nombre por si es todo PACKSYSTEMPRE3=${PACKSYSTEMPRE#-} PACKSYSTEMPRE2=${PACKSYSTEMPRE3#_} PACKSYSTEM=${PACKSYSTEMPRE2#.} fi if test x"$PACKNOSYSTEM" = x ; then PACKNOSYSTEM=$PACKNOEXT fi # aqui seguro tenemos PACKNOSYSTEM # si no tenemos PACKVERSION (PACKNONAME) lo buscamos #echo MMMM $PACKNAME - $PACKNOSYSTEM -$PACKNOEXT if test x"$PACKNAME" = x ; then PACKVERSION=`echo $PACKNOSYSTEM | awk -F- '{print $NF}'` if test x"$PACKVERSION" = x"$PACKNOSYSTEM" ; then PACKVERSION='' fi PACKNAMEPRE=${PACKNOSYSTEM%${PACKVERSION}} # en dos pasos por si no tiene - PACKNAME=${PACKNAMEPRE%-} #echo MMMM $PACKNAME fi ## si no conseguimos una PACKNAME diferente la buscamos de nuevo if test x"$PACKNAME" = x"$PACKNOSYSTEM" ; then PACKVERSION=`echo $PACKNOSYSTEM | awk -F- '{print $NF}'` if test x"$PACKVERSION" = x"$PACKNOSYSTEM" ; then PACKVERSION='' fi PACKNAMEPRE=${PACKNOSYSTEM%${PACKVERSION}} # en dos pasos por si no tiene - PACKNAME=${PACKNAMEPRE%_} fi #echo MMM $PACKSV if test x"$PACKSV" = x -a x"$PACKVERSION" != x ; then PACKRV='' PACKSV=`echo $PACKVERSION| sed 's/_\(.*\)$//'` if test x"$PACKVERSION" = x"$PACKSV" ; then ### PACKSV='' # no better to have this as VERSION if not RV : else PACKRVPRE=${PACKVERSION%$PACKSV} PACKRV=${PACKRVPRE%$_} fi fi if test x"$PACKRVORDER" = x ; then PACKRVORDER=$PACKRV fi SLASH=_ #if test x"$PACKSV" = x ; then # SLASH='' #fi SSLASH=_ #if test x"$PACKRVORDER" = x ; then # SSLASH='' #fi PACKCOMPLETENORMALIZEDNAME="$PACKNAME$SLASH$PACKSV$SSLASH${PACKRVORDER}_${PACKSYSTEM}_$PACKEXT" if test x"$COMPPACK" != x ; then `echo $COMPPACK| sed 's/\(.*\)_\(.*\)_\(.*\)_\(.*\)_\(.*\)$/export COMPPN\=\1 COMPPV\=\2 COMPPR\=\3 COMPPS\=\4 COMPPE\=\5'/` #echo COMP $COMPPV - $COMPPR #echo PACK $PACKSV - $PACKRVORDER order ${PACKSV}_$PACKRVORDER ${COMPPV}_$COMPPR fi if test x"$oneline" = x0 ; then echo "PACKSTRING='$PACKSTRING'" echo "PACKDIR='$PACKDIR'" echo "PACKNAME='$PACKNAME'" echo "PACKVERSION='$PACKVERSION'" #version and release # no: si no hay version , version debe ser 0 echo "PACKEXT='$PACKEXT'" echo "PACKTYPE='$PACKTYPE'" echo "PACKCOMPLETENAME='$PACKNOSYSTEM'" # without extension echo "PACKSYSTEM='$PACKSYSTEM'" echo "PACKSV='$PACKSV'" echo "PACKRV='$PACKRV'" echo "PACKERROR='$PACKERROR'" echo "PACKRVORDER='$PACKRVORDER'" echo "PACKCOMPLETENORMALIZEDNAME='$PACKCOMPLETENORMALIZEDNAME'" # without extension echo "ORDER='$ORDER'" echo "COMPPN='$COMPPN'" echo "COMPPV='$COMPPV'" echo "COMPPR='$COMPPR'" echo "COMPPS='$COMPPS'" echo "COMPPE='$COMPPE'" else #echo "$PACKNAME:$PACKSV:$PACKRVORDER:$PACKTYPE" if test x"$ORDER" != x ; then echo "$PACKCOMPLETENORMALIZEDNAME $ORDER" else echo "$PACKCOMPLETENORMALIZEDNAME" fi fi #No me fije en otros sistemas, pero los paquetes versionados al estilo #gentoo tiene una dificultad cuando corresponden a releases, #prereleases, betas, etc. Salvo por eso, se ordenarían fácilmente con #ls -v , que compara versiones numéricas en los nombres de archivos. #Pero cuando las versiones son cosas como paquete-0.3.7-alpha1 y #paquete-0.3.7 allí falla. #Lo que hice para resolver eso es previamente hacer una lista de los #archivos a ordenar, en la lista reemplazar esas cosas por números, #para que el ls los pueda ordenar, así: #sed -r -e "s/(-[0-9.]+)_alpha/\1_000_/" \ # -e "s/(-[0-9.]+)_beta/\1_001_/" \ # -e "s/(-[0-9.]+)_pre/\1_002_/" \ # -e "s/(-[0-9.]+)_rc/\1_003_/" \ # -e "s/(-[0-9.]+)_p/\1_004_/") #On Sunday 07 September 2008 08:28:11 Jim Meyering wrote: #> IMHO, changing sort -V to produce more intuitively-correct results #> is the way to go. #> #> With ls -v, I'm willing to make the change as well, *assuming* #> no one produces a counterargument. #> #> The question is what ordering function to use. #> The more generally-useful the better. i.e., I hope #> it can be compatible with both the rpm and deb version sorters. #I made an investigation of existing functions which sort version strings: #strverscmp - from glibc (now with its equivalent in gnulib) #rpmvercmp - from rpm #ververcmp - from dpkg## #The main problem of all these functions is dealing with suffixes. So I #modified them to drop the suffixes. So it is 6 implementations together (3 #original + 3 modified). #Then I ran a few series of tests with all implementations. I think the #modified version of ververcmp (from dpkg) gives the best results - consider #attached results of an example - results.tar.bz2# #So I propose a new function filevercmp (attachment filevercmp.c) as the #predicate function for new sort --version-sort. #In the attachment is also the whole "testing framework" which I used to #compare these functions - strverscmp.tar.bz2 - follow the steps in README #inside archive. It is developed a bit quickly but I hope it could be #useful :-)# #Kamil #http://www.opensubscriber.com/message/[email protected]/10201323.html #http://old.nabble.com/Possible-bug-in-sort--V-td26804985.html #> cat a | /build/toolchain/lin32/coreutils-8.2/bin/sort -V #> kernel-2.6.18-164.2.1.el5.x86_64.rpm #> kernel-2.6.18-164.6.1.el5.x86_64.rpm #> kernel-2.6.18-164.el5.x86_64.rpm #> #> The result should be #> kernel-2.6.18-164.el5.x86_64.rpm #> kernel-2.6.18-164.2.1.el5.x86_64.rpm #> kernel-2.6.18-164.6.1.el5.x86_64.rpm #> #> Is it a bug is sort -V? #I agree the behavior is pretty awkward. Nevertheless the behavior #is well documented: # http://www.gnu.org/software/coreutils/manual/html_node/Details-about-version... #The "bug" is triggered by the underscore in "x86_64". It's not treated as file #suffix in that case. However it works fairly well when you replace "x86_64" by #"i686". #From 3069d50b766a2db8b86406904b7327e5de5e315f Mon Sep 17 00:00:00 2001 #From: =?utf-8?q?P=C3=A1draig=20Brady?= <P@...> #Date: Thu, 17 Dec 2009 10:48:54 +0000 #Subject: [PATCH] doc: enhance and reference info about version comparison #* doc/coreutils.texi (sort invocation): Reference the additional #info about filevercmp rather than the unused strverscmp. #(Details about version sort): Add some examples that are not #handled well by fileversmp. #* src/ls.c: Change a comment referencing the now unused strverscmp. #--- # doc/coreutils.texi | 33 ++++++++++++++++++++++++--------- # src/ls.c | 2 +- # 2 files changed, 25 insertions(+), 10 deletions(-) #-This functionality is implemented using gnulib's @code{filevercmp} function. #-One result of that implementation decision is that @samp{ls -v} #-and @samp{sort -V} do not use the locale category, @env{LC_COLLATE}, #-which means non-numeric prefixes are sorted as if @env{LC_COLLATE} were set #-to @samp{C}. #+This functionality is implemented using gnulib's @code{filevercmp} function, #+which has some caveats worth noting. #+ #+@itemize @bullet #+@item @env{LC_COLLATE} is ignored, which means @samp{ls -v} and @samp{sort -V} #+will sort non-numeric prefixes as if the @env{LC_COLLATE} locale category #+was set to @samp{C}. #+@item Some suffixes will not be matched by the regular #+expression mentioned above. Consequently these examples may #+not sort as you expect: #+ #+@example #+abc-1.2.3.4.7z #+abc-1.2.3.7z #+@end example #+ #+@example #+abc-1.2.3.4.x86_64.rpm #+abc-1.2.3.x86_64.rpm #+@end example #+@end itemize # @node General output formatting # @subsection General output formatting #diff --git a/src/ls.c b/src/ls.c #index aeaa584..5c7f6aa 100644 #--- a/src/ls.c #+++ b/src/ls.c #@@ -3272,7 +3272,7 @@ DEFINE_SORT_FUNCTIONS (extension, cmp_extension) # All the other sort options, in fact, need xstrcoll and strcmp variants, # because they all use a string comparison (either as the primary or secondary # sort key), and xstrcoll has the ability to do a longjmp if strcoll fails for #- locale reasons. Last, strverscmp is ALWAYS available in coreutils, #+ locale reasons. Last, filevercmp is ALWAYS available in coreutils, # thanks to the gnulib library. */ # static inline int # cmp_version (struct fileinfo const *a, struct fileinfo const *b) #-- #1.6.2.5 #como compilar a partir de un ebuild, de un spec y de un control #category no esta en ebuild, si en ubuild #http://www.redhat.com/archives/rpm-list/2003-January/msg00006.html #RES1=`echo ".$CADENA1" |sed -e 's/[^0-9a-zA-Z]\+/./g'| sed -e 's/\([a-zA-Z]\+\)/\1:./g' | sed -e 's/\([0-9]\+\)/\1;./g' | sed -e 's/.\([0]\+\)/.\1:./g'` #RES2=`echo ".$CADENA2" |sed -e 's/[^0-9a-zA-Z]\+/./g'| sed -e 's/\([a-zA-Z]\+\)/\1:./g' | sed -e 's/\([0-9]\+\)/\1;./g' | sed -e 's/.\([0]\+\)/.\1:./g'` #echo $RES1 #echo $RES2 #FIN=0 ##IFS=. #RES1=${RES1#.} #RES2=${RES2#.} #coma=`echo "$RES1" |sed -e 's/\..\+$//'` #RES1=${RES1#$coma} #comb=`echo "$RES2" |sed -e 's/\..\+$//'` #RES2=${RES2#$comb} #echo $coma $comb - $RES1 $RES2 #if test x"$coma" != x"$comb" ; then # echo SON DISTINTOS $coma $comb # FIN=1 #fi# #if test x"$RES1" = x -o x"$RES2" = x ; then # echo junto termino: $coma - $comb # FIN=1 #fi #bbb=s # # if test x"$item" != x; then # echo $item # fi #done El 1 de julio de 2010 17:26, Pablo Manuel Rizzo <[email protected]>escribió:
2010/7/1 Diego Saravia <[email protected]>
hay que integrarlo con el programa que deduce las versiones, para eso lo escribi
no es mi idea generar un nuevo sort, con el tiempo el sort -V seguramente andara
solamente poder saber si un paquete es posterior o anterior a lo que ya esta instalado.
supongo que el programa que dado un paquete indica su nombre y versiones, cuando le digas cual es la versin instalada de ese mismo paquete te dira adicionalmente si es anterior o posterior
esa es mi idea,
se te ocurre algo mejor
Ah, está bien, había entendido otra cosa.
-- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
Me los pasas como adjuntos en un correo directo? porque pegando de acá me quedó con errores 2010/7/3 Diego Saravia <[email protected]>:
dado que nos fuimos del mundial, te mando pablo un par de programas
el primero es uno en perl que llama al segundo para ordenar un archivo que contiene una lista de archivos de ututo
es un ls *.tbz2 efectuado en un /ututo/i686, o sea un repositorio de paquetes
al segundo si le das un argumento lo "canoniza"
o sea lo transforma en un nombre facilmente separable en sus variables y ordenable
si le das dos argumentos, un paquete y un canonico los ordena, o sea da 1 si a>b, 0 si son iguales y -1 si a<b
espero te sriva
#!/usr/bin/perl
sub first{ #my ($data2,$data1)=@_; $data1=$a; $data2=$b; my $pack=`/home/dsa/dsatex/ubuild/scripts/upackname -o ${data2}.can $data1`; #print "/home/dsa/dsatex/ubuild/scripts/upackname -o ${data2}.can $data1"; #print "pack:$pack"; my ($normresp,$order)=split(/ /,$pack); #print "O:$order"; return $order+0; } use Data::Dumper; open(FILE, "/home/dsa/ubtest/listapack"); while(<FILE>){
$count++; if ($count>10){last} chomp $_; $pack=`/home/dsa/dsatex/ubuild/scripts/upackname -o $_`; chomp $pack; ($nombre,$version,$release,$system,$ext)=split(/_/,$pack); $datos=[$nombre,$version,$release,$system,$ext,$pack,$_]; print "Pro: $nombre,$version,$release,$system,$ext\n"; $dat->{$nombre}=[@{$dat->{$nombre}},$datos]; $lista->{$nombre}=[@{$lista->{$nombre}},$pack]; } close(FILE);
#print"hh", Dumper $dat;
foreach my $nombre (keys %$dat){ print $nombre,"\n"; $datacomp=$dat->{$nombre}->[0]->[5]; print " ingresa: @{$lista->{$nombre}} \n"; @ordenada=sort first @{$lista->{$nombre}}; print "ordenada: @ordenada \n"; foreach my $data (@{$dat->{$nombre}}){
($n,$v,$r,$s,$e,$p,$o)=@$data;
$pack2=`/home/dsa/dsatex/ubuild/scripts/upackname -o $o $datacomp`; #print "BBBB$pack2\n"; ($normresp,$order)=split(/ /,$pack2); ($nc,$vc,$rc,$sc,$ec)=split(/_/,$datacomp); print " $v $r $s $e $p $o \n"; print " $vc $rc $sc $ec - $normresp - $datacomp : $order \n";
#$normresp - $datacomp - $order\n"; }
}
######################################
#!/bin/bash
version(){ cat <<EOF upackname $PROG_VERSION Copyright (C) 2010 Diego Saravia <[email protected]> License: $PROG_LICENCE <http://gnu.org/licenses/gpl.html> EOF }
help(){ cat <<EOF upackname PACKAGE
Splits package string in name, version and extension
Prints PACKSTRING: Complete file name PACKDIR: Directories preceding file name PACKTYPE: NOEXT|UNKNOWNPKGEXT|BINPKGEXT|LISTEXT|METAEXT PACKEXT: Extension (rpm, deb, ebuild, tbz2, etc) PACKSYSTEM: i686, x86_64, hurd-i386, etc PACKNAME: Packname PACKVERSION: Complete version PACKSV: Source Version PACKRV: Release Version PACKRVORDER: Release Version in Gentoo transformed for comparisson.
PACKCOMPLETENAME: without extension PACKCOMPLETENORMALIZEDNAME: without extension in a normalized fashion EOF }
usage(){ cat <<EOF Usage: upackname PACKAGE EOF }
extsep(){ for ext in $2 ; do rext=`echo $ext | sed 's|\.|\\\.|' ` first=`echo $1 | sed "s/\.$rext\$//"` if test "x$first" != "x$1"; then PACKEXT=$ext PACKTYPE=$3 PACKNOEXT=$first break fi done }
PROG_VERSION=0.1 PROG_LICENCE="AGPLv3+: GNU AGPL version 3 or later" oneline=0 while test $# -gt 0 ; do case "$1" in -h|--help) help ;; -v|-V|--version) version ;; -u|--usage) usage ;; -o|--oneline) oneline=1 ;; *) FILES=$@ break ;; esac shift done
if test x"$1" = x ; then usage exit fi
anachar(){ local CADENA=$1 local char=$2
estext=`expr "$char" : '\([a-zA-Z0\.]\)'` if test x"$estext" != x ; then #echo CHAR $char ES=CHAR saca=$char nume= # no es necesario else nume=`expr "$CADENA" : '\([0-9]\+\)'` if test x"$nume" = x ; then saca=$char # lo pongo como char #ES=OTHER ES=CHAR #echo CHAR OTHER $char # es al vicio, solo preguntar por numeros #echo SEPARA $char #char='' else #echo NUM $nume ES=NUMB saca=$nume fi fi
}
# ver caracter ~ en debian order(){ # returns first as compared to second CADENA1=$1 CADENA2=$2 #echo 1: $CADENA1 - 2: $CADENA2
while true ; do char1=${CADENA1:0:1} char2=${CADENA2:0:1} #echo CHAR1: $char1 - CHAR2: $char2 if test x"$char1" = x -a x"$char2" = x ; then #echo SON IGUALES ORDER=0 break elif test x"$char1" = x -a x"$char2" != x ; then #echo CADENA1 PRIMERO T ORDER=-1 break elif test x"$char1" != x -a x"$char2" = x ; then #echo CADENA2 PRIMERO T ORDER=1 break fi
anachar $CADENA1 $char1 CADENA1=${CADENA1#$saca} ES1=$ES nume1=$nume
anachar $CADENA2 $char2 CADENA2=${CADENA2#$saca} ES2=$ES nume2=$nume #RES="$ES1 - $ES2 - $char1 - $char2 - $nume1 - $nume2"
if test x"$ES1" = xNUMB -a x"$ES2" = xNUMB ; then if test x"$nume1" = x"$nume2" ; then #echo continue IGUALES NUMB: $RES continue elif test $nume1 -gt $nume2; then #echo "CADENA2 PRI 2 : $RES" ORDER=1 else #echo "CADENA1 PRI 2 : $RES" ORDER=-1 fi break
elif test x"$ES1" = xCHAR -a x"$ES2" = xCHAR ; then if test x"$char1" = x"$char2" ; then #echo continue IGUALES CHAR: $RES continue elif test $char1 > $char2; then #echo "CADENA1 PRI 3 : $RES" ORDER=-1 else #echo "CADENA2 PRI 3 : $RES" ORDER=1 fi break
elif test x"$ES1" = xCHAR -a x"$ES2" = xNUMB ; then if test x"$char1" = x0 ; then #echo "CADENA1 PRI 4 0 : $RES" ORDER=-1 break else #echo "CADENA2 PRI 4 : $RES" ORDER=1 fi break elif test x"$ES1" = xNUMB -a x"$ES2" = xCHAR ; then if test x"$char2" = x0 ; then #echo "CADENA2 PRI 4 0 : $RES" ORDER=1 else #echo "CADENA1 PRI 4 : $RES" ORDER=-1 fi break fi
#echo lll $char - $nume - $EST - $estext - $CADENA1 done }
#order apo1002300.001.45g.ui67 apo1002300.001.45g.ui68b
#echo OOO $ORDER #exit
PACK=$1 COMPPACK=$2
#echo NNN $1 JJJ $2 KKK #PACKSTRING=`basename $PACK` PACKSTRING=`echo $PACK | awk -F/ '{print $NF}'` PACKDIRPRE=${PACK%${PACKSTRING}} # en dos pasos por si no tiene /
if test x"$PACKDIRPRE" = x/ ; then PACKDIR=/ else PACKDIR=${PACKDIRPRE%/} fi
# 4 kind: file list (lf), metapacks (ebuild ubuild suma), binary packs, source packs METAEXT="ebuild ubuild summa" LISTEXT="lf can" # esto no es asi, cambiar
#KNOWN: BINPKGEXT="tgz tbz2 deb rpm" #SEE: PKGEXT="tar.gz tgz tar.bz tar.bz2 tbz tbz2 ZIP sip jar gz Z z bz2 bz 7Z 7z RAR rar LHa LHA lha lzh a deb lzma xz rpm"
PACKTYPE=0 # EXIST EXTENSION PACKEXT="" # packtype PACKNAMEVERS=$PACKSTRING
########################################3 test sobre archivos reales, ver que pasa si no se quiere esto # o sea proveer
# basename?
extsep $PACKSTRING "$BINPKGEXT" BINPKGEXT
if test x"$PACKEXT" = x ; then extsep $PACKSTRING "$LISTEXT" LISTEXT fi if test x"$PACKEXT" = x ; then extsep $PACKSTRING "$METAEXT" METAEXT fi
if test x"$PACKEXT" = x ; then PACKEXT=`echo $PACKSTRING | awk -F. '{print $NF}'` PACKNOEXT=${PACKSTRING%.${PACKEXT}} PACKTYPE=UNKNOWNPKGEXT fi if test x"$PACKEXT" = x ; then PACKNOEXT=$PACKSTRING PACKTYPE=NOEXT fi
#echo mmmmmmmmmmmmmmm $PACKEXT PACKERROR=''
case $PACKEXT in can) `echo $PACKNOEXT| sed 's/\(.*\)_\(.*\)_\(.*\)_\(.*\)_\(.*\)$/export PACKNAME\=\1 PACKSV\=\2 PACKRVORDER\=\3 PACKSYSTEM\=\4 PACKEXT\=\5'/`
#echo CAN $PACKNAME $PACKSV $PACKRVORDER $PACKEXT ;; ebuild|ubuild|tbz2) # en build info o ebuild no parece haber info sobre nombre o version
#http://distfiles.gentoo.org/distfiles/pms-3.pdf
`echo $PACKNOEXT | sed -e 's/\(.*\)-\(\([[:digit:]]\+\(\.[[:digit:]]\+\)*\+[a-z]\?\)\(\(_\(alpha\|beta\|pre\|rc\|p\)[[:digit:]]*\)*\(-r\([[:digit:]]\+\)\)\?\)\)$/export PACKNAME=\1 PACKVERSION=\2 PACKSV=\3 PACKRVPRE=\5 PACKGENTOOPRE=\6 PACKGENTOORE=\8 PACKGENTOORENUM=\9/'`
if test x"$PACKNAME" = x ; then echo ERROR, NO ES UN ARCHIVO GENTOO PACKERROR="No es Gentoo" fi
if test x"$PACKGENTOOPRE" = x ; then #PACKRV=${PACKRVPRE#-} # no porque a veces debbiera agregar _ y otras - PACKSRORDER=5 else #PACKRV=$PACKRVPRE PACKSRORDERPRE=`echo $PACKGENTOOPRE| sed -r -e "s/_alpha/1./" \ -e "s/_beta/2./" \ -e "s/_pre/3./" \ -e "s/_rc/4./" \ -e "s/_p/6./" `
PACKSRORDER=`echo $PACKSRORDERPRE| sed -e 's/\.$//' `
fi
PACKRV=$PACKRVPRE
if test x"$PACKGENTOORE" = x ; then PACKRVORDER=$PACKSRORDER.0 else PACKRVORDER=$PACKSRORDER.$PACKGENTOORENUM fi
#echo bbbbbbbbbbbbbbb $PACKGENTOOPRE $PACKGENTOORE - $PACKGENTOORENUM - $PACKSRORDER - $PACKSRORDERPRE
#PACKNAME=sed -e 's/(.*\)\(-[[:digit:]]\+\(\.[[:digit:]]\+\)*\+[a-z]\?\(_\(alpha\|beta\|pre\|rc\|p\)[[:digit:]]*\)*\(-r[[:digit:]]\+\)\?\)$//'` #PACKVERSION=`echo $PACK|cut -d- -f2-` #if test x"$PACKVERSION" = x"$PACKNAME" ; then # esto es raro, # PACKVERSION='' # # que el cut ponga el primer campo si no hay segundo ver # #PACKVERSION=0 # fi
#sed 's/-[0-9]\{1,\}.*$//' ;;
#Ebuild file names consist of four logical subsections:
#pkg-ver{_suf{#}}{-r#}.ebuild
#Note: The brackets ({}) delineate optional fields and do not appear in the literal package name. # represents any non-zero positive integer.
#The first subsection, pkg, is the package name, which should only contain lowercase letters, the digits 0-9, and any number of single hyphen (-), underscore (_) or plus (+) characters. Examples: util-linux, sysklogd and gtk+. We have some packages in Portage that don't follow these rules, but your packages should.
#The second subsection, ver, is the version of the package, which should normally be same as the version on the main source tarball. The version is normally made up of two or three (or more) numbers separated by periods, such as 1.2 or 4.5.2, and may have a single letter immediately following the last digit; e.g., 1.4b or 2.6h. The package version is joined to the package name with a hyphen. For example: foo-1.0, bar-2.4.6.
#Important: If you're thinking of using a trailing letter in your version string, note that the trailing letter should not be used to signify alpha or beta status for the package, since alphas and betas are prereleases and letter revisions are newer versions. This is an important distinction because Portage uses an ebuild's version number to determine if it is newer or older than other packages with the same category and name. It's very important that version numbers faithfully represent the version of the package so that Portage properly performs its dependency checking duties.
#The third subsection, {_suf{#}}, is optional and may contain one of these predefined suffixes, listed in least-recent to most-recent order: #Suffix Meaning #_alpha Alpha release #_beta Beta release #_pre Prerelease #_rc Release candidate #(none) Normal release #_p Patch level (normally accompanied by trailing integer)
#Any of these suffixes may be immediately followed by a non-zero positive integer, e.g., linux-2.4.0_pre10. Assuming identical version parts, the suffixes are ordered as follows (lower means older): _alpha < _beta < _pre < _rc < (no suffix) < _p.
#When comparing identical suffixes with trailing integers, the one with the larger integer will be considered most recent. Example: foo-1.0_alpha4 is more recent than foo-1.0_alpha3.
#The fourth subsection of the package name is the Gentoo Linux-specific revision number ({-r#}). This subsection, like the suffix, is also optional. # is a non-zero positive integer; e.g., package-4.5.3-r3.
#This revision number is independent of the version of the source tarball and is used to inform people that a new and improved Gentoo Linux revision of a particular package is available. Initial releases of ebuilds must have no revision number; e.g., package-4.5.3 and are considered by Portage to have a revision number of zero. This means that counting goes as follows: 1.0 (initial version), 1.0-r1, 1.0-r2, etc.
#If you make non-trivial improvements to an existing ebuild file, you should copy the ebuild file to a new file with the revision number incremented by 1. Remember to always make mentions of your changes in the ChangeLog when you bump a revision and in your CVS commit message; not doing so is against policy.
#... and I suppose that we actually have a fifth section of the ebuild name as well -- the .ebuild extension itself.
rpm) # spec si hay nombre, version y release, verificar que esto funcione bien al abrir cada paquete
# PACKNAME=`echo $PACKNOEXT |sed 's/-[^-]*-[^-]*$//'` PACKNAME=`echo $PACKNOEXT |sed 's/-[^-]*-.*$//'` PACKVERSIONPRE=${PACKNOEXT#${PACKNAME}} # primero el nombre por si es todo PACKVERSIONSYS=${PACKVERSIONPRE#-}
if test x"$PACKNAME" = x ; then echo ERROR, NO ES UN ARCHIVO RPM PACKERROR="No es RPM" fi
PACKVERSION=`echo $PACKVERSIONSYS | sed '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\)$//'` PACKSYSTEMPRE=${PACKVERSIONSYS#${PACKVERSION}} # primero el nombre por si es todo PACKSYSTEM=${PACKSYSTEMPRE#.}
PACKNOSYSTEM=$PACKNAME-$PACKVERSION
`echo $PACKVERSION| sed 's/\([^-]*\)-\(.*\)$/export PACKSV\=\1 PACKRV\=\2/'`
# echo KKKK $PACKSV KKKKK $PACKSYSTEM KKKKKK $PACKRV
# `echo $PACKNOEXT | sed -e 's/\([a-zA-Z0-9_\-\+]*\)-\([a-zA-Z0-9_\.]*\)-\([a-zA-Z0-9_\.]*\)\.\(noarch\|src\|i386\|i686\|athlon\|ppc\|x86_64\)$/export PACKNAME\="\1" PACKVERSION\="\2-\3.\4" PACKOV\="\2" PACKRV\="\3" PACKARCH\="\4"/'`
#older systems do not have arch part, see # my $name = $1; # my $version = $2; # my $release = $3; # my $arch = $4;
#$ rpm -qp --qf '%{NAME}' some.rpm
#rpm -qa|sed 's/-[^-]*-[^-]*$//'
#RPM <name>-<version>-<release>.<architecture>.rpm nano-0.98-2.i386.rpm libgnomeuimm-2.0-2.0.0-3.src.rpm
#A package label is contained within the file and does not necessarily #need to match the name of the file.
#Additionally, libraries are distributed in two separate packages for #each version. One contains the precompiled code, while the second one #contains the development files such as headers, static library files, #etc. for the library in question. Those packages have "-devel" appended to their name field. Users need to carefully check so that #the version of the development package matches that of the binary #package, otherwise the library may not work very well. ;;
deb)
# en control parece haber info sobre el nombre, no sobre las versiones, usar para verificar
#DEB <foo>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb
PACKNAME=`echo $PACKNOEXT | awk -F_ '{print $1}'` PACKVERSIONSYSPRE=${PACKNOEXT#${PACKNAME}} # en dos pasos por si el nombre debian esta mal y no usa _ PACKVERSIONSYS=${PACKVERSIONSYSPRE#_}
if test x"$PACKNAME" = x ; then echo ERROR, NO ES UN ARCHIVO DEB PACKERROR="No es deb" fi
#echo MMMMM $PACKVERSION #igual que el rpm con _ en vez de . PACKVERSION=`echo $PACKVERSIONSYS | sed '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\)$//'`
if test x"$PACKVERSION" = x ; then echo ERROR, NO ES UN ARCHIVO DEB PACKERROR="No es deb" fi
PACKNOSYSTEM=$PACKNAME_$PACKVERSION echo MMMMM $PACKVERSION - $PACKNOSYSTEM PACKSYSTEMPRE=${PACKVERSIONSYS#${PACKVERSION}} # primero el nombre por si es todo PACKSYSTEM=${PACKSYSTEMPRE#_}
`echo $PACKVERSION| sed 's/\([^-]*\)-\(.*\)$/export PACKSV\=\1 PACKRV\=\2/'`
if test x"$PACKSV" = x ; then echo ERROR, NO ES UN ARCHIVO DEB PACKERROR="No es deb" fi
# echo KKKK $PACKSV KKKKK $PACKSYSTEM KKKKKK $PACKRV KKKK $PACKNOSYSTEM
#\([a-z][a-z0-9\+\-\.]+\)_\([a-zA-Z0-9_\.]*\)-\([0-9a-zA-Z\+\.\~]+\)_\(noarch\|src\|noarch\|i386\|i686\|athlon\|ppc\|x86_64\)
#The name of the package itself (not the filename, just the name of the package) can contain lowercase letters, numbers, and the "-" and "+" characters. #debian_revision
#This part of the version number specifies the version of the Debian package based on the upstream version. #It may contain only alphanumerics and the characters + . ~ (plus, full stop, tilde) and is compared in the same way as the upstream_version is. #It is optional; if it isn't present then the upstream_version may not contain a hyphen. #This format represents the case where a piece of software was written specifically to be turned into a Debian package, #and so there is only one "debianisation" of it and therefore no revision indication is required. #It is conventional to restart the debian_revision at 1 each time the upstream_version is increased. #The package management system will break the version number apart at the last hyphen in the string #(if there is one) to determine the upstream_version and debian_revision. The absence of a debian_revision is equivalent to a debian_revision of 0
#The VVV component is the version number specified by the upstream #developer. There are no standards in place here, so the version number #may have formats as different as "19990513" and "1.3.8pre1".
#The RRR component is the Debian revision number, and is specified by #the Debian developer (or an individual user if he chooses to build the #package himself). This number corresponds to the revision level of the #Debian package, thus, a new revision level usually signifies changes #in the Debian Makefile (debian/rules), the Debian control file #(debian/control), the installation or removal scripts (debian/p*), or #in the configuration files used with the package.
#The AAA component identifies the processor for which the package was #built. This is commonly i386, which refers to chips compatible to #Intel's 386 or later versions. For other possibilities review Debian's #FTP directory structure at What are all those directories at the #Debian FTP archives?, Section 6.7. For details, see the description of #"Debian architecture" in the manual page dpkg-architecture(1).
#
#i386 ia64 alpha amd64 armeb arm hppa m32r m68k mips mipsel powerpc ppc64 s390 s390x sh3 sh3eb sh4 sh4eb sparc darwin-i386 darwin-ia64 darwin-alpha darwin-amd64 darwin-armeb darwin-arm darwin-hppa darwin-m32r darwin-m68k darwin-mips darwin-mipsel darwin-powerpc darwin-ppc64 darwin-s390 darwin-s390x darwin-sh3 darwin-sh3eb darwin-sh4 darwin-sh4eb darwin-sparc freebsd-i386 freebsd-ia64 freebsd-alpha freebsd-amd64 freebsd-armeb freebsd-arm freebsd-hppa freebsd-m32r freebsd-m68k freebsd-mips freebsd-mipsel freebsd-powerpc freebsd-ppc64 freebsd-s390 freebsd-s390x freebsd-sh3 freebsd-sh3eb freebsd-sh4 freebsd-sh4eb freebsd-sparc kfreebsd-i386 kfreebsd-ia64 kfreebsd-alpha kfreebsd-amd64 kfreebsd-armeb kfreebsd-arm kfreebsd-hppa kfreebsd-m32r kfreebsd-m68k kfreebsd-mips kfreebsd-mipsel kfreebsd-powerpc kfreebsd-ppc64 kfreebsd-s390 kfreebsd-s390x kfreebsd-sh3 kfreebsd-sh3eb kfreebsd-sh4 kfreebsd-sh4eb kfreebsd-sparc knetbsd-i386 knetbsd-ia64 knetbsd-alpha knetbsd-amd64 knetbsd-armeb knetbsd-arm knetbsd-hppa knetbsd-m32r knetbsd-m68k knetbsd-mips knetbsd-mipsel knetbsd-powerpc knetbsd-ppc64 knetbsd-s390 knetbsd-s390x knetbsd-sh3 knetbsd-sh3eb knetbsd-sh4 knetbsd-sh4eb knetbsd-sparc netbsd-i386 netbsd-ia64 netbsd-alpha netbsd-amd64 netbsd-armeb netbsd-arm netbsd-hppa netbsd-m32r netbsd-m68k netbsd-mips netbsd-mipsel netbsd-powerpc netbsd-ppc64 netbsd-s390 netbsd-s390x netbsd-sh3 netbsd-sh3eb netbsd-sh4 netbsd-sh4eb netbsd-sparc openbsd-i386 openbsd-ia64 openbsd-alpha openbsd-amd64 openbsd-armeb openbsd-arm openbsd-hppa openbsd-m32r openbsd-m68k openbsd-mips openbsd-mipsel openbsd-powerpc openbsd-ppc64 openbsd-s390 openbsd-s390x openbsd-sh3 openbsd-sh3eb openbsd-sh4 openbsd-sh4eb openbsd-sparc hurd-i386 hurd-ia64 hurd-alpha hurd-amd64 hurd-armeb hurd-arm hurd-hppa hurd-m32r hurd-m68k hurd-mips hurd-mipsel hurd-powerpc hurd-ppc64 hurd-s390 hurd-s390x hurd-sh3 hurd-sh3eb hurd-sh4 hurd-sh4eb hurd-sparc ;;
;;
esac #\(\(darwin\|freebsd\|netbsd\|kfreebsd\|knetbsd\|openbsd\|hurd\|gnu\|linux\)-\)\? ### aqui seguro tenemos PACKNOEXT
## si no tenemos PACKNOSYSTEM lo buscamos if test x"$PACKSYSTEM" = x ; then PACKNOSYSTEM=`echo $PACKNOEXT | sed '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\)$//'`
# if apears something identifing origin as ubuntu, ututo, pacman etc must be extracted here
#echo MMMM $PACKNAME - $PACKNOSYSTEM -$PACKNOEXT PACKSYSTEMPRE=${PACKNOEXT#${PACKNOSYSTEM}} # primero el nombre por si es todo PACKSYSTEMPRE3=${PACKSYSTEMPRE#-} PACKSYSTEMPRE2=${PACKSYSTEMPRE3#_} PACKSYSTEM=${PACKSYSTEMPRE2#.}
fi
if test x"$PACKNOSYSTEM" = x ; then PACKNOSYSTEM=$PACKNOEXT fi
# aqui seguro tenemos PACKNOSYSTEM # si no tenemos PACKVERSION (PACKNONAME) lo buscamos
#echo MMMM $PACKNAME - $PACKNOSYSTEM -$PACKNOEXT
if test x"$PACKNAME" = x ; then PACKVERSION=`echo $PACKNOSYSTEM | awk -F- '{print $NF}'` if test x"$PACKVERSION" = x"$PACKNOSYSTEM" ; then PACKVERSION='' fi PACKNAMEPRE=${PACKNOSYSTEM%${PACKVERSION}} # en dos pasos por si no tiene - PACKNAME=${PACKNAMEPRE%-}
#echo MMMM $PACKNAME fi
## si no conseguimos una PACKNAME diferente la buscamos de nuevo if test x"$PACKNAME" = x"$PACKNOSYSTEM" ; then PACKVERSION=`echo $PACKNOSYSTEM | awk -F- '{print $NF}'` if test x"$PACKVERSION" = x"$PACKNOSYSTEM" ; then PACKVERSION='' fi PACKNAMEPRE=${PACKNOSYSTEM%${PACKVERSION}} # en dos pasos por si no tiene - PACKNAME=${PACKNAMEPRE%_} fi
#echo MMM $PACKSV if test x"$PACKSV" = x -a x"$PACKVERSION" != x ; then
PACKRV='' PACKSV=`echo $PACKVERSION| sed 's/_\(.*\)$//'` if test x"$PACKVERSION" = x"$PACKSV" ; then ### PACKSV='' # no better to have this as VERSION if not RV : else PACKRVPRE=${PACKVERSION%$PACKSV} PACKRV=${PACKRVPRE%$_} fi
fi
if test x"$PACKRVORDER" = x ; then PACKRVORDER=$PACKRV fi
SLASH=_ #if test x"$PACKSV" = x ; then # SLASH='' #fi SSLASH=_ #if test x"$PACKRVORDER" = x ; then # SSLASH='' #fi PACKCOMPLETENORMALIZEDNAME="$PACKNAME$SLASH$PACKSV$SSLASH${PACKRVORDER}_${PACKSYSTEM}_$PACKEXT"
if test x"$COMPPACK" != x ; then `echo $COMPPACK| sed 's/\(.*\)_\(.*\)_\(.*\)_\(.*\)_\(.*\)$/export COMPPN\=\1 COMPPV\=\2 COMPPR\=\3 COMPPS\=\4 COMPPE\=\5'/`
#echo COMP $COMPPV - $COMPPR #echo PACK $PACKSV - $PACKRVORDER
order ${PACKSV}_$PACKRVORDER ${COMPPV}_$COMPPR
fi
if test x"$oneline" = x0 ; then
echo "PACKSTRING='$PACKSTRING'" echo "PACKDIR='$PACKDIR'" echo "PACKNAME='$PACKNAME'" echo "PACKVERSION='$PACKVERSION'" #version and release # no: si no hay version , version debe ser 0 echo "PACKEXT='$PACKEXT'" echo "PACKTYPE='$PACKTYPE'" echo "PACKCOMPLETENAME='$PACKNOSYSTEM'" # without extension
echo "PACKSYSTEM='$PACKSYSTEM'" echo "PACKSV='$PACKSV'" echo "PACKRV='$PACKRV'" echo "PACKERROR='$PACKERROR'" echo "PACKRVORDER='$PACKRVORDER'"
echo "PACKCOMPLETENORMALIZEDNAME='$PACKCOMPLETENORMALIZEDNAME'" # without extension echo "ORDER='$ORDER'" echo "COMPPN='$COMPPN'" echo "COMPPV='$COMPPV'" echo "COMPPR='$COMPPR'" echo "COMPPS='$COMPPS'" echo "COMPPE='$COMPPE'" else
#echo "$PACKNAME:$PACKSV:$PACKRVORDER:$PACKTYPE" if test x"$ORDER" != x ; then echo "$PACKCOMPLETENORMALIZEDNAME $ORDER" else echo "$PACKCOMPLETENORMALIZEDNAME" fi fi
#No me fije en otros sistemas, pero los paquetes versionados al estilo #gentoo tiene una dificultad cuando corresponden a releases, #prereleases, betas, etc. Salvo por eso, se ordenarían fácilmente con #ls -v , que compara versiones numéricas en los nombres de archivos. #Pero cuando las versiones son cosas como paquete-0.3.7-alpha1 y #paquete-0.3.7 allí falla.
#Lo que hice para resolver eso es previamente hacer una lista de los #archivos a ordenar, en la lista reemplazar esas cosas por números, #para que el ls los pueda ordenar, así:
#sed -r -e "s/(-[0-9.]+)_alpha/\1_000_/" \ # -e "s/(-[0-9.]+)_beta/\1_001_/" \ # -e "s/(-[0-9.]+)_pre/\1_002_/" \ # -e "s/(-[0-9.]+)_rc/\1_003_/" \ # -e "s/(-[0-9.]+)_p/\1_004_/") #On Sunday 07 September 2008 08:28:11 Jim Meyering wrote: #> IMHO, changing sort -V to produce more intuitively-correct results #> is the way to go. #> #> With ls -v, I'm willing to make the change as well, *assuming* #> no one produces a counterargument. #> #> The question is what ordering function to use. #> The more generally-useful the better. i.e., I hope #> it can be compatible with both the rpm and deb version sorters. #I made an investigation of existing functions which sort version strings: #strverscmp - from glibc (now with its equivalent in gnulib) #rpmvercmp - from rpm #ververcmp - from dpkg##
#The main problem of all these functions is dealing with suffixes. So I #modified them to drop the suffixes. So it is 6 implementations together (3 #original + 3 modified).
#Then I ran a few series of tests with all implementations. I think the #modified version of ververcmp (from dpkg) gives the best results - consider #attached results of an example - results.tar.bz2#
#So I propose a new function filevercmp (attachment filevercmp.c) as the #predicate function for new sort --version-sort.
#In the attachment is also the whole "testing framework" which I used to #compare these functions - strverscmp.tar.bz2 - follow the steps in README #inside archive. It is developed a bit quickly but I hope it could be #useful :-)#
#Kamil #http://www.opensubscriber.com/message/[email protected]/10201323.html
#http://old.nabble.com/Possible-bug-in-sort--V-td26804985.html
#> cat a | /build/toolchain/lin32/coreutils-8.2/bin/sort -V #> kernel-2.6.18-164.2.1.el5.x86_64.rpm #> kernel-2.6.18-164.6.1.el5.x86_64.rpm #> kernel-2.6.18-164.el5.x86_64.rpm #> #> The result should be #> kernel-2.6.18-164.el5.x86_64.rpm #> kernel-2.6.18-164.2.1.el5.x86_64.rpm #> kernel-2.6.18-164.6.1.el5.x86_64.rpm #> #> Is it a bug is sort -V?
#I agree the behavior is pretty awkward. Nevertheless the behavior #is well documented:
#http://www.gnu.org/software/coreutils/manual/html_node/Details-about-version...
#The "bug" is triggered by the underscore in "x86_64". It's not treated as file #suffix in that case. However it works fairly well when you replace "x86_64" by #"i686". #From 3069d50b766a2db8b86406904b7327e5de5e315f Mon Sep 17 00:00:00 2001 #From: =?utf-8?q?P=C3=A1draig=20Brady?= <P@...> #Date: Thu, 17 Dec 2009 10:48:54 +0000 #Subject: [PATCH] doc: enhance and reference info about version comparison
#* doc/coreutils.texi (sort invocation): Reference the additional #info about filevercmp rather than the unused strverscmp. #(Details about version sort): Add some examples that are not #handled well by fileversmp. #* src/ls.c: Change a comment referencing the now unused strverscmp. #--- # doc/coreutils.texi | 33 ++++++++++++++++++++++++--------- # src/ls.c | 2 +- # 2 files changed, 25 insertions(+), 10 deletions(-)
#-This functionality is implemented using gnulib's @code{filevercmp} function. #-One result of that implementation decision is that @samp{ls -v} #-and @samp{sort -V} do not use the locale category, @env{LC_COLLATE}, #-which means non-numeric prefixes are sorted as if @env{LC_COLLATE} were set #-to @samp{C}. #+This functionality is implemented using gnulib's @code{filevercmp} function, #+which has some caveats worth noting. #+ #+@itemize @bullet #+@item @env{LC_COLLATE} is ignored, which means @samp{ls -v} and @samp{sort -V} #+will sort non-numeric prefixes as if the @env{LC_COLLATE} locale category #+was set to @samp{C}. #+@item Some suffixes will not be matched by the regular #+expression mentioned above. Consequently these examples may #+not sort as you expect: #+ #+@example #+abc-1.2.3.4.7z #+abc-1.2.3.7z #+@end example #+ #+@example #+abc-1.2.3.4.x86_64.rpm #+abc-1.2.3.x86_64.rpm #+@end example #+@end itemize
# @node General output formatting # @subsection General output formatting #diff --git a/src/ls.c b/src/ls.c #index aeaa584..5c7f6aa 100644 #--- a/src/ls.c #+++ b/src/ls.c #@@ -3272,7 +3272,7 @@ DEFINE_SORT_FUNCTIONS (extension, cmp_extension) # All the other sort options, in fact, need xstrcoll and strcmp variants, # because they all use a string comparison (either as the primary or secondary # sort key), and xstrcoll has the ability to do a longjmp if strcoll fails for #- locale reasons. Last, strverscmp is ALWAYS available in coreutils, #+ locale reasons. Last, filevercmp is ALWAYS available in coreutils, # thanks to the gnulib library. */ # static inline int # cmp_version (struct fileinfo const *a, struct fileinfo const *b) #-- #1.6.2.5
#como compilar a partir de un ebuild, de un spec y de un control #category no esta en ebuild, si en ubuild
#http://www.redhat.com/archives/rpm-list/2003-January/msg00006.html
#RES1=`echo ".$CADENA1" |sed -e 's/[^0-9a-zA-Z]\+/./g'| sed -e 's/\([a-zA-Z]\+\)/\1:./g' | sed -e 's/\([0-9]\+\)/\1;./g' | sed -e 's/.\([0]\+\)/.\1:./g'` #RES2=`echo ".$CADENA2" |sed -e 's/[^0-9a-zA-Z]\+/./g'| sed -e 's/\([a-zA-Z]\+\)/\1:./g' | sed -e 's/\([0-9]\+\)/\1;./g' | sed -e 's/.\([0]\+\)/.\1:./g'` #echo $RES1 #echo $RES2
#FIN=0 ##IFS=.
#RES1=${RES1#.} #RES2=${RES2#.} #coma=`echo "$RES1" |sed -e 's/\..\+$//'` #RES1=${RES1#$coma}
#comb=`echo "$RES2" |sed -e 's/\..\+$//'` #RES2=${RES2#$comb}
#echo $coma $comb - $RES1 $RES2 #if test x"$coma" != x"$comb" ; then # echo SON DISTINTOS $coma $comb # FIN=1 #fi#
#if test x"$RES1" = x -o x"$RES2" = x ; then # echo junto termino: $coma - $comb # FIN=1 #fi #bbb=s # # if test x"$item" != x; then # echo $item
# fi
#done
El 1 de julio de 2010 17:26, Pablo Manuel Rizzo <[email protected]> escribió:
2010/7/1 Diego Saravia <[email protected]>
hay que integrarlo con el programa que deduce las versiones, para eso lo escribi
no es mi idea generar un nuevo sort, con el tiempo el sort -V seguramente andara
solamente poder saber si un paquete es posterior o anterior a lo que ya esta instalado.
supongo que el programa que dado un paquete indica su nombre y versiones, cuando le digas cual es la versin instalada de ese mismo paquete te dira adicionalmente si es anterior o posterior
esa es mi idea,
se te ocurre algo mejor
Ah, está bien, había entendido otra cosa.
-- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
bueno, en un rato te lo paso 2010/7/4 Pablo Manuel Rizzo <[email protected]>
Me los pasas como adjuntos en un correo directo? porque pegando de acá me quedó con errores
2010/7/3 Diego Saravia <[email protected]>:
dado que nos fuimos del mundial, te mando pablo un par de programas
el primero es uno en perl que llama al segundo para ordenar un archivo que contiene una lista de archivos de ututo
es un ls *.tbz2 efectuado en un /ututo/i686, o sea un repositorio de paquetes
al segundo si le das un argumento lo "canoniza"
o sea lo transforma en un nombre facilmente separable en sus variables y ordenable
si le das dos argumentos, un paquete y un canonico los ordena, o sea da 1 si a>b, 0 si son iguales y -1 si a<b
espero te sriva
#!/usr/bin/perl
sub first{ #my ($data2,$data1)=@_; $data1=$a; $data2=$b; my $pack=`/home/dsa/dsatex/ubuild/scripts/upackname -o ${data2}.can $data1`; #print "/home/dsa/dsatex/ubuild/scripts/upackname -o ${data2}.can $data1"; #print "pack:$pack"; my ($normresp,$order)=split(/ /,$pack); #print "O:$order"; return $order+0; } use Data::Dumper; open(FILE, "/home/dsa/ubtest/listapack"); while(<FILE>){
$count++; if ($count>10){last} chomp $_; $pack=`/home/dsa/dsatex/ubuild/scripts/upackname -o $_`; chomp $pack; ($nombre,$version,$release,$system,$ext)=split(/_/,$pack); $datos=[$nombre,$version,$release,$system,$ext,$pack,$_]; print "Pro: $nombre,$version,$release,$system,$ext\n"; $dat->{$nombre}=[@{$dat->{$nombre}},$datos]; $lista->{$nombre}=[@{$lista->{$nombre}},$pack]; } close(FILE);
#print"hh", Dumper $dat;
foreach my $nombre (keys %$dat){ print $nombre,"\n"; $datacomp=$dat->{$nombre}->[0]->[5]; print " ingresa: @{$lista->{$nombre}} \n"; @ordenada=sort first @{$lista->{$nombre}}; print "ordenada: @ordenada \n"; foreach my $data (@{$dat->{$nombre}}){
($n,$v,$r,$s,$e,$p,$o)=@$data;
$pack2=`/home/dsa/dsatex/ubuild/scripts/upackname -o $o $datacomp`; #print "BBBB$pack2\n"; ($normresp,$order)=split(/ /,$pack2); ($nc,$vc,$rc,$sc,$ec)=split(/_/,$datacomp); print " $v $r $s $e $p $o \n"; print " $vc $rc $sc $ec - $normresp - $datacomp : $order \n";
#$normresp - $datacomp - $order\n"; }
}
######################################
#!/bin/bash
version(){ cat <<EOF upackname $PROG_VERSION Copyright (C) 2010 Diego Saravia <[email protected]> License: $PROG_LICENCE <http://gnu.org/licenses/gpl.html> EOF }
help(){ cat <<EOF upackname PACKAGE
Splits package string in name, version and extension
Prints PACKSTRING: Complete file name PACKDIR: Directories preceding file name PACKTYPE: NOEXT|UNKNOWNPKGEXT|BINPKGEXT|LISTEXT|METAEXT PACKEXT: Extension (rpm, deb, ebuild, tbz2, etc) PACKSYSTEM: i686, x86_64, hurd-i386, etc PACKNAME: Packname PACKVERSION: Complete version PACKSV: Source Version PACKRV: Release Version PACKRVORDER: Release Version in Gentoo transformed for comparisson.
PACKCOMPLETENAME: without extension PACKCOMPLETENORMALIZEDNAME: without extension in a normalized fashion EOF }
usage(){ cat <<EOF Usage: upackname PACKAGE EOF }
extsep(){ for ext in $2 ; do rext=`echo $ext | sed 's|\.|\\\.|' ` first=`echo $1 | sed "s/\.$rext\$//"` if test "x$first" != "x$1"; then PACKEXT=$ext PACKTYPE=$3 PACKNOEXT=$first break fi done }
PROG_VERSION=0.1 PROG_LICENCE="AGPLv3+: GNU AGPL version 3 or later" oneline=0 while test $# -gt 0 ; do case "$1" in -h|--help) help ;; -v|-V|--version) version ;; -u|--usage) usage ;; -o|--oneline) oneline=1 ;; *) FILES=$@ break ;; esac shift done
if test x"$1" = x ; then usage exit fi
anachar(){ local CADENA=$1 local char=$2
estext=`expr "$char" : '\([a-zA-Z0\.]\)'` if test x"$estext" != x ; then #echo CHAR $char ES=CHAR saca=$char nume= # no es necesario else nume=`expr "$CADENA" : '\([0-9]\+\)'` if test x"$nume" = x ; then saca=$char # lo pongo como char #ES=OTHER ES=CHAR #echo CHAR OTHER $char # es al vicio, solo preguntar por numeros #echo SEPARA $char #char='' else #echo NUM $nume ES=NUMB saca=$nume fi fi
}
# ver caracter ~ en debian order(){ # returns first as compared to second CADENA1=$1 CADENA2=$2 #echo 1: $CADENA1 - 2: $CADENA2
while true ; do char1=${CADENA1:0:1} char2=${CADENA2:0:1} #echo CHAR1: $char1 - CHAR2: $char2 if test x"$char1" = x -a x"$char2" = x ; then #echo SON IGUALES ORDER=0 break elif test x"$char1" = x -a x"$char2" != x ; then #echo CADENA1 PRIMERO T ORDER=-1 break elif test x"$char1" != x -a x"$char2" = x ; then #echo CADENA2 PRIMERO T ORDER=1 break fi
anachar $CADENA1 $char1 CADENA1=${CADENA1#$saca} ES1=$ES nume1=$nume
anachar $CADENA2 $char2 CADENA2=${CADENA2#$saca} ES2=$ES nume2=$nume #RES="$ES1 - $ES2 - $char1 - $char2 - $nume1 - $nume2"
if test x"$ES1" = xNUMB -a x"$ES2" = xNUMB ; then if test x"$nume1" = x"$nume2" ; then #echo continue IGUALES NUMB: $RES continue elif test $nume1 -gt $nume2; then #echo "CADENA2 PRI 2 : $RES" ORDER=1 else #echo "CADENA1 PRI 2 : $RES" ORDER=-1 fi break
elif test x"$ES1" = xCHAR -a x"$ES2" = xCHAR ; then if test x"$char1" = x"$char2" ; then #echo continue IGUALES CHAR: $RES continue elif test $char1 > $char2; then #echo "CADENA1 PRI 3 : $RES" ORDER=-1 else #echo "CADENA2 PRI 3 : $RES" ORDER=1 fi break
elif test x"$ES1" = xCHAR -a x"$ES2" = xNUMB ; then if test x"$char1" = x0 ; then #echo "CADENA1 PRI 4 0 : $RES" ORDER=-1 break else #echo "CADENA2 PRI 4 : $RES" ORDER=1 fi break elif test x"$ES1" = xNUMB -a x"$ES2" = xCHAR ; then if test x"$char2" = x0 ; then #echo "CADENA2 PRI 4 0 : $RES" ORDER=1 else #echo "CADENA1 PRI 4 : $RES" ORDER=-1 fi break fi
#echo lll $char - $nume - $EST - $estext - $CADENA1 done }
#order apo1002300.001.45g.ui67 apo1002300.001.45g.ui68b
#echo OOO $ORDER #exit
PACK=$1 COMPPACK=$2
#echo NNN $1 JJJ $2 KKK #PACKSTRING=`basename $PACK` PACKSTRING=`echo $PACK | awk -F/ '{print $NF}'` PACKDIRPRE=${PACK%${PACKSTRING}} # en dos pasos por si no tiene /
if test x"$PACKDIRPRE" = x/ ; then PACKDIR=/ else PACKDIR=${PACKDIRPRE%/} fi
# 4 kind: file list (lf), metapacks (ebuild ubuild suma), binary packs, source packs METAEXT="ebuild ubuild summa" LISTEXT="lf can" # esto no es asi, cambiar
#KNOWN: BINPKGEXT="tgz tbz2 deb rpm" #SEE: PKGEXT="tar.gz tgz tar.bz tar.bz2 tbz tbz2 ZIP sip jar gz Z z bz2 bz 7Z 7z RAR rar LHa LHA lha lzh a deb lzma xz rpm"
PACKTYPE=0 # EXIST EXTENSION PACKEXT="" # packtype PACKNAMEVERS=$PACKSTRING
########################################3 test sobre archivos reales, ver que pasa si no se quiere esto # o sea proveer
# basename?
extsep $PACKSTRING "$BINPKGEXT" BINPKGEXT
if test x"$PACKEXT" = x ; then extsep $PACKSTRING "$LISTEXT" LISTEXT fi if test x"$PACKEXT" = x ; then extsep $PACKSTRING "$METAEXT" METAEXT fi
if test x"$PACKEXT" = x ; then PACKEXT=`echo $PACKSTRING | awk -F. '{print $NF}'` PACKNOEXT=${PACKSTRING%.${PACKEXT}} PACKTYPE=UNKNOWNPKGEXT fi if test x"$PACKEXT" = x ; then PACKNOEXT=$PACKSTRING PACKTYPE=NOEXT fi
#echo mmmmmmmmmmmmmmm $PACKEXT PACKERROR=''
case $PACKEXT in can) `echo $PACKNOEXT| sed 's/\(.*\)_\(.*\)_\(.*\)_\(.*\)_\(.*\)$/export PACKNAME\=\1 PACKSV\=\2 PACKRVORDER\=\3 PACKSYSTEM\=\4 PACKEXT\=\5'/`
#echo CAN $PACKNAME $PACKSV $PACKRVORDER $PACKEXT ;; ebuild|ubuild|tbz2) # en build info o ebuild no parece haber info sobre nombre o version
#http://distfiles.gentoo.org/distfiles/pms-3.pdf
`echo $PACKNOEXT | sed -e
's/\(.*\)-\(\([[:digit:]]\+\(\.[[:digit:]]\+\)*\+[a-z]\?\)\(\(_\(alpha\|beta\|pre\|rc\|p\)[[:digit:]]*\)*\(-r\([[:digit:]]\+\)\)\?\)\)$/export
PACKNAME=\1 PACKVERSION=\2 PACKSV=\3 PACKRVPRE=\5 PACKGENTOOPRE=\6 PACKGENTOORE=\8 PACKGENTOORENUM=\9/'`
if test x"$PACKNAME" = x ; then echo ERROR, NO ES UN ARCHIVO GENTOO PACKERROR="No es Gentoo" fi
if test x"$PACKGENTOOPRE" = x ; then #PACKRV=${PACKRVPRE#-} # no porque a veces debbiera agregar _ y otras - PACKSRORDER=5 else #PACKRV=$PACKRVPRE PACKSRORDERPRE=`echo $PACKGENTOOPRE| sed -r -e "s/_alpha/1./" \ -e "s/_beta/2./" \ -e "s/_pre/3./" \ -e "s/_rc/4./" \ -e "s/_p/6./" `
PACKSRORDER=`echo $PACKSRORDERPRE| sed -e 's/\.$//' `
fi
PACKRV=$PACKRVPRE
if test x"$PACKGENTOORE" = x ; then PACKRVORDER=$PACKSRORDER.0 else PACKRVORDER=$PACKSRORDER.$PACKGENTOORENUM fi
#echo bbbbbbbbbbbbbbb $PACKGENTOOPRE $PACKGENTOORE - $PACKGENTOORENUM - $PACKSRORDER - $PACKSRORDERPRE
#PACKNAME=sed -e
's/(.*\)\(-[[:digit:]]\+\(\.[[:digit:]]\+\)*\+[a-z]\?\(_\(alpha\|beta\|pre\|rc\|p\)[[:digit:]]*\)*\(-r[[:digit:]]\+\)\?\)$//'`
#PACKVERSION=`echo $PACK|cut -d- -f2-` #if test x"$PACKVERSION" = x"$PACKNAME" ; then # esto es raro, # PACKVERSION='' # # que el cut ponga el primer campo si no hay segundo ver # #PACKVERSION=0 # fi
#sed 's/-[0-9]\{1,\}.*$//' ;;
#Ebuild file names consist of four logical subsections:
#pkg-ver{_suf{#}}{-r#}.ebuild
#Note: The brackets ({}) delineate optional fields and do not appear in
the
literal package name. # represents any non-zero positive integer.
#The first subsection, pkg, is the package name, which should only contain lowercase letters, the digits 0-9, and any number of single hyphen (-), underscore (_) or plus (+) characters. Examples: util-linux, sysklogd and gtk+. We have some packages in Portage that don't follow these rules, but your packages should.
#The second subsection, ver, is the version of the package, which should normally be same as the version on the main source tarball. The version is normally made up of two or three (or more) numbers separated by periods, such as 1.2 or 4.5.2, and may have a single letter immediately following the last digit; e.g., 1.4b or 2.6h. The package version is joined to the package name with a hyphen. For example: foo-1.0, bar-2.4.6.
#Important: If you're thinking of using a trailing letter in your version string, note that the trailing letter should not be used to signify alpha or beta status for the package, since alphas and betas are prereleases and letter revisions are newer versions. This is an important distinction because Portage uses an ebuild's version number to determine if it is newer or older than other packages with the same category and name. It's very important that version numbers faithfully represent the version of the package so that Portage properly performs its dependency checking duties.
#The third subsection, {_suf{#}}, is optional and may contain one of these predefined suffixes, listed in least-recent to most-recent order: #Suffix Meaning #_alpha Alpha release #_beta Beta release #_pre Prerelease #_rc Release candidate #(none) Normal release #_p Patch level (normally accompanied by trailing integer)
#Any of these suffixes may be immediately followed by a non-zero positive integer, e.g., linux-2.4.0_pre10. Assuming identical version parts, the suffixes are ordered as follows (lower means older): _alpha < _beta < _pre < _rc < (no suffix) < _p.
#When comparing identical suffixes with trailing integers, the one with the larger integer will be considered most recent. Example: foo-1.0_alpha4 is more recent than foo-1.0_alpha3.
#The fourth subsection of the package name is the Gentoo Linux-specific revision number ({-r#}). This subsection, like the suffix, is also optional. # is a non-zero positive integer; e.g., package-4.5.3-r3.
#This revision number is independent of the version of the source tarball and is used to inform people that a new and improved Gentoo Linux revision of a particular package is available. Initial releases of ebuilds must have no revision number; e.g., package-4.5.3 and are considered by Portage to have a revision number of zero. This means that counting goes as follows: 1.0 (initial version), 1.0-r1, 1.0-r2, etc.
#If you make non-trivial improvements to an existing ebuild file, you should copy the ebuild file to a new file with the revision number incremented by 1. Remember to always make mentions of your changes in the ChangeLog when you bump a revision and in your CVS commit message; not doing so is against policy.
#... and I suppose that we actually have a fifth section of the ebuild name as well -- the .ebuild extension itself.
rpm) # spec si hay nombre, version y release, verificar que esto funcione bien al abrir cada paquete
# PACKNAME=`echo $PACKNOEXT |sed 's/-[^-]*-[^-]*$//'` PACKNAME=`echo $PACKNOEXT |sed 's/-[^-]*-.*$//'` PACKVERSIONPRE=${PACKNOEXT#${PACKNAME}} # primero el nombre por si es todo PACKVERSIONSYS=${PACKVERSIONPRE#-}
if test x"$PACKNAME" = x ; then echo ERROR, NO ES UN ARCHIVO RPM PACKERROR="No es RPM" fi
PACKVERSION=`echo $PACKVERSIONSYS | sed
'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\)$//'`
PACKSYSTEMPRE=${PACKVERSIONSYS#${PACKVERSION}} # primero el nombre
por
si es todo PACKSYSTEM=${PACKSYSTEMPRE#.}
PACKNOSYSTEM=$PACKNAME-$PACKVERSION
`echo $PACKVERSION| sed 's/\([^-]*\)-\(.*\)$/export PACKSV\=\1 PACKRV\=\2/'`
# echo KKKK $PACKSV KKKKK $PACKSYSTEM KKKKKK $PACKRV
# `echo $PACKNOEXT | sed -e
's/\([a-zA-Z0-9_\-\+]*\)-\([a-zA-Z0-9_\.]*\)-\([a-zA-Z0-9_\.]*\)\.\(noarch\|src\|i386\|i686\|athlon\|ppc\|x86_64\)$/export
PACKNAME\="\1" PACKVERSION\="\2-\3.\4" PACKOV\="\2" PACKRV\="\3" PACKARCH\="\4"/'`
#older systems do not have arch part, see # my $name = $1; # my $version = $2; # my $release = $3; # my $arch = $4;
#$ rpm -qp --qf '%{NAME}' some.rpm
#rpm -qa|sed 's/-[^-]*-[^-]*$//'
#RPM <name>-<version>-<release>.<architecture>.rpm nano-0.98-2.i386.rpm libgnomeuimm-2.0-2.0.0-3.src.rpm
#A package label is contained within the file and does not necessarily #need to match the name of the file.
#Additionally, libraries are distributed in two separate packages for #each version. One contains the precompiled code, while the second one #contains the development files such as headers, static library files, #etc. for the library in question. Those packages have "-devel" appended to their name field. Users need to carefully check so that #the version of the development package matches that of the binary #package, otherwise the library may not work very well. ;;
deb)
# en control parece haber info sobre el nombre, no sobre las versiones, usar para verificar
#DEB <foo>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb
PACKNAME=`echo $PACKNOEXT | awk -F_ '{print $1}'` PACKVERSIONSYSPRE=${PACKNOEXT#${PACKNAME}} # en dos pasos por si el nombre debian esta mal y no usa _ PACKVERSIONSYS=${PACKVERSIONSYSPRE#_}
if test x"$PACKNAME" = x ; then echo ERROR, NO ES UN ARCHIVO DEB PACKERROR="No es deb" fi
#echo MMMMM $PACKVERSION #igual que el rpm con _ en vez de . PACKVERSION=`echo $PACKVERSIONSYS | sed
'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\)$//'`
if test x"$PACKVERSION" = x ; then echo ERROR, NO ES UN ARCHIVO DEB PACKERROR="No es deb" fi
PACKNOSYSTEM=$PACKNAME_$PACKVERSION echo MMMMM $PACKVERSION - $PACKNOSYSTEM PACKSYSTEMPRE=${PACKVERSIONSYS#${PACKVERSION}} # primero el nombre
por
si es todo PACKSYSTEM=${PACKSYSTEMPRE#_}
`echo $PACKVERSION| sed 's/\([^-]*\)-\(.*\)$/export PACKSV\=\1 PACKRV\=\2/'`
if test x"$PACKSV" = x ; then echo ERROR, NO ES UN ARCHIVO DEB PACKERROR="No es deb" fi
# echo KKKK $PACKSV KKKKK $PACKSYSTEM KKKKKK $PACKRV KKKK $PACKNOSYSTEM
#\([a-z][a-z0-9\+\-\.]+\)_\([a-zA-Z0-9_\.]*\)-\([0-9a-zA-Z\+\.\~]+\)_\(noarch\|src\|noarch\|i386\|i686\|athlon\|ppc\|x86_64\)
#The name of the package itself (not the filename, just the name of
the
package) can contain lowercase letters, numbers, and the "-" and "+" characters. #debian_revision
#This part of the version number specifies the version of the Debian package based on the upstream version. #It may contain only alphanumerics and the characters + . ~ (plus, full stop, tilde) and is compared in the same way as the upstream_version is. #It is optional; if it isn't present then the upstream_version may not contain a hyphen. #This format represents the case where a piece of software was written specifically to be turned into a Debian package, #and so there is only one "debianisation" of it and therefore no revision indication is required. #It is conventional to restart the debian_revision at 1 each time the upstream_version is increased. #The package management system will break the version number apart at the last hyphen in the string #(if there is one) to determine the upstream_version and debian_revision. The absence of a debian_revision is equivalent to a debian_revision of 0
#The VVV component is the version number specified by the upstream #developer. There are no standards in place here, so the version number #may have formats as different as "19990513" and "1.3.8pre1".
#The RRR component is the Debian revision number, and is specified by #the Debian developer (or an individual user if he chooses to build the #package himself). This number corresponds to the revision level of the #Debian package, thus, a new revision level usually signifies changes #in the Debian Makefile (debian/rules), the Debian control file #(debian/control), the installation or removal scripts (debian/p*), or #in the configuration files used with the package.
#The AAA component identifies the processor for which the package was #built. This is commonly i386, which refers to chips compatible to #Intel's 386 or later versions. For other possibilities review Debian's #FTP directory structure at What are all those directories at the #Debian FTP archives?, Section 6.7. For details, see the description of #"Debian architecture" in the manual page dpkg-architecture(1).
#
#i386 ia64 alpha amd64 armeb arm hppa m32r m68k mips mipsel powerpc ppc64 s390 s390x sh3 sh3eb sh4 sh4eb sparc darwin-i386 darwin-ia64 darwin-alpha darwin-amd64 darwin-armeb darwin-arm darwin-hppa darwin-m32r darwin-m68k darwin-mips darwin-mipsel darwin-powerpc darwin-ppc64 darwin-s390 darwin-s390x darwin-sh3 darwin-sh3eb darwin-sh4 darwin-sh4eb darwin-sparc freebsd-i386 freebsd-ia64 freebsd-alpha freebsd-amd64 freebsd-armeb freebsd-arm freebsd-hppa freebsd-m32r freebsd-m68k freebsd-mips freebsd-mipsel freebsd-powerpc freebsd-ppc64 freebsd-s390 freebsd-s390x freebsd-sh3 freebsd-sh3eb freebsd-sh4 freebsd-sh4eb freebsd-sparc kfreebsd-i386 kfreebsd-ia64 kfreebsd-alpha kfreebsd-amd64 kfreebsd-armeb kfreebsd-arm kfreebsd-hppa kfreebsd-m32r kfreebsd-m68k kfreebsd-mips kfreebsd-mipsel kfreebsd-powerpc kfreebsd-ppc64 kfreebsd-s390 kfreebsd-s390x kfreebsd-sh3 kfreebsd-sh3eb kfreebsd-sh4 kfreebsd-sh4eb kfreebsd-sparc knetbsd-i386 knetbsd-ia64 knetbsd-alpha knetbsd-amd64 knetbsd-armeb knetbsd-arm knetbsd-hppa knetbsd-m32r knetbsd-m68k knetbsd-mips knetbsd-mipsel knetbsd-powerpc knetbsd-ppc64 knetbsd-s390 knetbsd-s390x knetbsd-sh3 knetbsd-sh3eb knetbsd-sh4 knetbsd-sh4eb knetbsd-sparc netbsd-i386 netbsd-ia64 netbsd-alpha netbsd-amd64 netbsd-armeb netbsd-arm netbsd-hppa netbsd-m32r netbsd-m68k netbsd-mips netbsd-mipsel netbsd-powerpc netbsd-ppc64 netbsd-s390 netbsd-s390x netbsd-sh3 netbsd-sh3eb netbsd-sh4 netbsd-sh4eb netbsd-sparc openbsd-i386 openbsd-ia64 openbsd-alpha openbsd-amd64 openbsd-armeb openbsd-arm openbsd-hppa openbsd-m32r openbsd-m68k openbsd-mips openbsd-mipsel openbsd-powerpc openbsd-ppc64 openbsd-s390 openbsd-s390x openbsd-sh3 openbsd-sh3eb openbsd-sh4 openbsd-sh4eb openbsd-sparc hurd-i386 hurd-ia64 hurd-alpha hurd-amd64 hurd-armeb hurd-arm hurd-hppa hurd-m32r hurd-m68k hurd-mips hurd-mipsel hurd-powerpc hurd-ppc64 hurd-s390 hurd-s390x hurd-sh3 hurd-sh3eb hurd-sh4 hurd-sh4eb hurd-sparc ;;
;;
esac
#\(\(darwin\|freebsd\|netbsd\|kfreebsd\|knetbsd\|openbsd\|hurd\|gnu\|linux\)-\)\?
### aqui seguro tenemos PACKNOEXT
## si no tenemos PACKNOSYSTEM lo buscamos if test x"$PACKSYSTEM" = x ; then PACKNOSYSTEM=`echo $PACKNOEXT | sed
'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\)$//'`
# if apears something identifing origin as ubuntu, ututo, pacman etc must
be
extracted here
#echo MMMM $PACKNAME - $PACKNOSYSTEM -$PACKNOEXT PACKSYSTEMPRE=${PACKNOEXT#${PACKNOSYSTEM}} # primero el nombre por si es todo PACKSYSTEMPRE3=${PACKSYSTEMPRE#-} PACKSYSTEMPRE2=${PACKSYSTEMPRE3#_} PACKSYSTEM=${PACKSYSTEMPRE2#.}
fi
if test x"$PACKNOSYSTEM" = x ; then PACKNOSYSTEM=$PACKNOEXT fi
# aqui seguro tenemos PACKNOSYSTEM # si no tenemos PACKVERSION (PACKNONAME) lo buscamos
#echo MMMM $PACKNAME - $PACKNOSYSTEM -$PACKNOEXT
if test x"$PACKNAME" = x ; then PACKVERSION=`echo $PACKNOSYSTEM | awk -F- '{print $NF}'` if test x"$PACKVERSION" = x"$PACKNOSYSTEM" ; then PACKVERSION='' fi PACKNAMEPRE=${PACKNOSYSTEM%${PACKVERSION}} # en dos pasos por si no tiene - PACKNAME=${PACKNAMEPRE%-}
#echo MMMM $PACKNAME fi
## si no conseguimos una PACKNAME diferente la buscamos de nuevo if test x"$PACKNAME" = x"$PACKNOSYSTEM" ; then PACKVERSION=`echo $PACKNOSYSTEM | awk -F- '{print $NF}'` if test x"$PACKVERSION" = x"$PACKNOSYSTEM" ; then PACKVERSION='' fi PACKNAMEPRE=${PACKNOSYSTEM%${PACKVERSION}} # en dos pasos por si no tiene - PACKNAME=${PACKNAMEPRE%_} fi
#echo MMM $PACKSV if test x"$PACKSV" = x -a x"$PACKVERSION" != x ; then
PACKRV='' PACKSV=`echo $PACKVERSION| sed 's/_\(.*\)$//'` if test x"$PACKVERSION" = x"$PACKSV" ; then ### PACKSV='' # no better to have this as VERSION if not RV : else PACKRVPRE=${PACKVERSION%$PACKSV} PACKRV=${PACKRVPRE%$_} fi
fi
if test x"$PACKRVORDER" = x ; then PACKRVORDER=$PACKRV fi
SLASH=_ #if test x"$PACKSV" = x ; then # SLASH='' #fi SSLASH=_ #if test x"$PACKRVORDER" = x ; then # SSLASH='' #fi
PACKCOMPLETENORMALIZEDNAME="$PACKNAME$SLASH$PACKSV$SSLASH${PACKRVORDER}_${PACKSYSTEM}_$PACKEXT"
if test x"$COMPPACK" != x ; then `echo $COMPPACK| sed 's/\(.*\)_\(.*\)_\(.*\)_\(.*\)_\(.*\)$/export COMPPN\=\1 COMPPV\=\2 COMPPR\=\3 COMPPS\=\4 COMPPE\=\5'/`
#echo COMP $COMPPV - $COMPPR #echo PACK $PACKSV - $PACKRVORDER
order ${PACKSV}_$PACKRVORDER ${COMPPV}_$COMPPR
fi
if test x"$oneline" = x0 ; then
echo "PACKSTRING='$PACKSTRING'" echo "PACKDIR='$PACKDIR'" echo "PACKNAME='$PACKNAME'" echo "PACKVERSION='$PACKVERSION'" #version and release # no: si no hay version , version debe ser 0 echo "PACKEXT='$PACKEXT'" echo "PACKTYPE='$PACKTYPE'" echo "PACKCOMPLETENAME='$PACKNOSYSTEM'" # without extension
echo "PACKSYSTEM='$PACKSYSTEM'" echo "PACKSV='$PACKSV'" echo "PACKRV='$PACKRV'" echo "PACKERROR='$PACKERROR'" echo "PACKRVORDER='$PACKRVORDER'"
echo "PACKCOMPLETENORMALIZEDNAME='$PACKCOMPLETENORMALIZEDNAME'" # without extension echo "ORDER='$ORDER'" echo "COMPPN='$COMPPN'" echo "COMPPV='$COMPPV'" echo "COMPPR='$COMPPR'" echo "COMPPS='$COMPPS'" echo "COMPPE='$COMPPE'" else
#echo "$PACKNAME:$PACKSV:$PACKRVORDER:$PACKTYPE" if test x"$ORDER" != x ; then echo "$PACKCOMPLETENORMALIZEDNAME $ORDER" else echo "$PACKCOMPLETENORMALIZEDNAME" fi fi
#No me fije en otros sistemas, pero los paquetes versionados al estilo #gentoo tiene una dificultad cuando corresponden a releases, #prereleases, betas, etc. Salvo por eso, se ordenarían fácilmente con #ls -v , que compara versiones numéricas en los nombres de archivos. #Pero cuando las versiones son cosas como paquete-0.3.7-alpha1 y #paquete-0.3.7 allí falla.
#Lo que hice para resolver eso es previamente hacer una lista de los #archivos a ordenar, en la lista reemplazar esas cosas por números, #para que el ls los pueda ordenar, así:
#sed -r -e "s/(-[0-9.]+)_alpha/\1_000_/" \ # -e "s/(-[0-9.]+)_beta/\1_001_/" \ # -e "s/(-[0-9.]+)_pre/\1_002_/" \ # -e "s/(-[0-9.]+)_rc/\1_003_/" \ # -e "s/(-[0-9.]+)_p/\1_004_/") #On Sunday 07 September 2008 08:28:11 Jim Meyering wrote: #> IMHO, changing sort -V to produce more intuitively-correct results #> is the way to go. #> #> With ls -v, I'm willing to make the change as well, *assuming* #> no one produces a counterargument. #> #> The question is what ordering function to use. #> The more generally-useful the better. i.e., I hope #> it can be compatible with both the rpm and deb version sorters. #I made an investigation of existing functions which sort version
strings:
#strverscmp - from glibc (now with its equivalent in gnulib) #rpmvercmp - from rpm #ververcmp - from dpkg##
#The main problem of all these functions is dealing with suffixes. So I #modified them to drop the suffixes. So it is 6 implementations together (3 #original + 3 modified).
#Then I ran a few series of tests with all implementations. I think the #modified version of ververcmp (from dpkg) gives the best results - consider #attached results of an example - results.tar.bz2#
#So I propose a new function filevercmp (attachment filevercmp.c) as the #predicate function for new sort --version-sort.
#In the attachment is also the whole "testing framework" which I used to #compare these functions - strverscmp.tar.bz2 - follow the steps in README #inside archive. It is developed a bit quickly but I hope it could be #useful :-)#
#Kamil # http://www.opensubscriber.com/message/[email protected]/10201323.html
#http://old.nabble.com/Possible-bug-in-sort--V-td26804985.html
#> cat a | /build/toolchain/lin32/coreutils-8.2/bin/sort -V #> kernel-2.6.18-164.2.1.el5.x86_64.rpm #> kernel-2.6.18-164.6.1.el5.x86_64.rpm #> kernel-2.6.18-164.el5.x86_64.rpm #> #> The result should be #> kernel-2.6.18-164.el5.x86_64.rpm #> kernel-2.6.18-164.2.1.el5.x86_64.rpm #> kernel-2.6.18-164.6.1.el5.x86_64.rpm #> #> Is it a bug is sort -V?
#I agree the behavior is pretty awkward. Nevertheless the behavior #is well documented:
# http://www.gnu.org/software/coreutils/manual/html_node/Details-about-version...
#The "bug" is triggered by the underscore in "x86_64". It's not treated as file #suffix in that case. However it works fairly well when you replace "x86_64" by #"i686". #From 3069d50b766a2db8b86406904b7327e5de5e315f Mon Sep 17 00:00:00 2001 #From: =?utf-8?q?P=C3=A1draig=20Brady?= <P@...> #Date: Thu, 17 Dec 2009 10:48:54 +0000 #Subject: [PATCH] doc: enhance and reference info about version comparison
#* doc/coreutils.texi (sort invocation): Reference the additional #info about filevercmp rather than the unused strverscmp. #(Details about version sort): Add some examples that are not #handled well by fileversmp. #* src/ls.c: Change a comment referencing the now unused strverscmp. #--- # doc/coreutils.texi | 33 ++++++++++++++++++++++++--------- # src/ls.c | 2 +- # 2 files changed, 25 insertions(+), 10 deletions(-)
#-This functionality is implemented using gnulib's @code{filevercmp} function. #-One result of that implementation decision is that @samp{ls -v} #-and @samp{sort -V} do not use the locale category, @env{LC_COLLATE}, #-which means non-numeric prefixes are sorted as if @env{LC_COLLATE} were set #-to @samp{C}. #+This functionality is implemented using gnulib's @code{filevercmp} function, #+which has some caveats worth noting. #+ #+@itemize @bullet #+@item @env{LC_COLLATE} is ignored, which means @samp{ls -v} and @samp{sort -V} #+will sort non-numeric prefixes as if the @env{LC_COLLATE} locale category #+was set to @samp{C}. #+@item Some suffixes will not be matched by the regular #+expression mentioned above. Consequently these examples may #+not sort as you expect: #+ #+@example #+abc-1.2.3.4.7z #+abc-1.2.3.7z #+@end example #+ #+@example #+abc-1.2.3.4.x86_64.rpm #+abc-1.2.3.x86_64.rpm #+@end example #+@end itemize
# @node General output formatting # @subsection General output formatting #diff --git a/src/ls.c b/src/ls.c #index aeaa584..5c7f6aa 100644 #--- a/src/ls.c #+++ b/src/ls.c #@@ -3272,7 +3272,7 @@ DEFINE_SORT_FUNCTIONS (extension, cmp_extension) # All the other sort options, in fact, need xstrcoll and strcmp variants, # because they all use a string comparison (either as the primary or secondary # sort key), and xstrcoll has the ability to do a longjmp if strcoll fails for #- locale reasons. Last, strverscmp is ALWAYS available in coreutils, #+ locale reasons. Last, filevercmp is ALWAYS available in coreutils, # thanks to the gnulib library. */ # static inline int # cmp_version (struct fileinfo const *a, struct fileinfo const *b) #-- #1.6.2.5
#como compilar a partir de un ebuild, de un spec y de un control #category no esta en ebuild, si en ubuild
#http://www.redhat.com/archives/rpm-list/2003-January/msg00006.html
#RES1=`echo ".$CADENA1" |sed -e 's/[^0-9a-zA-Z]\+/./g'| sed -e 's/\([a-zA-Z]\+\)/\1:./g' | sed -e 's/\([0-9]\+\)/\1;./g' | sed -e 's/.\([0]\+\)/.\1:./g'` #RES2=`echo ".$CADENA2" |sed -e 's/[^0-9a-zA-Z]\+/./g'| sed -e 's/\([a-zA-Z]\+\)/\1:./g' | sed -e 's/\([0-9]\+\)/\1;./g' | sed -e 's/.\([0]\+\)/.\1:./g'` #echo $RES1 #echo $RES2
#FIN=0 ##IFS=.
#RES1=${RES1#.} #RES2=${RES2#.} #coma=`echo "$RES1" |sed -e 's/\..\+$//'` #RES1=${RES1#$coma}
#comb=`echo "$RES2" |sed -e 's/\..\+$//'` #RES2=${RES2#$comb}
#echo $coma $comb - $RES1 $RES2 #if test x"$coma" != x"$comb" ; then # echo SON DISTINTOS $coma $comb # FIN=1 #fi#
#if test x"$RES1" = x -o x"$RES2" = x ; then # echo junto termino: $coma - $comb # FIN=1 #fi #bbb=s # # if test x"$item" != x; then # echo $item
# fi
#done
El 1 de julio de 2010 17:26, Pablo Manuel Rizzo <[email protected]> escribió:
2010/7/1 Diego Saravia <[email protected]>
hay que integrarlo con el programa que deduce las versiones, para eso
lo
escribi
no es mi idea generar un nuevo sort, con el tiempo el sort -V seguramente andara
solamente poder saber si un paquete es posterior o anterior a lo que ya esta instalado.
supongo que el programa que dado un paquete indica su nombre y versiones, cuando le digas cual es la versin instalada de ese mismo paquete te dira adicionalmente si es anterior o posterior
esa es mi idea,
se te ocurre algo mejor
Ah, está bien, había entendido otra cosa.
-- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
te mando por privado por los attachs lo que me pediste 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 las dos columnas son el nombre canonico, un invento mio, que seria como el nombre universal del paquete y el nombre original de ututo/gentoo ordenada: baselayout_2.0.1_5.0__tbz2 => baselayout-2.0.1.tbz2 baselayout_2.0.0_5.0__tbz2 => baselayout-2.0.0.tbz2 baselayout_2.0.0_1.3.1__tbz2 => baselayout-2.0.0_alpha3-r1.tbz2 baselayout_1.13.0_1.12.0__tbz2 => baselayout-1.13.0_alpha12.tbz2 baselayout_1.13.0_1.10.2__tbz2 => baselayout-1.13.0_alpha10-r2.tbz2 baselayout_1.13.0_1.7.1__tbz2 => baselayout-1.13.0_alpha7-r1.tbz2 baselayout_1.13.0_1.5.1__tbz2 => baselayout-1.13.0_alpha5-r1.tbz2 baselayout_1.13.0_1.3.0__tbz2 => baselayout-1.13.0_alpha3.tbz2 baselayout_1.13.0_1.1.1__tbz2 => baselayout-1.13.0_alpha1-r1.tbz2 baselayout_1.12.12_5.0__tbz2 => baselayout-1.12.12.tbz2 baselayout_1.12.11.1_5.0__tbz2 => baselayout-1.12.11.1.tbz2 baselayout_1.12.10_5.5__tbz2 => baselayout-1.12.10-r5.tbz2 baselayout_1.12.10_5.4__tbz2 => baselayout-1.12.10-r4.tbz2 baselayout_1.12.5_5.0__tbz2 => baselayout-1.12.5.tbz2 baselayout_1.12.4_5.7__tbz2 => baselayout-1.12.4-r7.tbz2 baselayout_1.12.4_5.3__tbz2 => baselayout-1.12.4-r3.tbz2 te lo acomode un poco al programa para que te sea mas significativo 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 2010/7/5 Diego Saravia <[email protected]>
bueno, en un rato te lo paso
2010/7/4 Pablo Manuel Rizzo <[email protected]>
Me los pasas como adjuntos en un correo directo? porque pegando de acá
me quedó con errores
2010/7/3 Diego Saravia <[email protected]>:
dado que nos fuimos del mundial, te mando pablo un par de programas
el primero es uno en perl que llama al segundo para ordenar un archivo que contiene una lista de archivos de ututo
es un ls *.tbz2 efectuado en un /ututo/i686, o sea un repositorio de paquetes
al segundo si le das un argumento lo "canoniza"
o sea lo transforma en un nombre facilmente separable en sus variables y ordenable
si le das dos argumentos, un paquete y un canonico los ordena, o sea da 1 si a>b, 0 si son iguales y -1 si a<b
espero te sriva
#!/usr/bin/perl
sub first{ #my ($data2,$data1)=@_; $data1=$a; $data2=$b; my $pack=`/home/dsa/dsatex/ubuild/scripts/upackname -o ${data2}.can $data1`; #print "/home/dsa/dsatex/ubuild/scripts/upackname -o ${data2}.can $data1"; #print "pack:$pack"; my ($normresp,$order)=split(/ /,$pack); #print "O:$order"; return $order+0; } use Data::Dumper; open(FILE, "/home/dsa/ubtest/listapack"); while(<FILE>){
$count++; if ($count>10){last} chomp $_; $pack=`/home/dsa/dsatex/ubuild/scripts/upackname -o $_`; chomp $pack; ($nombre,$version,$release,$system,$ext)=split(/_/,$pack); $datos=[$nombre,$version,$release,$system,$ext,$pack,$_]; print "Pro: $nombre,$version,$release,$system,$ext\n"; $dat->{$nombre}=[@{$dat->{$nombre}},$datos]; $lista->{$nombre}=[@{$lista->{$nombre}},$pack]; } close(FILE);
#print"hh", Dumper $dat;
foreach my $nombre (keys %$dat){ print $nombre,"\n"; $datacomp=$dat->{$nombre}->[0]->[5]; print " ingresa: @{$lista->{$nombre}} \n"; @ordenada=sort first @{$lista->{$nombre}}; print "ordenada: @ordenada \n"; foreach my $data (@{$dat->{$nombre}}){
($n,$v,$r,$s,$e,$p,$o)=@$data;
$pack2=`/home/dsa/dsatex/ubuild/scripts/upackname -o $o $datacomp`; #print "BBBB$pack2\n"; ($normresp,$order)=split(/ /,$pack2); ($nc,$vc,$rc,$sc,$ec)=split(/_/,$datacomp); print " $v $r $s $e $p $o \n"; print " $vc $rc $sc $ec - $normresp - $datacomp : $order \n";
#$normresp - $datacomp - $order\n"; }
}
######################################
#!/bin/bash
version(){ cat <<EOF upackname $PROG_VERSION Copyright (C) 2010 Diego Saravia <[email protected]> License: $PROG_LICENCE <http://gnu.org/licenses/gpl.html> EOF }
help(){ cat <<EOF upackname PACKAGE
Splits package string in name, version and extension
Prints PACKSTRING: Complete file name PACKDIR: Directories preceding file name PACKTYPE: NOEXT|UNKNOWNPKGEXT|BINPKGEXT|LISTEXT|METAEXT PACKEXT: Extension (rpm, deb, ebuild, tbz2, etc) PACKSYSTEM: i686, x86_64, hurd-i386, etc PACKNAME: Packname PACKVERSION: Complete version PACKSV: Source Version PACKRV: Release Version PACKRVORDER: Release Version in Gentoo transformed for comparisson.
PACKCOMPLETENAME: without extension PACKCOMPLETENORMALIZEDNAME: without extension in a normalized fashion EOF }
usage(){ cat <<EOF Usage: upackname PACKAGE EOF }
extsep(){ for ext in $2 ; do rext=`echo $ext | sed 's|\.|\\\.|' ` first=`echo $1 | sed "s/\.$rext\$//"` if test "x$first" != "x$1"; then PACKEXT=$ext PACKTYPE=$3 PACKNOEXT=$first break fi done }
PROG_VERSION=0.1 PROG_LICENCE="AGPLv3+: GNU AGPL version 3 or later" oneline=0 while test $# -gt 0 ; do case "$1" in -h|--help) help ;; -v|-V|--version) version ;; -u|--usage) usage ;; -o|--oneline) oneline=1 ;; *) FILES=$@ break ;; esac shift done
if test x"$1" = x ; then usage exit fi
anachar(){ local CADENA=$1 local char=$2
estext=`expr "$char" : '\([a-zA-Z0\.]\)'` if test x"$estext" != x ; then #echo CHAR $char ES=CHAR saca=$char nume= # no es necesario else nume=`expr "$CADENA" : '\([0-9]\+\)'` if test x"$nume" = x ; then saca=$char # lo pongo como char #ES=OTHER ES=CHAR #echo CHAR OTHER $char # es al vicio, solo preguntar por numeros #echo SEPARA $char #char='' else #echo NUM $nume ES=NUMB saca=$nume fi fi
}
# ver caracter ~ en debian order(){ # returns first as compared to second CADENA1=$1 CADENA2=$2 #echo 1: $CADENA1 - 2: $CADENA2
while true ; do char1=${CADENA1:0:1} char2=${CADENA2:0:1} #echo CHAR1: $char1 - CHAR2: $char2 if test x"$char1" = x -a x"$char2" = x ; then #echo SON IGUALES ORDER=0 break elif test x"$char1" = x -a x"$char2" != x ; then #echo CADENA1 PRIMERO T ORDER=-1 break elif test x"$char1" != x -a x"$char2" = x ; then #echo CADENA2 PRIMERO T ORDER=1 break fi
anachar $CADENA1 $char1 CADENA1=${CADENA1#$saca} ES1=$ES nume1=$nume
anachar $CADENA2 $char2 CADENA2=${CADENA2#$saca} ES2=$ES nume2=$nume #RES="$ES1 - $ES2 - $char1 - $char2 - $nume1 - $nume2"
if test x"$ES1" = xNUMB -a x"$ES2" = xNUMB ; then if test x"$nume1" = x"$nume2" ; then #echo continue IGUALES NUMB: $RES continue elif test $nume1 -gt $nume2; then #echo "CADENA2 PRI 2 : $RES" ORDER=1 else #echo "CADENA1 PRI 2 : $RES" ORDER=-1 fi break
elif test x"$ES1" = xCHAR -a x"$ES2" = xCHAR ; then if test x"$char1" = x"$char2" ; then #echo continue IGUALES CHAR: $RES continue elif test $char1 > $char2; then #echo "CADENA1 PRI 3 : $RES" ORDER=-1 else #echo "CADENA2 PRI 3 : $RES" ORDER=1 fi break
elif test x"$ES1" = xCHAR -a x"$ES2" = xNUMB ; then if test x"$char1" = x0 ; then #echo "CADENA1 PRI 4 0 : $RES" ORDER=-1 break else #echo "CADENA2 PRI 4 : $RES" ORDER=1 fi break elif test x"$ES1" = xNUMB -a x"$ES2" = xCHAR ; then if test x"$char2" = x0 ; then #echo "CADENA2 PRI 4 0 : $RES" ORDER=1 else #echo "CADENA1 PRI 4 : $RES" ORDER=-1 fi break fi
#echo lll $char - $nume - $EST - $estext - $CADENA1 done }
#order apo1002300.001.45g.ui67 apo1002300.001.45g.ui68b
#echo OOO $ORDER #exit
PACK=$1 COMPPACK=$2
#echo NNN $1 JJJ $2 KKK #PACKSTRING=`basename $PACK` PACKSTRING=`echo $PACK | awk -F/ '{print $NF}'` PACKDIRPRE=${PACK%${PACKSTRING}} # en dos pasos por si no tiene /
if test x"$PACKDIRPRE" = x/ ; then PACKDIR=/ else PACKDIR=${PACKDIRPRE%/} fi
# 4 kind: file list (lf), metapacks (ebuild ubuild suma), binary packs, source packs METAEXT="ebuild ubuild summa" LISTEXT="lf can" # esto no es asi, cambiar
#KNOWN: BINPKGEXT="tgz tbz2 deb rpm" #SEE: PKGEXT="tar.gz tgz tar.bz tar.bz2 tbz tbz2 ZIP sip jar gz Z z bz2 bz 7Z 7z RAR rar LHa LHA lha lzh a deb lzma xz rpm"
PACKTYPE=0 # EXIST EXTENSION PACKEXT="" # packtype PACKNAMEVERS=$PACKSTRING
########################################3 test sobre archivos reales, ver que pasa si no se quiere esto # o sea proveer
# basename?
extsep $PACKSTRING "$BINPKGEXT" BINPKGEXT
if test x"$PACKEXT" = x ; then extsep $PACKSTRING "$LISTEXT" LISTEXT fi if test x"$PACKEXT" = x ; then extsep $PACKSTRING "$METAEXT" METAEXT fi
if test x"$PACKEXT" = x ; then PACKEXT=`echo $PACKSTRING | awk -F. '{print $NF}'` PACKNOEXT=${PACKSTRING%.${PACKEXT}} PACKTYPE=UNKNOWNPKGEXT fi if test x"$PACKEXT" = x ; then PACKNOEXT=$PACKSTRING PACKTYPE=NOEXT fi
#echo mmmmmmmmmmmmmmm $PACKEXT PACKERROR=''
case $PACKEXT in can) `echo $PACKNOEXT| sed 's/\(.*\)_\(.*\)_\(.*\)_\(.*\)_\(.*\)$/export PACKNAME\=\1 PACKSV\=\2 PACKRVORDER\=\3 PACKSYSTEM\=\4 PACKEXT\=\5'/`
#echo CAN $PACKNAME $PACKSV $PACKRVORDER $PACKEXT ;; ebuild|ubuild|tbz2) # en build info o ebuild no parece haber info sobre nombre o version
#http://distfiles.gentoo.org/distfiles/pms-3.pdf
`echo $PACKNOEXT | sed -e
PACKNAME=\1 PACKVERSION=\2 PACKSV=\3 PACKRVPRE=\5 PACKGENTOOPRE=\6 PACKGENTOORE=\8 PACKGENTOORENUM=\9/'`
if test x"$PACKNAME" = x ; then echo ERROR, NO ES UN ARCHIVO GENTOO PACKERROR="No es Gentoo" fi
if test x"$PACKGENTOOPRE" = x ; then #PACKRV=${PACKRVPRE#-} # no porque a veces debbiera agregar _ y otras
's/\(.*\)-\(\([[:digit:]]\+\(\.[[:digit:]]\+\)*\+[a-z]\?\)\(\(_\(alpha\|beta\|pre\|rc\|p\)[[:digit:]]*\)*\(-r\([[:digit:]]\+\)\)\?\)\)$/export -
PACKSRORDER=5 else #PACKRV=$PACKRVPRE PACKSRORDERPRE=`echo $PACKGENTOOPRE| sed -r -e "s/_alpha/1./" \ -e "s/_beta/2./" \ -e "s/_pre/3./" \ -e "s/_rc/4./" \ -e "s/_p/6./" `
PACKSRORDER=`echo $PACKSRORDERPRE| sed -e 's/\.$//' `
fi
PACKRV=$PACKRVPRE
if test x"$PACKGENTOORE" = x ; then PACKRVORDER=$PACKSRORDER.0 else PACKRVORDER=$PACKSRORDER.$PACKGENTOORENUM fi
#echo bbbbbbbbbbbbbbb $PACKGENTOOPRE $PACKGENTOORE - $PACKGENTOORENUM - $PACKSRORDER - $PACKSRORDERPRE
#PACKNAME=sed -e
's/(.*\)\(-[[:digit:]]\+\(\.[[:digit:]]\+\)*\+[a-z]\?\(_\(alpha\|beta\|pre\|rc\|p\)[[:digit:]]*\)*\(-r[[:digit:]]\+\)\?\)$//'`
#PACKVERSION=`echo $PACK|cut -d- -f2-` #if test x"$PACKVERSION" = x"$PACKNAME" ; then # esto es raro, # PACKVERSION='' # # que el cut ponga el primer campo si no hay segundo ver # #PACKVERSION=0 # fi
#sed 's/-[0-9]\{1,\}.*$//' ;;
#Ebuild file names consist of four logical subsections:
#pkg-ver{_suf{#}}{-r#}.ebuild
#Note: The brackets ({}) delineate optional fields and do not appear in
the
literal package name. # represents any non-zero positive integer.
#The first subsection, pkg, is the package name, which should only contain lowercase letters, the digits 0-9, and any number of single hyphen (-), underscore (_) or plus (+) characters. Examples: util-linux, sysklogd and gtk+. We have some packages in Portage that don't follow these rules, but your packages should.
#The second subsection, ver, is the version of the package, which should normally be same as the version on the main source tarball. The version is normally made up of two or three (or more) numbers separated by periods, such as 1.2 or 4.5.2, and may have a single letter immediately following the last digit; e.g., 1.4b or 2.6h. The package version is joined to the package name with a hyphen. For example: foo-1.0, bar-2.4.6.
#Important: If you're thinking of using a trailing letter in your version string, note that the trailing letter should not be used to signify alpha or beta status for the package, since alphas and betas are prereleases and letter revisions are newer versions. This is an important distinction because Portage uses an ebuild's version number to determine if it is newer or older than other packages with the same category and name. It's very important that version numbers faithfully represent the version of the package so that Portage properly performs its dependency checking duties.
#The third subsection, {_suf{#}}, is optional and may contain one of these predefined suffixes, listed in least-recent to most-recent order: #Suffix Meaning #_alpha Alpha release #_beta Beta release #_pre Prerelease #_rc Release candidate #(none) Normal release #_p Patch level (normally accompanied by trailing integer)
#Any of these suffixes may be immediately followed by a non-zero positive integer, e.g., linux-2.4.0_pre10. Assuming identical version parts, the suffixes are ordered as follows (lower means older): _alpha < _beta < _pre < _rc < (no suffix) < _p.
#When comparing identical suffixes with trailing integers, the one with the larger integer will be considered most recent. Example: foo-1.0_alpha4 is more recent than foo-1.0_alpha3.
#The fourth subsection of the package name is the Gentoo Linux-specific revision number ({-r#}). This subsection, like the suffix, is also optional. # is a non-zero positive integer; e.g., package-4.5.3-r3.
#This revision number is independent of the version of the source tarball and is used to inform people that a new and improved Gentoo Linux revision of a particular package is available. Initial releases of ebuilds must have no revision number; e.g., package-4.5.3 and are considered by Portage to have a revision number of zero. This means that counting goes as follows: 1.0 (initial version), 1.0-r1, 1.0-r2, etc.
#If you make non-trivial improvements to an existing ebuild file, you should copy the ebuild file to a new file with the revision number incremented by 1. Remember to always make mentions of your changes in the ChangeLog when you bump a revision and in your CVS commit message; not doing so is against policy.
#... and I suppose that we actually have a fifth section of the ebuild name as well -- the .ebuild extension itself.
rpm) # spec si hay nombre, version y release, verificar que esto funcione bien al abrir cada paquete
# PACKNAME=`echo $PACKNOEXT |sed 's/-[^-]*-[^-]*$//'` PACKNAME=`echo $PACKNOEXT |sed 's/-[^-]*-.*$//'` PACKVERSIONPRE=${PACKNOEXT#${PACKNAME}} # primero el nombre por si es todo PACKVERSIONSYS=${PACKVERSIONPRE#-}
if test x"$PACKNAME" = x ; then echo ERROR, NO ES UN ARCHIVO RPM PACKERROR="No es RPM" fi
PACKVERSION=`echo $PACKVERSIONSYS | sed
'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\)$//'`
PACKSYSTEMPRE=${PACKVERSIONSYS#${PACKVERSION}} # primero el nombre
por
si es todo PACKSYSTEM=${PACKSYSTEMPRE#.}
PACKNOSYSTEM=$PACKNAME-$PACKVERSION
`echo $PACKVERSION| sed 's/\([^-]*\)-\(.*\)$/export PACKSV\=\1 PACKRV\=\2/'`
# echo KKKK $PACKSV KKKKK $PACKSYSTEM KKKKKK $PACKRV
# `echo $PACKNOEXT | sed -e
's/\([a-zA-Z0-9_\-\+]*\)-\([a-zA-Z0-9_\.]*\)-\([a-zA-Z0-9_\.]*\)\.\(noarch\|src\|i386\|i686\|athlon\|ppc\|x86_64\)$/export
PACKNAME\="\1" PACKVERSION\="\2-\3.\4" PACKOV\="\2" PACKRV\="\3" PACKARCH\="\4"/'`
#older systems do not have arch part, see # my $name = $1; # my $version = $2; # my $release = $3; # my $arch = $4;
#$ rpm -qp --qf '%{NAME}' some.rpm
#rpm -qa|sed 's/-[^-]*-[^-]*$//'
#RPM <name>-<version>-<release>.<architecture>.rpm nano-0.98-2.i386.rpm libgnomeuimm-2.0-2.0.0-3.src.rpm
#A package label is contained within the file and does not necessarily #need to match the name of the file.
#Additionally, libraries are distributed in two separate packages for #each version. One contains the precompiled code, while the second one #contains the development files such as headers, static library files, #etc. for the library in question. Those packages have "-devel" appended to their name field. Users need to carefully check so that #the version of the development package matches that of the binary #package, otherwise the library may not work very well. ;;
deb)
# en control parece haber info sobre el nombre, no sobre las versiones, usar para verificar
#DEB <foo>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb
PACKNAME=`echo $PACKNOEXT | awk -F_ '{print $1}'` PACKVERSIONSYSPRE=${PACKNOEXT#${PACKNAME}} # en dos pasos por si el nombre debian esta mal y no usa _ PACKVERSIONSYS=${PACKVERSIONSYSPRE#_}
if test x"$PACKNAME" = x ; then echo ERROR, NO ES UN ARCHIVO DEB PACKERROR="No es deb" fi
#echo MMMMM $PACKVERSION #igual que el rpm con _ en vez de . PACKVERSION=`echo $PACKVERSIONSYS | sed
'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\)$//'`
if test x"$PACKVERSION" = x ; then echo ERROR, NO ES UN ARCHIVO DEB PACKERROR="No es deb" fi
PACKNOSYSTEM=$PACKNAME_$PACKVERSION echo MMMMM $PACKVERSION - $PACKNOSYSTEM PACKSYSTEMPRE=${PACKVERSIONSYS#${PACKVERSION}} # primero el nombre
por
si es todo PACKSYSTEM=${PACKSYSTEMPRE#_}
`echo $PACKVERSION| sed 's/\([^-]*\)-\(.*\)$/export PACKSV\=\1 PACKRV\=\2/'`
if test x"$PACKSV" = x ; then echo ERROR, NO ES UN ARCHIVO DEB PACKERROR="No es deb" fi
# echo KKKK $PACKSV KKKKK $PACKSYSTEM KKKKKK $PACKRV KKKK $PACKNOSYSTEM
#\([a-z][a-z0-9\+\-\.]+\)_\([a-zA-Z0-9_\.]*\)-\([0-9a-zA-Z\+\.\~]+\)_\(noarch\|src\|noarch\|i386\|i686\|athlon\|ppc\|x86_64\)
#The name of the package itself (not the filename, just the name of
the
package) can contain lowercase letters, numbers, and the "-" and "+" characters. #debian_revision
#This part of the version number specifies the version of the Debian package based on the upstream version. #It may contain only alphanumerics and the characters + . ~ (plus, full stop, tilde) and is compared in the same way as the upstream_version is. #It is optional; if it isn't present then the upstream_version may not contain a hyphen. #This format represents the case where a piece of software was written specifically to be turned into a Debian package, #and so there is only one "debianisation" of it and therefore no revision indication is required. #It is conventional to restart the debian_revision at 1 each time the upstream_version is increased. #The package management system will break the version number apart at the last hyphen in the string #(if there is one) to determine the upstream_version and debian_revision. The absence of a debian_revision is equivalent to a debian_revision of 0
#The VVV component is the version number specified by the upstream #developer. There are no standards in place here, so the version number #may have formats as different as "19990513" and "1.3.8pre1".
#The RRR component is the Debian revision number, and is specified by #the Debian developer (or an individual user if he chooses to build the #package himself). This number corresponds to the revision level of the #Debian package, thus, a new revision level usually signifies changes #in the Debian Makefile (debian/rules), the Debian control file #(debian/control), the installation or removal scripts (debian/p*), or #in the configuration files used with the package.
#The AAA component identifies the processor for which the package was #built. This is commonly i386, which refers to chips compatible to #Intel's 386 or later versions. For other possibilities review Debian's #FTP directory structure at What are all those directories at the #Debian FTP archives?, Section 6.7. For details, see the description of #"Debian architecture" in the manual page dpkg-architecture(1).
#
#i386 ia64 alpha amd64 armeb arm hppa m32r m68k mips mipsel powerpc ppc64 s390 s390x sh3 sh3eb sh4 sh4eb sparc darwin-i386 darwin-ia64 darwin-alpha darwin-amd64 darwin-armeb darwin-arm darwin-hppa darwin-m32r darwin-m68k darwin-mips darwin-mipsel darwin-powerpc darwin-ppc64 darwin-s390 darwin-s390x darwin-sh3 darwin-sh3eb darwin-sh4 darwin-sh4eb darwin-sparc freebsd-i386 freebsd-ia64 freebsd-alpha freebsd-amd64 freebsd-armeb freebsd-arm freebsd-hppa freebsd-m32r freebsd-m68k freebsd-mips freebsd-mipsel freebsd-powerpc freebsd-ppc64 freebsd-s390 freebsd-s390x freebsd-sh3 freebsd-sh3eb freebsd-sh4 freebsd-sh4eb freebsd-sparc kfreebsd-i386 kfreebsd-ia64 kfreebsd-alpha kfreebsd-amd64 kfreebsd-armeb kfreebsd-arm kfreebsd-hppa kfreebsd-m32r kfreebsd-m68k kfreebsd-mips kfreebsd-mipsel kfreebsd-powerpc kfreebsd-ppc64 kfreebsd-s390 kfreebsd-s390x kfreebsd-sh3 kfreebsd-sh3eb kfreebsd-sh4 kfreebsd-sh4eb kfreebsd-sparc knetbsd-i386 knetbsd-ia64 knetbsd-alpha knetbsd-amd64 knetbsd-armeb knetbsd-arm knetbsd-hppa knetbsd-m32r knetbsd-m68k knetbsd-mips knetbsd-mipsel knetbsd-powerpc knetbsd-ppc64 knetbsd-s390 knetbsd-s390x knetbsd-sh3 knetbsd-sh3eb knetbsd-sh4 knetbsd-sh4eb knetbsd-sparc netbsd-i386 netbsd-ia64 netbsd-alpha netbsd-amd64 netbsd-armeb netbsd-arm netbsd-hppa netbsd-m32r netbsd-m68k netbsd-mips netbsd-mipsel netbsd-powerpc netbsd-ppc64 netbsd-s390 netbsd-s390x netbsd-sh3 netbsd-sh3eb netbsd-sh4 netbsd-sh4eb netbsd-sparc openbsd-i386 openbsd-ia64 openbsd-alpha openbsd-amd64 openbsd-armeb openbsd-arm openbsd-hppa openbsd-m32r openbsd-m68k openbsd-mips openbsd-mipsel openbsd-powerpc openbsd-ppc64 openbsd-s390 openbsd-s390x openbsd-sh3 openbsd-sh3eb openbsd-sh4 openbsd-sh4eb openbsd-sparc hurd-i386 hurd-ia64 hurd-alpha hurd-amd64 hurd-armeb hurd-arm hurd-hppa hurd-m32r hurd-m68k hurd-mips hurd-mipsel hurd-powerpc hurd-ppc64 hurd-s390 hurd-s390x hurd-sh3 hurd-sh3eb hurd-sh4 hurd-sh4eb hurd-sparc ;;
;;
esac
#\(\(darwin\|freebsd\|netbsd\|kfreebsd\|knetbsd\|openbsd\|hurd\|gnu\|linux\)-\)\?
### aqui seguro tenemos PACKNOEXT
## si no tenemos PACKNOSYSTEM lo buscamos if test x"$PACKSYSTEM" = x ; then PACKNOSYSTEM=`echo $PACKNOEXT | sed
'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\)$//'`
# if apears something identifing origin as ubuntu, ututo, pacman etc
must be
extracted here
#echo MMMM $PACKNAME - $PACKNOSYSTEM -$PACKNOEXT PACKSYSTEMPRE=${PACKNOEXT#${PACKNOSYSTEM}} # primero el nombre por si es todo PACKSYSTEMPRE3=${PACKSYSTEMPRE#-} PACKSYSTEMPRE2=${PACKSYSTEMPRE3#_} PACKSYSTEM=${PACKSYSTEMPRE2#.}
fi
if test x"$PACKNOSYSTEM" = x ; then PACKNOSYSTEM=$PACKNOEXT fi
# aqui seguro tenemos PACKNOSYSTEM # si no tenemos PACKVERSION (PACKNONAME) lo buscamos
#echo MMMM $PACKNAME - $PACKNOSYSTEM -$PACKNOEXT
if test x"$PACKNAME" = x ; then PACKVERSION=`echo $PACKNOSYSTEM | awk -F- '{print $NF}'` if test x"$PACKVERSION" = x"$PACKNOSYSTEM" ; then PACKVERSION='' fi PACKNAMEPRE=${PACKNOSYSTEM%${PACKVERSION}} # en dos pasos por si no tiene - PACKNAME=${PACKNAMEPRE%-}
#echo MMMM $PACKNAME fi
## si no conseguimos una PACKNAME diferente la buscamos de nuevo if test x"$PACKNAME" = x"$PACKNOSYSTEM" ; then PACKVERSION=`echo $PACKNOSYSTEM | awk -F- '{print $NF}'` if test x"$PACKVERSION" = x"$PACKNOSYSTEM" ; then PACKVERSION='' fi PACKNAMEPRE=${PACKNOSYSTEM%${PACKVERSION}} # en dos pasos por si no tiene - PACKNAME=${PACKNAMEPRE%_} fi
#echo MMM $PACKSV if test x"$PACKSV" = x -a x"$PACKVERSION" != x ; then
PACKRV='' PACKSV=`echo $PACKVERSION| sed 's/_\(.*\)$//'` if test x"$PACKVERSION" = x"$PACKSV" ; then ### PACKSV='' # no better to have this as VERSION if not RV : else PACKRVPRE=${PACKVERSION%$PACKSV} PACKRV=${PACKRVPRE%$_} fi
fi
if test x"$PACKRVORDER" = x ; then PACKRVORDER=$PACKRV fi
SLASH=_ #if test x"$PACKSV" = x ; then # SLASH='' #fi SSLASH=_ #if test x"$PACKRVORDER" = x ; then # SSLASH='' #fi
PACKCOMPLETENORMALIZEDNAME="$PACKNAME$SLASH$PACKSV$SSLASH${PACKRVORDER}_${PACKSYSTEM}_$PACKEXT"
if test x"$COMPPACK" != x ; then `echo $COMPPACK| sed 's/\(.*\)_\(.*\)_\(.*\)_\(.*\)_\(.*\)$/export COMPPN\=\1 COMPPV\=\2 COMPPR\=\3 COMPPS\=\4 COMPPE\=\5'/`
#echo COMP $COMPPV - $COMPPR #echo PACK $PACKSV - $PACKRVORDER
order ${PACKSV}_$PACKRVORDER ${COMPPV}_$COMPPR
fi
if test x"$oneline" = x0 ; then
echo "PACKSTRING='$PACKSTRING'" echo "PACKDIR='$PACKDIR'" echo "PACKNAME='$PACKNAME'" echo "PACKVERSION='$PACKVERSION'" #version and release # no: si no hay version , version debe ser 0 echo "PACKEXT='$PACKEXT'" echo "PACKTYPE='$PACKTYPE'" echo "PACKCOMPLETENAME='$PACKNOSYSTEM'" # without extension
echo "PACKSYSTEM='$PACKSYSTEM'" echo "PACKSV='$PACKSV'" echo "PACKRV='$PACKRV'" echo "PACKERROR='$PACKERROR'" echo "PACKRVORDER='$PACKRVORDER'"
echo "PACKCOMPLETENORMALIZEDNAME='$PACKCOMPLETENORMALIZEDNAME'" #
without
extension echo "ORDER='$ORDER'" echo "COMPPN='$COMPPN'" echo "COMPPV='$COMPPV'" echo "COMPPR='$COMPPR'" echo "COMPPS='$COMPPS'" echo "COMPPE='$COMPPE'" else
#echo "$PACKNAME:$PACKSV:$PACKRVORDER:$PACKTYPE" if test x"$ORDER" != x ; then echo "$PACKCOMPLETENORMALIZEDNAME $ORDER" else echo "$PACKCOMPLETENORMALIZEDNAME" fi fi
#No me fije en otros sistemas, pero los paquetes versionados al estilo #gentoo tiene una dificultad cuando corresponden a releases, #prereleases, betas, etc. Salvo por eso, se ordenarían fácilmente con #ls -v , que compara versiones numéricas en los nombres de archivos. #Pero cuando las versiones son cosas como paquete-0.3.7-alpha1 y #paquete-0.3.7 allí falla.
#Lo que hice para resolver eso es previamente hacer una lista de los #archivos a ordenar, en la lista reemplazar esas cosas por números, #para que el ls los pueda ordenar, así:
#sed -r -e "s/(-[0-9.]+)_alpha/\1_000_/" \ # -e "s/(-[0-9.]+)_beta/\1_001_/" \ # -e "s/(-[0-9.]+)_pre/\1_002_/" \ # -e "s/(-[0-9.]+)_rc/\1_003_/" \ # -e "s/(-[0-9.]+)_p/\1_004_/") #On Sunday 07 September 2008 08:28:11 Jim Meyering wrote: #> IMHO, changing sort -V to produce more intuitively-correct results #> is the way to go. #> #> With ls -v, I'm willing to make the change as well, *assuming* #> no one produces a counterargument. #> #> The question is what ordering function to use. #> The more generally-useful the better. i.e., I hope #> it can be compatible with both the rpm and deb version sorters. #I made an investigation of existing functions which sort version strings: #strverscmp - from glibc (now with its equivalent in gnulib) #rpmvercmp - from rpm #ververcmp - from dpkg##
#The main problem of all these functions is dealing with suffixes. So I #modified them to drop the suffixes. So it is 6 implementations together (3 #original + 3 modified).
#Then I ran a few series of tests with all implementations. I think the #modified version of ververcmp (from dpkg) gives the best results - consider #attached results of an example - results.tar.bz2#
#So I propose a new function filevercmp (attachment filevercmp.c) as the #predicate function for new sort --version-sort.
#In the attachment is also the whole "testing framework" which I used to #compare these functions - strverscmp.tar.bz2 - follow the steps in README #inside archive. It is developed a bit quickly but I hope it could be #useful :-)#
#Kamil # http://www.opensubscriber.com/message/[email protected]/10201323.html
#http://old.nabble.com/Possible-bug-in-sort--V-td26804985.html
#> cat a | /build/toolchain/lin32/coreutils-8.2/bin/sort -V #> kernel-2.6.18-164.2.1.el5.x86_64.rpm #> kernel-2.6.18-164.6.1.el5.x86_64.rpm #> kernel-2.6.18-164.el5.x86_64.rpm #> #> The result should be #> kernel-2.6.18-164.el5.x86_64.rpm #> kernel-2.6.18-164.2.1.el5.x86_64.rpm #> kernel-2.6.18-164.6.1.el5.x86_64.rpm #> #> Is it a bug is sort -V?
#I agree the behavior is pretty awkward. Nevertheless the behavior #is well documented:
# http://www.gnu.org/software/coreutils/manual/html_node/Details-about-version...
#The "bug" is triggered by the underscore in "x86_64". It's not treated as file #suffix in that case. However it works fairly well when you replace "x86_64" by #"i686". #From 3069d50b766a2db8b86406904b7327e5de5e315f Mon Sep 17 00:00:00 2001 #From: =?utf-8?q?P=C3=A1draig=20Brady?= <P@...> #Date: Thu, 17 Dec 2009 10:48:54 +0000 #Subject: [PATCH] doc: enhance and reference info about version comparison
#* doc/coreutils.texi (sort invocation): Reference the additional #info about filevercmp rather than the unused strverscmp. #(Details about version sort): Add some examples that are not #handled well by fileversmp. #* src/ls.c: Change a comment referencing the now unused strverscmp. #--- # doc/coreutils.texi | 33 ++++++++++++++++++++++++--------- # src/ls.c | 2 +- # 2 files changed, 25 insertions(+), 10 deletions(-)
#-This functionality is implemented using gnulib's @code{filevercmp} function. #-One result of that implementation decision is that @samp{ls -v} #-and @samp{sort -V} do not use the locale category, @env{LC_COLLATE}, #-which means non-numeric prefixes are sorted as if @env{LC_COLLATE} were set #-to @samp{C}. #+This functionality is implemented using gnulib's @code{filevercmp} function, #+which has some caveats worth noting. #+ #+@itemize @bullet #+@item @env{LC_COLLATE} is ignored, which means @samp{ls -v} and @samp{sort -V} #+will sort non-numeric prefixes as if the @env{LC_COLLATE} locale category #+was set to @samp{C}. #+@item Some suffixes will not be matched by the regular #+expression mentioned above. Consequently these examples may #+not sort as you expect: #+ #+@example #+abc-1.2.3.4.7z #+abc-1.2.3.7z #+@end example #+ #+@example #+abc-1.2.3.4.x86_64.rpm #+abc-1.2.3.x86_64.rpm #+@end example #+@end itemize
# @node General output formatting # @subsection General output formatting #diff --git a/src/ls.c b/src/ls.c #index aeaa584..5c7f6aa 100644 #--- a/src/ls.c #+++ b/src/ls.c #@@ -3272,7 +3272,7 @@ DEFINE_SORT_FUNCTIONS (extension, cmp_extension) # All the other sort options, in fact, need xstrcoll and strcmp variants, # because they all use a string comparison (either as the primary or secondary # sort key), and xstrcoll has the ability to do a longjmp if strcoll fails for #- locale reasons. Last, strverscmp is ALWAYS available in coreutils, #+ locale reasons. Last, filevercmp is ALWAYS available in coreutils, # thanks to the gnulib library. */ # static inline int # cmp_version (struct fileinfo const *a, struct fileinfo const *b) #-- #1.6.2.5
#como compilar a partir de un ebuild, de un spec y de un control #category no esta en ebuild, si en ubuild
#http://www.redhat.com/archives/rpm-list/2003-January/msg00006.html
#RES1=`echo ".$CADENA1" |sed -e 's/[^0-9a-zA-Z]\+/./g'| sed -e 's/\([a-zA-Z]\+\)/\1:./g' | sed -e 's/\([0-9]\+\)/\1;./g' | sed -e 's/.\([0]\+\)/.\1:./g'` #RES2=`echo ".$CADENA2" |sed -e 's/[^0-9a-zA-Z]\+/./g'| sed -e 's/\([a-zA-Z]\+\)/\1:./g' | sed -e 's/\([0-9]\+\)/\1;./g' | sed -e 's/.\([0]\+\)/.\1:./g'` #echo $RES1 #echo $RES2
#FIN=0 ##IFS=.
#RES1=${RES1#.} #RES2=${RES2#.} #coma=`echo "$RES1" |sed -e 's/\..\+$//'` #RES1=${RES1#$coma}
#comb=`echo "$RES2" |sed -e 's/\..\+$//'` #RES2=${RES2#$comb}
#echo $coma $comb - $RES1 $RES2 #if test x"$coma" != x"$comb" ; then # echo SON DISTINTOS $coma $comb # FIN=1 #fi#
#if test x"$RES1" = x -o x"$RES2" = x ; then # echo junto termino: $coma - $comb # FIN=1 #fi #bbb=s # # if test x"$item" != x; then # echo $item
# fi
#done
El 1 de julio de 2010 17:26, Pablo Manuel Rizzo <[email protected]> escribió:
2010/7/1 Diego Saravia <[email protected]>
hay que integrarlo con el programa que deduce las versiones, para eso
lo
escribi
no es mi idea generar un nuevo sort, con el tiempo el sort -V seguramente andara
solamente poder saber si un paquete es posterior o anterior a lo que ya esta instalado.
supongo que el programa que dado un paquete indica su nombre y versiones, cuando le digas cual es la versin instalada de ese mismo paquete te dira adicionalmente si es anterior o posterior
esa es mi idea,
se te ocurre algo mejor
Ah, está bien, había entendido otra cosa.
-- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
No entiendo los casos como este:
baselayout_1.12.5_5.0__tbz2 => baselayout-1.12.5.tbz2
Para ordenar como lo haría sort -V bastaría con poner un .0 al final. Además, creo que se podría quitar las extensiones, así sería mas genérico, si tenemos versiones con distinto empaquetamiento podemos usar la más nueva, o compararlas, sin importar el formato. En que caso podría ser conflictivo traducirlo así? baselayout_1.12.5.0 2010/7/5 Diego Saravia <[email protected]>:
te mando por privado por los attachs lo que me pediste
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
las dos columnas son el nombre canonico, un invento mio, que seria como el nombre universal del paquete y el nombre original de ututo/gentoo
ordenada: baselayout_2.0.1_5.0__tbz2 => baselayout-2.0.1.tbz2 baselayout_2.0.0_5.0__tbz2 => baselayout-2.0.0.tbz2 baselayout_2.0.0_1.3.1__tbz2 => baselayout-2.0.0_alpha3-r1.tbz2 baselayout_1.13.0_1.12.0__tbz2 => baselayout-1.13.0_alpha12.tbz2 baselayout_1.13.0_1.10.2__tbz2 => baselayout-1.13.0_alpha10-r2.tbz2 baselayout_1.13.0_1.7.1__tbz2 => baselayout-1.13.0_alpha7-r1.tbz2 baselayout_1.13.0_1.5.1__tbz2 => baselayout-1.13.0_alpha5-r1.tbz2 baselayout_1.13.0_1.3.0__tbz2 => baselayout-1.13.0_alpha3.tbz2 baselayout_1.13.0_1.1.1__tbz2 => baselayout-1.13.0_alpha1-r1.tbz2 baselayout_1.12.12_5.0__tbz2 => baselayout-1.12.12.tbz2 baselayout_1.12.11.1_5.0__tbz2 => baselayout-1.12.11.1.tbz2 baselayout_1.12.10_5.5__tbz2 => baselayout-1.12.10-r5.tbz2 baselayout_1.12.10_5.4__tbz2 => baselayout-1.12.10-r4.tbz2 baselayout_1.12.5_5.0__tbz2 => baselayout-1.12.5.tbz2 baselayout_1.12.4_5.7__tbz2 => baselayout-1.12.4-r7.tbz2 baselayout_1.12.4_5.3__tbz2 => baselayout-1.12.4-r3.tbz2
te lo acomode un poco al programa para que te sea mas significativo
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
-- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
El 5 de julio de 2010 18:42, Pablo Manuel Rizzo <[email protected]>escribió:
No entiendo los casos como este:
baselayout_1.12.5_5.0__tbz2 => baselayout-1.12.5.tbz2
Para ordenar como lo haría sort -V bastaría con poner un .0 al final.
el 5.0 final es porque no es alpha ni nada y se ordena asi Suffix Meaning #_alpha Alpha release #_beta Beta release #_pre Prerelease #_rc Release candidate #(none) Normal release #_p Patch level (normally accompanied by trailing integer) si se tuviese que comparar con un _p o un alpha
Además, creo que se podría quitar las extensiones, así sería mas genérico, si tenemos versiones con distinto empaquetamiento podemos usar la más nueva, o compararlas, sin importar el formato.
bueno, el programa usa las extensiones para saber como partir, si se empaqueta un rpm hay que seguir las normas de los rpm y lo mismo un deb y efectivamente podes comparar un deb con un rpm o un tbz2 con este programa
2010/7/5 Diego Saravia <[email protected]>:
te mando por privado por los attachs lo que me pediste
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
las dos columnas son el nombre canonico, un invento mio, que seria como el nombre universal del paquete y el nombre original de ututo/gentoo
ordenada: baselayout_2.0.1_5.0__tbz2 => baselayout-2.0.1.tbz2 baselayout_2.0.0_5.0__tbz2 => baselayout-2.0.0.tbz2 baselayout_2.0.0_1.3.1__tbz2 => baselayout-2.0.0_alpha3-r1.tbz2 baselayout_1.13.0_1.12.0__tbz2 => baselayout-1.13.0_alpha12.tbz2 baselayout_1.13.0_1.10.2__tbz2 => baselayout-1.13.0_alpha10-r2.tbz2 baselayout_1.13.0_1.7.1__tbz2 => baselayout-1.13.0_alpha7-r1.tbz2 baselayout_1.13.0_1.5.1__tbz2 => baselayout-1.13.0_alpha5-r1.tbz2 baselayout_1.13.0_1.3.0__tbz2 => baselayout-1.13.0_alpha3.tbz2 baselayout_1.13.0_1.1.1__tbz2 => baselayout-1.13.0_alpha1-r1.tbz2 baselayout_1.12.12_5.0__tbz2 => baselayout-1.12.12.tbz2 baselayout_1.12.11.1_5.0__tbz2 => baselayout-1.12.11.1.tbz2 baselayout_1.12.10_5.5__tbz2 => baselayout-1.12.10-r5.tbz2 baselayout_1.12.10_5.4__tbz2 => baselayout-1.12.10-r4.tbz2 baselayout_1.12.5_5.0__tbz2 => baselayout-1.12.5.tbz2 baselayout_1.12.4_5.7__tbz2 => baselayout-1.12.4-r7.tbz2 baselayout_1.12.4_5.3__tbz2 => baselayout-1.12.4-r3.tbz2
te lo acomode un poco al programa para que te sea mas significativo
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
-- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
2010/7/5 Diego Saravia <[email protected]>:
Además, creo que se podría quitar las extensiones, así sería mas genérico, si tenemos versiones con distinto empaquetamiento podemos usar la más nueva, o compararlas, sin importar el formato.
bueno, el programa usa las extensiones para saber como partir, si se empaqueta un rpm hay que seguir las normas de los rpm y lo mismo un deb
y efectivamente podes comparar un deb con un rpm o un tbz2 con este programa
Ok. Pero tengo que comparar archivos .uget (antes le quitaba las extensiones pero me sirve lo mismo dejarle la extensión si es necesaria), probé varias opciones y parece que puedo hacerlo, efectivamente, pero me llamó la atención los resultados. $ ./upackname.sh -o aide-0.10_p20040917-r1.uget aide-0.10_p20040917_r1___uget <- tiene un _ más que los otros $ ./upackname.sh -o aide-0.10_p20040917-r1.tbz2 aide_0.10_6.20040917.1__tbz2 <- tiene un punto en vez de un _ entre el 7 y el 1 $ ./upackname.sh -o aide-0.10_p20040917-r1.rpm aide_0.10_p20040917_r1__rpm $ ./upackname.sh -o aide-0.10_p20040917-r1 aide_0___10_p20040917-r1 <- no cambia la última parte Lo estoy integrando en el nuevo uget, lo voy a usar como un comando externo para no modificarlo, y si lo actualizás cambio el archivo y listo. -- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
estoy por liberar el instalador de paquetes, alli habra una nueva version
Pero tengo que comparar archivos .uget (antes le quitaba las extensiones pero me sirve lo mismo dejarle la extensión si es necesaria), probé varias opciones y parece que puedo hacerlo, efectivamente, pero me llamó la atención los resultados.
puedo agregarle esa extension con informacion especifica de sus nombres, son iguales que los tbz2 no ? hago que trate igual un tbz2 que un uget?
$ ./upackname.sh -o aide-0.10_p20040917-r1.uget aide-0.10_p20040917_r1___uget <- tiene un _ más que los otros
$ ./upackname.sh -o aide-0.10_p20040917-r1.tbz2 aide_0.10_6.20040917.1__tbz2 <- tiene un punto en vez de un _ entre el 7 y el 1
trata distinto al tbz2 que el uget como no tiene instrucciones especificas para uget, lo toma en forma generica y no le aplica las mismas reglas
$ ./upackname.sh -o aide-0.10_p20040917-r1.rpm aide_0.10_p20040917_r1__rpm
$ ./upackname.sh -o aide-0.10_p20040917-r1 aide_0___10_p20040917-r1 <- no cambia la última parte
lo mismo ese no es un rpm bien formado
Lo estoy integrando en el nuevo uget, lo voy a usar como un comando externo para no modificarlo, y si lo actualizás cambio el archivo y listo.
bien ya le incorporo el uget confirmame si sigue las mismas reglas que los tbz2
-- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
listo, ya lo cambie, en unas horas estare subiendo los nuevos archivos ====================================== con la nueva regla (y los cambios) queda: upackname -o aide-0.10_p20040917-r1.uget aide__0.10_6.20040917.1___aide-0.10---p20040917-r1.uget_uget 0.10 es la version del fuente 6.20040917.1 es la version de la release 6 porque esta pacheada (la p), 5 son los normales esa cadena canonica tiene 8 campos separados por _ esa expresion regular los separa `echo $canonical | sed -e 's/\(.*\)_\(.*\)_\(.*\)_\(.*\)_\(.*\)_\(.*\)_\(.*\)_\(.*\)$/export COMPPN\=\1 COMPPSUB=\2 COMPPV\=\3 COMPPR\=\4 PCOMPPS\=\5 COMPOR=\6 PCOMPPST\=\7 COMPPE\=\8/'` para usar upackname lo ideal es hacer en tu script DIRBIN=$(summabase) source $DIRBIN/upackname source upackname_vars tenes que instalar tambien summabase al poner el segundo source no se te ejecuta el main pero tenes habilitadas dos funciones utiles y la upaclname_vars para cargar variables readcan (que aplica la expresion regular anterior) y upackname_main "$PACK" "$COMPPACK" "$ONELINE" ONELINE=1 es igual que -o asi te funciona mas rapido y esmas simple parece complejo pero te termina simplificando las cosas ====================== upackname -o aide-0.10_p20040917-r1.uget aide__0.10_6.20040917.1___aide-0.10---p20040917-r1.uget_uget El día 22 de julio de 2010 22:37, Diego Saravia <[email protected]> escribió:
estoy por liberar el instalador de paquetes, alli habra una nueva version
Pero tengo que comparar archivos .uget (antes le quitaba las extensiones pero me sirve lo mismo dejarle la extensión si es necesaria), probé varias opciones y parece que puedo hacerlo, efectivamente, pero me llamó la atención los resultados.
puedo agregarle esa extension con informacion especifica de sus nombres, son iguales que los tbz2 no ?
hago que trate igual un tbz2 que un uget?
$ ./upackname.sh -o aide-0.10_p20040917-r1.uget aide-0.10_p20040917_r1___uget <- tiene un _ más que los otros
$ ./upackname.sh -o aide-0.10_p20040917-r1.tbz2 aide_0.10_6.20040917.1__tbz2 <- tiene un punto en vez de un _ entre el 7 y el 1
trata distinto al tbz2 que el uget
como no tiene instrucciones especificas para uget, lo toma en forma generica y no le aplica las mismas reglas
$ ./upackname.sh -o aide-0.10_p20040917-r1.rpm aide_0.10_p20040917_r1__rpm
$ ./upackname.sh -o aide-0.10_p20040917-r1 aide_0___10_p20040917-r1 <- no cambia la última parte
lo mismo
ese no es un rpm bien formado
Lo estoy integrando en el nuevo uget, lo voy a usar como un comando externo para no modificarlo, y si lo actualizás cambio el archivo y listo.
bien
ya le incorporo el uget
confirmame si sigue las mismas reglas que los tbz2
-- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
Excelente, lo pruebo. Gracias! 2010/7/23 Diego Saravia <[email protected]>:
listo, ya lo cambie, en unas horas estare subiendo los nuevos archivos
====================================== con la nueva regla (y los cambios) queda:
upackname -o aide-0.10_p20040917-r1.uget
aide__0.10_6.20040917.1___aide-0.10---p20040917-r1.uget_uget
0.10 es la version del fuente
6.20040917.1 es la version de la release
6 porque esta pacheada (la p), 5 son los normales
esa cadena canonica tiene 8 campos separados por _
esa expresion regular los separa
`echo $canonical | sed -e 's/\(.*\)_\(.*\)_\(.*\)_\(.*\)_\(.*\)_\(.*\)_\(.*\)_\(.*\)$/export COMPPN\=\1 COMPPSUB=\2 COMPPV\=\3 COMPPR\=\4 PCOMPPS\=\5 COMPOR=\6 PCOMPPST\=\7 COMPPE\=\8/'`
para usar upackname lo ideal es hacer en tu script
DIRBIN=$(summabase) source $DIRBIN/upackname source upackname_vars
tenes que instalar tambien summabase
al poner el segundo source no se te ejecuta el main pero tenes habilitadas dos funciones utiles y la upaclname_vars para cargar variables
readcan (que aplica la expresion regular anterior)
y
upackname_main "$PACK" "$COMPPACK" "$ONELINE"
ONELINE=1 es igual que -o
asi te funciona mas rapido y esmas simple
parece complejo pero te termina simplificando las cosas
====================== upackname -o aide-0.10_p20040917-r1.uget aide__0.10_6.20040917.1___aide-0.10---p20040917-r1.uget_uget
El día 22 de julio de 2010 22:37, Diego Saravia <[email protected]> escribió:
estoy por liberar el instalador de paquetes, alli habra una nueva version
Pero tengo que comparar archivos .uget (antes le quitaba las extensiones pero me sirve lo mismo dejarle la extensión si es necesaria), probé varias opciones y parece que puedo hacerlo, efectivamente, pero me llamó la atención los resultados.
puedo agregarle esa extension con informacion especifica de sus nombres, son iguales que los tbz2 no ?
hago que trate igual un tbz2 que un uget?
$ ./upackname.sh -o aide-0.10_p20040917-r1.uget aide-0.10_p20040917_r1___uget <- tiene un _ más que los otros
$ ./upackname.sh -o aide-0.10_p20040917-r1.tbz2 aide_0.10_6.20040917.1__tbz2 <- tiene un punto en vez de un _ entre el 7 y el 1
trata distinto al tbz2 que el uget
como no tiene instrucciones especificas para uget, lo toma en forma generica y no le aplica las mismas reglas
$ ./upackname.sh -o aide-0.10_p20040917-r1.rpm aide_0.10_p20040917_r1__rpm
$ ./upackname.sh -o aide-0.10_p20040917-r1 aide_0___10_p20040917-r1 <- no cambia la última parte
lo mismo
ese no es un rpm bien formado
Lo estoy integrando en el nuevo uget, lo voy a usar como un comando externo para no modificarlo, y si lo actualizás cambio el archivo y listo.
bien
ya le incorporo el uget
confirmame si sigue las mismas reglas que los tbz2
-- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
________________________________________________
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. 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.
[email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/solar-general
-- Pablo Manuel Rizzo ------------------------------- http://pablorizzo.com -------------------------------
On 23/06/2010, Diego Saravia <[email protected]> wrote:
en relacion a lo que me sugirio pablo del ls -v, bueno resulta que el sort usa la misma funcion, pero me pasa lo siguiente
echo -e "100\n12" | sort -V
en un suse da 100 12 en ubuntu 12 100 (que es lo esperable)
quien se anima a probarlo en su maquina?
Hola, cuál es el valor de las variables de entorno LC_COLLATE y LC_NUMERIC en ambos casos? -- Adrian. http://elesquinazotango.com.ar http://www.noalcodigodescioli.blogspot.com/
Hola, cuál es el valor de las variables de entorno LC_COLLATE y LC_NUMERIC en ambos casos?
no las tengo definidas ni en suse ni en ubuntu -- Diego Saravia [email protected] NO FUNCIONA->[email protected]
curioso, sigue dando vueltas este tema en algun momento dijeron que lo habian parchado pero luego fuieron para atras porque estaban por largar la 11.3 =============================================== https://bugzilla.novell.com/show_bug.cgi?id=616745 https://bugzilla.novell.com/show_bug.cgi?id=616745#c4 Philipp Thomas <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |NEEDINFO InfoProvider| |[email protected] --- Comment #4 from Philipp Thomas <[email protected]> 2010-10-20 15:00:56 CEST --- Please accept the update for 11.2 (SR#42281) - Mostrar texto citado - El día 23 de junio de 2010 12:16, Diego Saravia <[email protected]> escribió:
en relacion a lo que me sugirio pablo del ls -v, bueno resulta que el sort usa la misma funcion, pero me pasa lo siguiente
echo -e "100\n12" | sort -V
en un suse da 100 12 en ubuntu 12 100 (que es lo esperable)
quien se anima a probarlo en su maquina? -- Diego Saravia [email protected] NO FUNCIONA->[email protected]
-- Diego Saravia [email protected] NO FUNCIONA->[email protected]
participants (5)
-
Adrian Pardini -
Daniel Olivera -
Diego Saravia -
Facundo Andrés Bianco -
Pablo Manuel Rizzo