jueves, diciembre 09, 2010

Migrating CVS repositories from Windows to Linux

I've been in these last few days migrating some CVS repositories from a Windows NT machine to a Linux (Ubuntu 10.04 desktop).
Following the philosophy <>, I'll explain the steps I followed in an exchematic way (and save you the odd headache with some "quirks" of CVS and especially M$-Windows.
For technical people, the migration was from CVSNT repositories hosted in CVSNT 2.5.03 (Scorpio) Build 2382 on Windows.
In Linux we have the opportunity to install both CVS and CVSNT. For compatibility, I installed (from the repositories) CVSNT. The version that was in the repositories was 2.5.04 (Zen) Build 3236, which guaranteed the compatibility.

Well, hands on keyboards:

.- In the Windows machine, stop CVS services, and make a zip, tar, 7zip .... what you want.

.- We copy it on the Linux machine and unpack it (tar xvfz ....., p7zip-d ......) to any folder on your hard disk (let's call it /home/ReposCVSwindows).
So, we'll have the contents of our repository (let's call it  repo1) in /home/ReposCVSwindows/repo1.

.- We are on the Linux machine. With root, create the repository, and start (let's do it by example in the folder /home/prose/ReposCVS)
sudo cvs -d /home/prosa/ReposCVS/repo1 init

.- Let's copy the contents of /home/ReposCVSwindows/repo1  to  /home/prose/ReposCVS/repo1. Be careful here. If we do it with a non-root user, it won't let us overwrite some files in CVSROOT. If we do it as root, then all files are copied to owner "root" and then it won't work as expected.
My solution was to use my favorite file manager (gnome-commander), starting the root version (File -> start gnome commander as root), and from there make the copy, replacing all existing files (there are several that are created in linux and not windows and of course they will not be overwritten).
In this way, we overwrite files without root permissions to files with root permissions, but keeping the non-root as owner (in our example prose).
(Sure there are some cp command option that does this, but gnome-commander does it in 2 seconds).

.- In the CVSROOT directory of the repository folder, we'll create a file named "admin" with content "prose" (or the name of the user of the machine). Thus, we tell CVS that this user can perform administrative tasks on the repository.

.- Now we have the repository fully copied. Now we will try to connect to it:
cvs -d :pserver:JuanMa@localhost:/home/prose/ReposCVS/repo1 login

(JuanMa is a user that we have imported from the windows - it comes in CVSROOT/passwd file -). It will ask for the password.

Here goes something inexplicable to me. Sometimes this has worked for me and I haven't had an error, but generally tends to respond:
cvs [login aborted]: Authorization failed: server localhost Rejected access to / home/prose/ReposCVS/repo1 for user JuanMa

I think it's a codification problem in the file passwd which, as I said, stores users. One way to save it with "linux format" is to create a new dummy user and force to write to this file:

cvs -d /home/prosa/ReposCVS/repo1 passwd -a -r prose jm1

(Put the password you want) (the "prose" parameter must be the actual user loged in Linux).

.- We see that the passwd file now has a new line with the new user jm1.

.- Open the file CVSROOT/passwd with vi (or substitutes - vim, gvim ...-), not gedit. Here we see that all lines except the last are the famous ending ^M
. We must remove it in all the lines.

.- Now we should be able to access the previous user:
cvs -d :pserver:JuanMa@localhost:/home/prosa/ReposCVS/repo1 login

.- Now we just put an alias to the repository
It is a way to access to /home/prosa/ReposCVS/repo1  as  /repo1.

To do this, we edit the file /etc/cvsnt/PServer.
Here we have that every repository has 2 lines: one with the path and the other with the name (they are identical initially). Change the second:

Repository1=/home/prosa/ReposCVS/repo1
Repository1Name=/repo1


A final problem to be solved:  users in M$-Windows who were created with write permissions, now couldn't write.
I solved this deleting the file "writers" of the CVSROOT folder (strange but true).


That's all. Enjoy.

viernes, octubre 08, 2010

Se coge antes a un mentiroso que a un cojo

En la última excursión familiar hablamos del famoso tema de Sarkozy con los gitanos.
La idea que arguyeron los que estaban a favor era que se trataba de una decisión contra gente en estado irregular, sin tener nada que ver si eran gitanos o no, decisión también defendida por el gobierno francés.
Yo desde el primer momento he sido de la opinión de que detrás de esa decisión había algún tinte racista. He estado esperando tiempo a ver cómo evolucionaba este caso (Zapatero, en su caída libre, apoyó a su homólogo racista francés -¡Zapatero, dimisión!-).
Bueno, pues hoy me encuentro en el periódico:
La policía francesa dispone de un fichero secreto de gitanos.
Que nadie venga ahora con que "cada gobierno puede hacer lo que quiera" porque   la existencia del fichero viola la legislación por basarse en el origen étnico.

El señor Sarkozy, que intentó hacernos creer que su decisión no tenía nada que ver con los gitanos, acaba de quedarse sin argumentos. Si es que se coge antes a un mentiroso que a un cojo ...

jueves, septiembre 23, 2010

¿Por qué voy a hacer huelga el 29-S?

Grosso modo, porque van a pagar justos por pecadores.

- Porque esta crisis ha sido provocada por "los mercados" y por la negligencia de los gobiernos/instituciones financieras globales para prever los comportamientos especulativos de algunas empresas e instituciones sin escrúpulos.

- Porque los funcionarios no han provocado nada, y se les va a multar con un 5% (de media) de su sueldo.

- Porque los pensionistas no tienen la culpa de nada, y se les va a congelar los salarios de jubilación (cuando la vida crece y crece).

- Porque los curritos no hemos provocado nada y nos van a imponer una reforma laboral en la que pasamos de ser indemnizados con 45 días por año trabajado a serlo con 20 días (basta que la empresa declare "condiciones objetivas de perdidas de ingresos").

- Porque todavía no he visto ni una sola medida que intente hacer arrimar el hombro a las clases altas: sigue anulado el impuesto de patrimonio, no se les ha subido los impuestos (no un 5%, ni siquiera un 0,5%), los tramos altos del IRPF siguen como estaban.

- Porque Zapatero nos mintió cuando una semana antes de aplicar las medidas "anti-crisis" se le llenaba la boca diciendo que "no se reducirá ningún beneficio social".

Por todo eso, y seguro que algo se me queda en el tintero, voy a hacer huelga el próximo 29-S.

Me gustaría conocer más opiniones ... en este hilo del blog.


viernes, enero 22, 2010

reflexiones de un viernes nublado

Tres noticias leo hoy en el periódico y escucho en la radio, todas relativas a Estados Unidos y todas fiel reflejo del mundo en el que hemos decidido vivir. La primera: Obama decide castigar severamente las inversiones especulativas, y la bolsa cae brúscamente. La segunda: el partido demócrata pierde el escaño de Edward Kennedy a manos de los republicanos. La tercera: El Supremo permite financiar sin límite las campañas electorales, eliminando toda restricción a las aportaciones privadas.

No puedo por menos que pararme a reflexionar sobre todas ellas desde una perspectiva global. O sea, que a la bolsa no le gusta que se controle el despilfarro del dineno de los pequeños ahorradores. Es mejor que ese dinero "sucio" siga circulando sin restricciones. Además, después de un año de "lucha", parece que la reforma sanitaria de Obama se hunde con el recién adquirido escaño republicano. ¿Qué pasará con los más de 30 millones de personas en EE.UU. sin ningún tipo de protección sanitaria? Finalmente, ahora hay vía libre para financiar al partido que se quiera. A nadie se le escapa que alguien que paga a un partido lo no hace con fines altruistas.

Es el mundo que hemos querido tener, ¡qué pena me da!