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

watch files



Yesterday I started to improve a couple of watch files in our
repository:

* first I changed all URLs pointing to
  http://mirrors.kernel.org/cpan/modules/by-module/ ... because of
  the timeouts this server has
* then I changed the URLs containing /authors/ because they don't
  match anymore if the maintainer of a module changes

For all changed URLs I've used the dist-based scheme, which is also
used by current dh-make-perl:
http://search.cpan.org/dist/Module-Name/ .*/Module-Name-([[:digit:]].*)\.tar\.gz

At that point I saw that there are quite a lot of watch files
referring to URLs with /by-authors/, and I decided to spend my time
on scripting the changes instead of manually fixing them all :)

What I've done (with the help of dam, Tincho and SquOnk on irc) is to
extend the packagecheck script (in svn under /scripts/qa); the new
test kicks in if the URL in debian/watch doesn't match
search.cpan.org/dist and then changes any cpan-related URL to the
above mentioned scheme. This affects /by-module/ URLs as well. [0]

Some questions before I actually run the script:
* Are there any general objections against using the newer scheme for
  the URLs or changing many watch files?
* Is the current approach to create the version regex sane?
* What shall we do about the "trailing part" ('debian uupdate' or
  similar)? It's hardly used, and I'd personally prefer to remove it
  to get more consistency but there might be others who actually
  like/use it.
* Any other comments?


As always: Please feel free to improve/rewrite/.. the script!


Cheers,
gregor
  

[0]
Currently the stanza reads:

	# 6) watchfile
	if [ -e $TRUNK/$p/debian/watch ] && ! grep search\.cpan\.org/dist/ $TRUNK/$p/debian/watch >/dev/null; then
		echo "$p: trying to change URL in debian/watch"
		if perl -i -e "my \$changed=1; while(<>){ \$changed=0 if s{^(?:ht|f)tp://.*cpan.+/(\S+)-(?:\S+)(\s.+)?$}{http://search.cpan.org/dist/\$1/ .*/\$1-v?([\\\\d._]+)(?:\\\\.tar\\\\.gz|\\\\.tgz)\$2}; print;} exit \$changed" $TRUNK/$p/debian/watch ; then
			perl -pi -e "s;^version=2;version=3;" $TRUNK/$p/debian/watch
			MSG_WATCH="debian/watch: use dist-based URL."
			CHANGED=1
		fi
	fi

-- 
 .''`.   http://info.comodo.priv.at/ | gpg key ID: 0x00F3CFE4
 : :' :  debian: the universal operating system - http://www.debian.org/
 `. `'   member of https://www.vibe.at/ | how to reply: http://got.to/quote/
   `-    NP: Pink Floyd: In The Flesh

Attachment: signature.asc
Description: Digital signature


Reply to: