Entrar



Administração do Sistema Operacional


Java no Firefox/Iceweasel - Debian PDF Imprimir E-mail
Sex, 15 de Janeiro de 2010 16:08
Turma,

atualizei o Debian para o unstable e tanto o Iceweasel como o Java
foram atualizados.

Começou a ocorrer o erro abaixo: Caused by: java.net.ConnectException:
Network is unreachable.

Gastei um tempo grande tentando entender onde estava o problema e, com
muito custo, achei um link que solucionou o problema:
http://pvaneynd.livejournal.com/132635.html

No home do usuário tem um arquivo deployment.properties no
subdiretório ".java/deployment/" Configurei para utilizar o IPV4
ajustando o parâmetro
"deployment.javaws.jre.0.args=-Djava.net.preferIPv4Stack\=true"

A intervenção, acima, vale somente para um usuário específico. Imagine
uma rede como milhares de usuários? Grande problema.

O debian está vindo com o ipv6 habilitado como default:
http://vorbote.wordpress.com/2009/07/30/disabling-ipv6-in-debian-sid/
- Neste link há a dica de como desabilitar o IPV6. Desabilitando-o, a
configuração de preferência do IPV4 para um usuário específico, citado
acima, não precisa ser feita e o acesso de applet's funciona
normalmente para todos os usuários. Não acho a melhor solução
desabilitar o IPV6.

No link http://java.sun.com/javase/6/docs/technotes/guides/net/properties.html
tem a seguinte informação:

"java.net.preferIPv4Stack (default: false)
If IPv6 is available on the operating system the underlying native
socket will be an IPv6 socket. This allows Java(tm) applications to
connect too, and accept connections from, both IPv4 and IPv6 hosts.
If an application has a preference to only use IPv4 sockets then this
property can be set to true. The implication is that the application
will not be able to communicate with IPv6 hosts."

A configuração no home de cada usuário para uma rede com milhares de
usuários é inviável.

Alguém sabe como deixar a opção
"deployment.javaws.jre.0.args=-Djava.net.preferIPv4Stack\=true" como
default para novos usuários no ambiente?


Veja o log do erro abaixo:


Java Plug-in 1.6.0_17
Using JRE version 1.6.0_17-b04 Java HotSpot(TM) Server VM
User home directory = /home/gonzaga1
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to
----------------------------------------------------


load: class br/com/bb/aapf/bbteclado/CampoTeclado.class not found.
java.lang.ClassNotFoundException: br.com.bb.aapf.bbteclado.CampoTeclado.class
at
sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:152)
at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at
sun.plugin2.applet.Plugin2ClassLoader.loadCode(Plugin2ClassLoader.java:447)
at
sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:2880)
at
sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1397)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.net.ConnectException: Network is unreachable
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:525)
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:550)
at sun.net.NetworkClient.doConnect(NetworkClient.java:161)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
at sun.net.www.protocol.https.HttpsClient.(HttpsClient.java:272)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:329)
at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:172)
at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:801)
at
sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:158)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1049)
at
java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)
at
sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:318)
at
sun.plugin2.applet.Applet2ClassLoader.getBytes(Applet2ClassLoader.java:458)
at
sun.plugin2.applet.Applet2ClassLoader.access$000(Applet2ClassLoader.java:46)
at
sun.plugin2.applet.Applet2ClassLoader$1.run(Applet2ClassLoader.java:126)
at java.security.AccessController.doPrivileged(Native Method)
at
sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:123)
... 6 more
Exception: java.lang.ClassNotFoundException: br.com.bb.aapf.

Um abraço,

Gonzaga.


fonte: http://www.mail-archive.com/ Este endereço de e-mail está protegido contra spambots. Você deve habilitar o JavaScript para visualizá-lo. /msg128809.html
Última atualização em Sex, 15 de Janeiro de 2010 16:09
 
Problemas no Bind - Named PDF Imprimir E-mail
Seg, 04 de Janeiro de 2010 08:32
Existe um bug muito chato em ambientes CentOS 5 e Debian Squeeze no que diz respeito ao NAMED, principalmente se o seu sistema operacional foi instalado na versão 64 bits.


Problema:

O NAMED roda normalmente no servidor e atualiza todas as zonas quando modificadas, mas não respondem a nenhuma queire (pesquisa) de DNS internamente. Você adiciona o domínio, ele cria a zona de DNS normalmente e mas mesmo após alterações de seus servidores de DNS junto ao agente de registro o servidor não reconhece o dominio, mesmo você "pingando" ele internamente.

Causa:

Um BUG no arquivo /etc/named.conf - no seu arquivo de log de erro você verá uma mensagem como:

view localhost_resolver: received notify for zone ‘domain.com’: not authoritative

Solução:

Abra o seu arquivo /etc/named.conf e no mesmo identifique as linhas:

match-clients { localhost; };
match-destinations { localhost; };

Mude para:

match-clients { any; };
match-destinations { any; };

Reinicie o serviço named:

service named restart
/etc/init.d/bind restart
 
Unicode Support on CentOS 5.2 with PHP and PCRE PDF Imprimir E-mail
Qua, 02 de Dezembro de 2009 09:24

Yesterday, I talked about how to get the most out of running regular expressions in PHP. The reason that I needed to dig in deep on regular expression syntax with PHP is because I needed to write some regular expressions that deal with Unicode characters.

After much reading, I believed that I knew everything that I needed. I started writing some regex strings and testing the code. Unfortunately, every time I ran a test with a string that contained Unicode characters, the match failed. When I removed the Unicode characters from the string and tested again, it would work. I was baffled.

Finding the Problem

I had the regex testing characters (’\X’, ‘\pL’, etc) inside of a character class, such as ‘[\X-]‘, since I was creating a regex to test for domains. I wrote a really simple rule by simply looking for ‘/^\X$/’ and testing the regex with a single Unicode character. Amazingly, having the ‘\X’ outside of the square brackets changed everything as I now received the following very concerning warning:

PHP Warning:  preg_match(): Compilation failed: support for \P, \p, and \X has not been compiled at offset 2 in wp-content/plugins/dnsyogi/testunicode.php on line 4

Since PHP uses the PCRE engine to run regular expressions, I started to dig into it. I found out that I could query PCRE directly. I ended up with something very similar:

$ pcregrep ‘/\X*/u’ character.txt
pcregrep: Error in command-line regex at offset 2: support for \P, \p, and \X has not been compiled

It looked like the error was coming from PCRE itself. I searched around for a while thinking that I could simply install a new package using yum. I hoped to find something like pcre-utf8, pcre-unicode, php-pcre-unicode, or something to make it simple and quick to add this support since I much prefer using package management tools rather than compiling and installing from source.

Unfortunately, no such package exists. This support is something that must be an option that PCRE is compiled with, and my CentOS repository only has packages that don’t include that support. After much digging around, I found that this isn’t necessarily CentOS’s fault as this package has carried over from the RHEL (Red Hat Enterprice Linux) side of things.

A great way of checking to see if this is an issue on your system is by running the following:

$ pcretest -C
PCRE version 6.6 06-Feb-2006
Compiled with
UTF-8 support
No Unicode properties support
Newline character is LF
Internal link size = 2
POSIX malloc threshold = 10
Default match limit = 10000000
Default recursion depth limit = 10000000
Match recursion uses stack

This is the output that I received. Notice the “UTF-8 support” and the “No Unicode properties support” lines. This means that PRCE was compiled with the “–enable-utf8″ configure option which allows PCRE to recognize and work with UTF-8 encoded strings. However, it wasn’t compiled with the “–enable-unicode-properties” configure option which works in conjunction with the enable-utf8 option to add support for the ‘\p’, ‘\P’, and ‘\X’ character classes.

This seems to have been an oversight when the rpm file was first put together. Fortunately, there is a way to fix it.

Fixing the Problem

Since I’m sure that many of you are like me and would rather not manually compile and install software outside of the package management system, the solution is to update the rpm to have the option that it needs and install it.

I had never done this before. Fortunately, I found a very helpful guide that details this process out very nicely: How to patch and rebuild an RPM package.

I have provided the new rpm file that I have built at the bottom of this post. If you don’t care about all this jibber-jabber, you can skip down there and grab the file. However, if you would like to learn how to address this issue yourself or have a system that my file will not support, please read on to see how I rebuilt the rpm with the new option.

Rebuilding the rpm

  1. The first thing I did is set up my ~/.rpmmacros file and src/rpm folder structure as detailed in the Setup section of the guide that I’m following. I’ll simply refer you over there as it doesn’t need repeating here.
  2. I needed to grab the source rpm for the current version of PCRE on my platform. I’m on CentOS 5.2 with version 6.6 of PCRE. I found the matching source rpm file (pcre-6.6-2.el5_1.7.src.rpm) here.
  3. I then installed the source rpm in order to gain access to its files:
    $ rpm -ivh pcre-6.6-2.el5_1.7.src.rpm

    This put the necessary files into my ~/src/rpm/SOURCES and ~/src/rpm/SPECS folders.

  4. I opened up the ~/src/rpm/SPECS/pcre.spec file and found the following line:
    %configure --enable-utf8

    I changed it to include the Unicode properties option:

    %configure --enable-utf8 --enable-unicode-properties

    I then saved and closed the file.

  5. This is the only change that I needed to make. So, now it is time to build the new rpm file. I simply ran the following to build it:
    $ rpmbuild -ba ~/src/rpm/SPECS/pcre.spec

    Toward the end of the large amount of output, I received the following:

    Wrote: ~/src/rpm/SRPMS/pcre-6.6-2.7.src.rpm
    Wrote: ~/src/rpm/RPMS/x86_64/pcre-6.6-2.7.x86_64.rpm
    Wrote: ~/src/rpm/RPMS/x86_64/pcre-devel-6.6-2.7.x86_64.rpm
    Wrote: ~/src/rpm/RPMS/x86_64/pcre-debuginfo-6.6-2.7.x86_64.rpm

    This tells me exactly where I can find my new source rpm and rpm files.

Updated rpm File for CentOS 5.2 64-bit

If you are running a 64-bit version of CentOS 5.2, the following file should work for you. If you have a different architecture, Linux distro, or encounter any errors when trying to install this file, then you should follow the instructions above to build an rpm that is suitable for your distribution.

pcre-6.6-2.7.x86_64.rpm – PCRE 6.6 for CentOS 5.2 64-bit

Thanks Robin for providing a 32-bit version: pcre-6.6-2.7.i386.rpm

Installing New rpm

Now that I have my new rpm file, I just need to install it. Since I already have a pcre package installed, I need to tell the rpm command to update rather than install. The following command does this for me:

# rpm -Uvh ~/src/rpm/RPMS/x86_64/pcre-6.6-2.7.x86_64.rpm

Notice that I need to be root to run this command.

Finally, to verify that everything worked, I ran the pcrecheck program again:

$ pcretest -C
PCRE version 6.6 06-Feb-2006
Compiled with
UTF-8 support
Unicode properties support
Newline character is LF
Internal link size = 2
POSIX malloc threshold = 10
Default match limit = 10000000
Default recursion depth limit = 10000000
Match recursion uses stack

Looks good.

Finally, time to move on with life.

 

Fonte: http://gaarai.com/2009/01/31/unicode-support-on-centos-52-with-php-and-pcre/

Última atualização em Qua, 02 de Dezembro de 2009 09:33
 
Using eDirectory to control access to MediaWiki PDF Imprimir E-mail
Seg, 30 de Novembro de 2009 08:29

This page shows how to configure MediaWiki to use eDirectory for user authentication, and how to configure authentication based on eDirectory group membership.

This page is part of the MediaWiki knowledge set.

Contents

  • 1 Prerequisites
    • 1.1 Sample Server Configuration
  • 2 Installation
  • 3 Configuration
    • 3.1 Overview
    • 3.2 Container-based User Access
      • 3.2.1 Changes to localSettings.PHP for Contextful Login
        • 3.2.1.1 Example for Contextlful Login
      • 3.2.2 Changes to LocalSettings.php for Contextless Login
        • 3.2.2.1 Example for Contextless Login
      • 3.2.3 Details on Additions to LocalSettings.php
    • 3.3 Group-based Authentication
  • 4 See Also

Prerequisites

This document assumes that you have the following configured:

  • MediaWiki 1.6+ Configured and running on SUSE Linux Enterprise Server 9
  • Novell eDirectory 8.8 installed and configured
    • Other versions may work, but were not tested by the authors
      • Also works with 8.7.3.8
  • MediaWiki's LDAP Authentication plugin 1.e+

Sample Server Configuration

The authors used the following settings for this document. You may choose to use different names:

  • DNS of eDirectory server: edir.wikidemo.org
  • DNS of Wiki server: wiki.wikidemo.org
  • eDirectory configuration
    • User container: ou=users,o=novell
    • eDirectory group for wiki users: wikigroup

Installation

Download the latest version of LDAP Authentication for MediaWiki


Configuration


Overview

The LDAP Authentication module gets its settings from LocalSettings.php, which controls all configuration for MediaWiki.

To add the parameters needed for the LDAP Authentication to work you just need to append them to the end of your existing LocalSettings.php in your wiki directory.


Container-based User Access

The LDAP Authentication module allows MediaWiki to use containers as natural groups within eDirectory.

  • You can assign specific eDirectory containers as authentication contexts for the wiki. Any valid username+password within those containers can then authenticate to the wiki.
  • You can make login contextless or contextful
    • Contextful requires the user to specify containers, such as cn=myuseraccount,ou=users,o=wikidemo
      • Assigning access at a high-level container enables users in all subcontainers to authenticate to the wiki.
      • Be careful: Using high-level containers in a distributed system will cause LDAP to walk the eDirectory tree.
    • Contextless allows users to use simple, common names, such as myuseraccount
      • Users really appreciate contextless login.
      • Be careful: Contextless login in a distributed system will cause LDAP to walk the eDirectory tree.

Changes to localSettings.PHP for Contextful Login

To enable simple user based authentication, append the following to your localSettings.PHP file:

require_once( 'extensions/LdapAuthentication.php' );
$wgAuth = new LdapAuthenticationPlugin();
$wgLDAPDomainNames = array( "{Wiki Identity variable}" );
$wgLDAPServerNames = array( "{Wiki Identity variable}"=>"{IP or DNS of wiki server}" );
$wgLDAPSearchStrings = array( "{Wiki Identity variable}"=>"cn=USER-NAME,{LDAP name of eDirectory container}" );
#$wgLDAPSearchAttributes = array( "{Wiki Identity variable}"=>"uid" );
$wgLDAPUseSSL = array( "{Wiki Identity variable}"=>"ssl" );
$wgMinimalPasswordLength = 1;

Example for Contextlful Login

Here is how the authors' LocalSettings.php looks:

require_once( 'extensions/LdapAuthentication.php' );
$wgAuth = new LdapAuthenticationPlugin();
$wgLDAPDomainNames = array( "wikidemo" );
$wgLDAPServerNames = array( "wikidemo"=>"edir.wikidemo.org" );
$wgLDAPSearchStrings = array( "wikidemo"=>"cn=USER-NAME,ou=users,o=novell" );
#$wgLDAPSearchAttributes = array( "wikidemo"=>"uid" );
$wgLDAPUseSSL = array( "{Wiki Identity variable}"=>"ssl" );
$wgMinimalPasswordLength = 1;

Changes to LocalSettings.php for Contextless Login

To enable simple user based authentication, append the following to your LocalSettings.php file:

require_once( 'extensions/LdapAuthentication.php' );
$wgAuth = new LdapAuthenticationPlugin();
$wgLDAPDomainNames = array( "{Wiki Identity variable}" );
$wgLDAPServerNames = array( "{Wiki Identity variable}"=>"{IP or DNS of wiki server}" );
#$wgLDAPSearchStrings = array( "{Wiki Identity variable}"=>"cn=USER-NAME,{LDAP name of eDirectory container}" );
$wgLDAPSearchAttributes = array( "{Wiki Identity variable}"=>"uid" );
$wgLDAPUseSSL = array( "{Wiki Identity variable}"=>"ssl" );
$wgMinimalPasswordLength = 1;

Example for Contextless Login

Here is how the authors' LocalSettings.php looks:

require_once( 'LdapAuthentication.php' );
$wgAuth = new LdapAuthenticationPlugin();
$wgLDAPDomainNames = array( "wikidemo" );
$wgLDAPServerNames = array( "wikidemo"=>"edir.wikidemo.org" );
$wgLDAPSearchStrings = array( "wikidemo"=>"cn=USER-NAME,ou=users,o=novell" );
$wgLDAPUseSSL = array( "{Wiki Identity variable}"=>"ssl" );
$wgMinimalPasswordLength = 1;

Details on Additions to LocalSettings.php

require_once( 'extensions/LdapAuthentication.php' );
$wgAuth = new LdapAuthenticationPlugin();

Tells MediaWiki to load the LdapAuthentication.php module

$wgLDAPDomainNames = array( "wikidemo" );

Sets the LDAPDomainName variable to "wikidemo." The name "wikidemo" will appear on the wiki's login page in the 'Your domain' field

$wgLDAPServerNames = array( "wikidemo"=>"edir.wikidemo.org"  );

Tells MediaWiki where to find the LDAP server. If you use a DNS name, make sure that the server can resolve the name to the right IP address for the eDirectory server.

$wgLDAPSearchStrings = array( "wikidemo"=>"cn=USER-NAME,ou=users,o=novell" );

This determines the context that to search for users. Additional contexts can be added by putting a single space between each context. Example:

  • $wgLDAPSearchStrings = array( "wikidemo"=>"cn=USER-NAME,ou=users,o=novell" "cn=USER-NAME,ou=otherusers,o=novell");

There is no need to change cn=USER-NAME, if uid is used as your naming attribute, it can be specified using the next value: $wgLDAPSearchAttributes

$wgLDAPSearchAttributes = array( "wikidemo"=>"uid" );

This sets the wiki to use contextless login. If your accounts do not have the uid set and all accounts do have unique cn's; the $wgLDAPSearchAttributes can be changed to:

$wgLDAPSearchAttributes = array( "wikidemo"=>"cn" );
  • Note:Experience learns that using 'uid' does create the needed user id for new users in the wiki database, when leveraging ldap for authentication of these (new) users. Otherwise when using 'cn', this does not on the fly create the needed id in the local wiki database.
  • Note:If you enable this, you must disable $wgLDAPSearchStrings = array( "wikidemo"=>"cn=USER-NAME,ou=users,o=novell" );

 

$wgLDAPUseSSL = array( "wikidemo"=>"ssl" );

Turns on SSL. SSL or TLS should only be turned off for for testing/troubleshooting. Available options are "ssl", "tls" and "clear"; the default is "tls".

$wgLDAPUseLocal = false;

This allows users to also login with a users name and password that is valid in MediaWiki's own identity store. *The admin user name and password created during the installation of MediaWiki are in this store, so changing this to true can provide a backdoor into the wiki in case of a directory outage. false is the default, so defining this isn't truly needed.

$wgLDAPAddLDAPUsers = array( "wikidemo"=>"false" );

Disables the ability for MediaWiki to create new users via LDAP; false is the default, so defining this isn't truly needed.

  • Many wikis leave this on to make it easy to register and start collaborating
  • Most network administrators with due levels of paranoia think this is insane.



$wgLDAPUpdateLDAP = array( "wikidemo"=>"false" );

Disables the ability for MediaWiki to update existing users (passwords) via LDAP; false is the default, so defining this isn't truly needed. Since MediaWiki does not have policy enforcement for strong passwords, this option is important to eDirectory administrators

$wgLDAPMailPassword = array( "wikidemo"=>"false" );

Disables the ability for MediaWiki to email a temporary password to users; false is the default, so defining this isn't truly needed.

$wgLDAPRetrievePrefs = array( "wikidemo"=>"false" );

Disables the ability for MediaWiki retrieve LDAP preferences; false is the default, so defining this isn't truly needed.

$wgMinimalPasswordLength = 1;

Before MediaWiki will even try and authenticate to eDirectory it will make sure the user entered a password that is at least 'x' characters

  • This can help reduce bogus directory authentication attempts coming from your wiki
  • This absolutely should be a minimum of 1, unless you want anyone to be able to log into your wiki

Group-based Authentication

Group-based authentication restricts access to just the users who are members of a specific group.

Group-based authentication works for either contextful or contextless login.

  • If you use contextful login, you must specify all containers that your users may exist in. (The login simply looks at the user object's "uniquemember" attribute.

To enable group-based authentication for an eDirectory group called "wikigroup" (DN=.wikigroup.users.novell), add the following line to localSettings.PHP:

$wgLDAPGroupDN = "cn=wikigroup,ou=users,o=novell";

The authors could not get more than one group to work. If you do, please update.

See: new-style group login restriction. The method shown above uses the deprecated style of group login restriction.


See Also

Retrieved from "http://wiki.novell.com/index.php/Using_eDirectory_to_control_access_to_MediaWiki"
Última atualização em Seg, 30 de Novembro de 2009 09:03
 
Tutorial Subversion PDF Imprimir E-mail
Seg, 23 de Novembro de 2009 15:16

Após sofrer um pouco com a utilização do subversion, fiz este tutorial para facilitar minha vida e para ajudar também alguém que possa precisar.

Para este tutorial levamos em consideração que o subversion já está instalado e configurado no servidor. A partir daí seguem alguns comandos básicos (executados no terminal) para efetuar a criação e utilização de repositórios do subversion no linux.

No subversion, não existe a revisão de um determinado arquivo. Os arquivos não tem versões independentes. Todos os arquivos são parte de uma mesma revisão, e a modificação de um único arquivo altera a revisão de todos.

O subversion é um sistema de controle de versões que utiliza o conceito de branches, tags e trunk. Abaixo seguem alguns conceitos para melhor compreensão:

Trunk

A pasta trunk contém os projetos que estão em desenvolvimento. Todas as atualizações efetuadas dia-a-dia são armazenadas na pasta trunk.

Branches

A pasta branches é aquela que contém “linhas de desenvolvimento” de tal projeto, que entre elas podem haver poucas diferenças, porém uma independe da outra.

Quando a equipe decide que o projeto está pronto para ser liberado como uma versão, a pasta trunk é copiada para a pasta branch e dado um nome de versão. Este branch é congelado e não sofre mais alterações, apenas correções. Rigorosos testes são efetuados.

Tags

Quando os testes efetuados encima de um branch estão completos, a versão que se encontra no branch é copiada para a pasta tags, formando assim um “releaseou uma versão “liberada. Esta pasta tag é empacotada e enviada para o cliente. Qualquer modificação em branch, deve ser copiada para a pasta de tags, após todos os testes.

Svn considera tag apenas uma variação de um branch, e na prática é exatamente como um branch, apenas uma cópia da ramificação atual da árvore.

 

svnadmin

Uma ferramenta para criar, ajustar ou reparar um repositório Subversion.

Criando um repositório

svnadmin create
ou
svnadmin create /

 

*Para alterar alguma coisa no repositório é necessário, após a criação, baixar uma cópia de trabalho, através do comando “checkout”, alterar e usar o comando “commit” para enviar alterações.

 

svnserve

Um programa servidor independente, que roda como um processo daemon ou pode ser invocado via SSH. É um modo de tornar o repositório disponível na rede.

Tornando o repositório disponível na rede através do protocolo svn

svnserve -d -r

 

Desta forma, pode-se acessar o repositório de outras máquinas, através do ip ou hostname.

svn ls svn://

svn

O programa cliente para linha de comando.

Comandos para as funcionalidades do controle de versão (checkout, commit, update, etc.)

 

*Cada comando possui subcomandos para ações específicas.

 

Importando arquivo ou conteúdo de diretório para o repositório

 

svn import svn:// -m
ou
svn import file:/// -m *É necessario o uso de um protocolo (svn, file, etc.), pois o svn só trabalha com url’s.

 

*Ao importar um diretório, para usar o conceito de branch, tag e trunk, é necessário que se importe uma pasta à qual contém o projeto a ser armazenado no repositório contendo as pastas branch e tag (ambas vazias) e trunk (com os arquivos do projeto).

 

Adicionando arquivos ou diretórios

svn add

 

*Os arquivos serão adicionados ao repositório no próximo commit.

Removendo arquivos do repositório

svn rm
svn commit *Exclui da cópia local e dá um commit para o repositório

 

ou
svn rm *Para excluir diretamente do repositório
 

Listar todos os repositórios disponíveis no servidor srvbuild.

 

svn ls
ou
svn list

 

Há também outra forma de listar o conteúdo do repositório, passando diretamente o caminho onde ele se encontra no disco.

 

svn ls file:///

 

Outros parâmetros podem ser passados, como formas diferentes de listar o conteúdo do repositório.

 

svn ls –recursive *Desce recursivamente aos conteúdos de cada diretório
svn ls –verbose *Lista informações adicionais
 

Baixar uma cópia dos arquivos disponíveis no repositório

 

svn co
ou
svn checkout

 

Adicionalmente podem ser passados alguns parâmetros para baixar revisões específicas.

 

svn co svn:/// -r
ou
svn co file:/// -r *Neste caso para acessar diretamente o local onde se encontra o repositório

 

Visualizar informações referentes à uma cópia de trabalho ou item remoto

 

svn info
ou
svn info
 

Atualizar uma cópia local com a disponível no repositório

 

svn update *Se estiver na pasta local de trabalho
ou
svn update

 

Listar modificações feitas na cópia de trabalho.

svn diff *Se estiver na pasta local de trabalho
ou
svn diff

svn diff lista as linhas dos arquivos que sofreram modificações daquelas que estão no repositório.

 

Listar os arquivos modificados na cópia de trabalho

svn status *Se estiver na pasta local de trabalho
ou
svn status

svn status lista os arquivos que sofreram modificações daqueles que estão no repositório.

 

Enviar as alterações efetuadas na cópia local para o repositório.

 

svn commit -m *Se estiver na pasta à qual possui os arquivos locais do repositório
ou
svn commit -m *A frase é o relato das alterações que estão sendo postadas

 

 

Liberar uma “release” para o repositório

Após efetuar todos os testes encima do projeto em desenvolvimento o mesmo deve ser disponibilizado como uma cópia estável para a pasta branches do projeto que está sendo desenvolvido. Para isso, é necessário fazer um checkout da ultima versão do projeto no repositório e simplesmente copiar a pasta trunk para dentro da pasta branches.

 

Trabalhando com a cópia local:

svn checkout /

    cd

svn copy trunk branches/ *Copiando a pasta trunk para a pasta branches
svn status *Para listar os arquivos que sofreram modificações.
svn commit *Somente agora as alterações vão para o repositório

 

Trabalhando diretamente no repositório

O comando svn copy pode operar sobre diretórios ou diretamente sobre as URL’s do repositório.

svn copy //trunk //branches -m

 

Visualizar logs de alterações

svn log *Mostra as descrições das alterações feitas nos arquivos ou diretórios
ou
svn log –verbose *Mostra as descrições e os arquivos que sofreram alterações

Propriedades

É possível a atribuição de propriedades à arquivos ou diretórios contidos no repositório.

Listar propriedades de um projeto

svn propget
ou
svn status *Se estiver na pasta à qual possui os arquivos locais do repositório
ou
svn status

 

Setar propriedades em um projeto

svn propset copyright ‘’ svn://srvbuild/repos/sgiapi-testes
ou
svn propset -R
ou
svn propset -F

 

*As propriedades devem ser setadas em uma cópia local, e realizar commit para efetivação no repositório.

 

Existem vários tipos de propriedades definidas pelo subversion que podem ser atribuidas aos projetos.

Ligações Externas (svn:externals)

 

As definições externas são um tipo especial de propriedades, que criam um link à arquivos em outro local no repositório. São um mapeamento de um diretório local para a URL.

 

Alguns comandos para trabalhar com definições externas:

 

 

Setar a propriedade svn:externals para uma cópia local

svn propset svn:externals “ ”
svn commit *Para enviar as ligações externas ao repositório

 

Desta forma, é criado um link à pasta dentro do fazendo com que, após o commit, sem que se realize um checkout sobre o repositório, automaticamente se baixe os fontes referentes à definição externa. É bastante útil, caso possua uma API, ou libs que sejam necessários para vários projetos. Sendo que quando se realiza manutenção sobre a API ou sobre as libs, a mesma se aplica a todos os projetos que fazem dela uma definição externa.

Listar Ligações externas à um projeto

svn propget svn:externals

 

 

*Lembrando que os exemplos entre “” deverão ser substituídos pelo caminho do arquivo ou diretório ou url.

 

Fonte:  http://samuca.wordpress.com/2007/04/12/tutorial-subversion/

 


 
Página 1 de 6
Free template 'I, Gobot' by [ Anch ] Gorsk.net Studio. Please, don't remove this hidden copyleft!