Attention à la casse dans SVN !

svn: In directory 'C:/Projects/ozclim/source' 
svn: Can't open file 
'C:/Projects/ozclim/source/.svn/tmp/text-base/reefclim.dof.svn-base': \
    The system cannot find the file specified.

Looks like you have two versions of the file in the same repository directory whose names differ only in case (reefclim.dof and ReefClim.dof). To confirm that this is so, list the contents of the directory in the repository with "svn ls url://to/repo/directory"

http://subversion.tigris.org/faq.html#case-change

How do I change the case of a filename?

This problem comes up in two situations. If you're adding files on an operating system with a case-insensitive filesystem, such as Windows, you might find you accidentally add a file with the wrong case in the filename. Alternatively, you may just decide to change the case of an existing file in the repository.

If you're working in a case-sensitive file system, this is no problem at all. Just move the file to the new name, e.g.,

svn mv file.java File.java

But this won't work in a case-insensitive operating system like Windows. In Windows you can accomplish this by copying the file somewhere temporary, deleting the file from Subversion, then adding the copy with the correct case. Or a better way is to perform a move operation with Subversion URLs. Using URLs is recommended, because it will preserve history for the file, and will take effect immediately.

Both ways will leave Windows working copies with problems, however, because Windows can still get confused when trying to update the conflicting filenames. (You'll get a message like svn: Failed to add file 'File.java': object of the same name already exists). One way of fixing the problem is to delete your working copy and check out again. If you do not want to do this, you must perform a two step update.

For each file with the wrong case, the following command will change the case:

svn mv svn://svnserver/path/to/file.java svn://svnserver/path/to/File.java

To update the working copy, change to the relevant directory and do:

svn update file.java
svn update

The first update will remove file.java from your working copy, the second update will add File.java, leaving you with a correct working copy. Or if you had a lot of problematic files, you can update the working copy this way:

svn update *
svn update

As you can see, adding a file with the wrong case is tricky to fix on an operating system that has a case insensitive filesystem. Do try to get it right when you add the file the first time! To prevent the problem from occurring in the first place, you can create a pre-commit hook that calls the file check-case-insensitive.pl. That file lives in the Subversion source tarball, in the directory contrib/hook-scripts.

Faire un import "sur place" dans SVN

Marqué :

Voici commentr transformer des données originales en un espace de travail.

Disons que vous souhaitez faire du répertoire ~/working/toto le ~/repo/project/trunk de votre dépôt.

cd ~/working/toto
svn checkout file:///~/repo/project/trunk .
svn add *
svn commit -m "Initial import"

Vous souhaitez ajouter le répertoire ~/etc ?

svn mkdir file:///~/repo/project/trunk/etc \
        -m "Make a directory in the repository to correspond to /etc"
cd ~/etc
svn checkout file:///~/repo/project/trunk/etc .
svn add apache samba alsa X11 
svn commit -m "Initial version of my config files"

This takes advantage of a not-immediately-obvious feature of svn checkout: you can check out a directory from the repository directly into an existing directory. Here, we first make a new empty directory in the repository, and then check it out into /etc, transforming /etc into a working copy. Once that is done, you can use normal svn add commands to select files and subtrees to add to the repository.

tar / untar

Marqué :

décompresser une archive

tar -xzvf archive.tar.gz

compresser un répertoire

tar -czvf archive.tar.gz MonRepertoire

Create MySQL's users on OSX

Proper database can be created with the MySQL monitor, like that:

CREATE DATABASE trac DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;

To check character set settings for your database, issue command:

mysql> USE trac;
Database changed
mysql> SHOW VARIABLES LIKE '%character%';
+--------------------------+--------------------
| Variable_name            | Value
+--------------------------+--------------------
| character_set_client     | cp1251
| character_set_connection | cp1251
| character_set_database   | utf8
| character_set_filesystem | binary
| character_set_results    | cp1251
| character_set_server     | utf8
| character_set_system     | utf8
| character_sets_dir       | C:\DevServer\Instal
+--------------------------+--------------------
8 rows in set (0.00 sec)
mysql>
See also #3884.

Usually, you also want to create a user and give this user access to the database created above:

CREATE USER tracuser IDENTIFIED BY 'password';
GRANT ALL ON trac.* TO tracuser;

The connection string will then be:

mysql://tracuser:password@localhost/trac

Troubleshooting

If you get an error from python when using trac-admin like this:

OperationalError: (1045, "Access denied for user 'tracuser'@'localhost' (using password: YES)")

There are a few possibilities:

  1. Try first to login on the command-line using the user tracuser (mysql -p -h localhost -u tracuser)
  2. Created user is not yet used by MySQL (Login to the MySQL server(as root): mysql -p and type FLUSH PRIVILEGES;)
  3. The user is added but the host does not match in the mysql user table (I had this on my FreeBSD setup). mysql -p; use mysql; UPDATE user SET Host="localhost" WHERE User="tracuser"; FLUSH PRIVILEGES;)

Installer Sphinx sur OSX

Marqué :

Ce tuto utilise wget, qui n'est pas installé sur Leopard. Pour l'installer, la procédure est disponible ici.

# Download sphinx
wget http://sphinxsearch.com/downloads/sphinx-0.9.9-rc2.tar.gz
tar zxvf sphinx-0.9.9-rc2.tar.gz

cd sphinx-0.9.9-rc2/

# Add stemming support
wget http://snowball.tartarus.org/dist/libstemmer_c.tgz
tar zxvf libstemmer_c.tgz

./configure --with-libstemmer
make

sudo make install