[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: copypage.pl errors



On Fri, Oct 15, 2010 at 07:09:03PM +0200, Helge Kreutzmann wrote:
> if ( $line =~ /Repository revision:\s+(\d+)\.(\d+)\s+(.*)$/ )  {
> later on (line 363) the variable is undefined and the else branch is
> matched. However, I don't understand the logic. I can only guess that
> different CVS versions (from squeeze?) yield different output.

No, the problem is with the logic. I based the check on the return value of
CVS, when actually it will return '0' (OK) value when the checked file does not
exist but the directory is under version control. I.e.:

------------------------------------------------------------------
jfs@silicio:webwml$ cvs status spanish/noexist/noexist ; echo $?
cvs [status aborted]: no such directory `spanish/noexist'
1
jfs@silicio:webwml$ cvs status spanish/Bugs/noexist ; echo $?
cvs status: nothing known about `spanish/Bugs/noexist'
===================================================================
File: no file noexist       Status: Unknown

   Working revision:    No entry for noexist
   Repository revision: No revision control file

0
------------------------------------------------------------------

The script covered perfectly fine the first cased, but not the second (more
common) one. As David pointed out.

> > please, can someone help me?
> 
> I CC'ed the developer of this code, it is relativly new so maybe buggy
> or only tested in Squeeze. Are you using Stable?

No, I'm using sid. It is a bug in the script.

I've made some changes in the script to try to clarify what it does and fixed
the above bug. The changes are wider than the patch provided by David, you
can check them out here:
http://cvs.debian.org/webwml/webwml/copypage.pl?r1=1.32&r2=1.36

Note that I have also added a new command line switch (-n) that disables this
check in case somebody wants to extensively use copypage while offline, as
the CVS timeouts are quite cumbersome if you are not connected.

Please check it out and let me know if any other issues show up.

Regards

Javier

Attachment: signature.asc
Description: Digital signature


Reply to: