Version Control & Packaging

Extract an RPM Package

We can use rpm2cpio to extract an rpm package:

$ rpm2cpio ../libstdc++-4.3.0-8.x86_64.rpm | cpio -idv

This page http://www.rpm.org/max-rpm/s1-rpm-miscellania-rpm2cpio.html shows more example on how to use rpm2cpio.

Repository for Subversion over SSH Disappeared after Subversion Upgrade

This might happen for svn over ssh. After the subversion upgrade, we started to get

svn: No repository found in 'svn+ssh://...'

To fix this, go to the svn server, and do the following:

# cd /usr/bin
# ls -l svn*

If you don't see the soft link of svnserve linking to your customized "svnwrapper.sh" (or whatever file name you call it), then do this:

# mv svnserve svnserve-daemon
# ln -s /usr/local/bin/svnwrapper.sh svnserve

This should fix it.

HowTo Create A Patch File For A RPM

This article is pretty useful. One minor fix to it, is the %patch line should be 

%patch0 -p1

 

 

HowTo Create A Patch File For A RPM 

Query Installed RPM Packages

List Installed RPMs by Install Date

A simple way to do is like this:

$ rpm -qa --last | less

A more complex way is like this:

$ rpm -qa --queryformat '%{installtime} (%{installtime:date}) %{name}\n' | sort -n | less

In the above example, the "%{installtime:date}" specifies that the installtime should be formatted as a date string. Otherwise, it's the time_t seconds since Jan 1, 1970 (which is great for sorting, but not for reading).

YUM Complains about Package "from installed has depsolving problems"

On a CentOS-5-i386 server, when I did "yum update", I got

perl-Module-Install-0.92-1.el5.rf.noarch from installed has depsolving problems

The entire error message is like below:

Yum Update "can't start new thread" in OpenVZ Container

In one of my OpenVZ containers, when I tried to run "yum update" today, I kept getting the error "can't start new thread". The entire error message is like this:

Loaded plugins: fastestmirror

Install and Configure Subversion over SSH on CentOS

Server setup

  1. Install subversion
    root# yum install subversion
  2. Create a Repository. This is where all your files will be stored. You can put this anywhere, such as /var/subversion/repos/mycodes
    root# svnadmin create /var/subversion/repos/mycodes
    root# cd /var/subversion/repos/mycodes/conf
    root# vi svnserve.conf

    Now add the following into the file svnserve.conf:
    anon-access = none

Set Subversion Properties

This page explains how to set svn props: http://svnbook.red-bean.com/en/1.1/ch07s02.html

  • To set the $Id$ property, we do
    $ svn propset svn:keywords "Id" filename
  • To set executable on a file, we do
    $ svn propset svn:executable on filename

svn: This client is too old to work with working copy

Once in a while, I ran into this error with subversion:

svn: This client is too old to work with working copy ...

There are a couple of senarios:

1. The subversion is indeed too old, then we just upgrade it.

2. We temporarily tried a newer version of subversion. And the trial upgraded the format of the svn metadata.

3. We copied (rsync) the entire directory from another server that has a higher subversion.