# A normal watch file should not have multiple entries but the
# rfc822-style highlighting is mostly stateless so we abuse it a
# little for the faceup test.

# The examples are from debian-watch(5).

# HTTP site (basic)
Version: 5

Source: http://example.com/~user/release/@PACKAGE@.html
Matching-Pattern: files/@PACKAGE@@ANY_VERSION@@ARCHIVE_EXT@

#
Version: 5

Source: http://example.com/~user/release/foo.html
Matching-Pattern: files/foo-([\d\.]+)\.tar\.gz


# HTTP site (Pgp-Sig-Url-Mangle)
Version: 5

Source: http://example.com/release/@PACKAGE@.html
Matching-Pattern: files/@PACKAGE@@ANY_VERSION@@ARCHIVE_EXT@
Pgp-Sig-Url-Mangle: s%$%.asc%

#
Version: 5

Source: http://example.com/release/@PACKAGE@.html
Matching-Pattern: files/@PACKAGE@@ANY_VERSION@@ARCHIVE_EXT@
Pgp-Sig-Url-Mangle: s%@ARCHIVE_EXT@$%.asc%
Decompress: yes


# HTTP site (Pgp-Mode: next/previous)
Version: 5

Source: http://example.com/release/@PACKAGE@.html
Matching-Pattern: files/(?:\d+)/@PACKAGE@@ANY_VERSION@@ARCHIVE_EXT@
Pgp-Mode: next

Source: http://example.com/release/@PACKAGE@.html
Matching-Pattern: .*?files/(?:\d+)/@PACKAGE@@ANY_VERSION@@SIGNATURE_EXT@
Pgp-Mode: previous
Version-Schema: previous


# HTTP site (flexible)
Version: 5

Source: http://example.com/DL/
Matching-Pattern: files/(?:\d+)/@PACKAGE@@ANY_VERSION@@ARCHIVE_EXT@
Pgp-Mode: next

Source: http://example.com/DL/
Matching-Pattern: files/(?:\d+)/@PACKAGE@@ANY_VERSION@@SIGNATURE_EXT@
Pgp-Mode: previous
Version-Schema: previous


# HTTP site (basic MUT)
Version: 5

Source: http://example.com/release/foo.html
Matching-Pattern: files/foo-@ANY_VERSION@@ARCHIVE_EXT@
Pgp-Sig-Url-Mangle: s%$%.sig%

Component: bar
Source: http://example.com/release/foo.html
Matching-Pattern: files/foobar-@ANY_VERSION@@ARCHIVE_EXT@
Pgp-Sig-Url-Mangle: s%$%.sig%
Version-Constraint: same

Component: baz
Source: http://example.com/release/foo.html
Matching-Pattern: files/foobaz-@ANY_VERSION@@ARCHIVE_EXT@
Pgp-Sig-Url-Mangle: s%$%.sig%
Version-Constraint: same


# HTTP site (recursive directory scanning)
Version: 5

Source: http://tmrc.mit.edu/mirror/twisted/Twisted/@ANY_VERSION@/
Matching-Pattern: Twisted-@ANY_VERSION@@ARCHIVE_EXT@
Dirversion-Mangle: s/-PRE/~pre/;s/-RC/~rc/
Pgp-Sig-Url-Mangle: s%$%.sig%


# HTTP site (alternative shorthand)
Version: 5

Source: http://www.cpan.org/modules/by-module/Text/
Matching-Pattern: Text-CSV_XS-@ANY_VERSION@@ARCHIVE_EXT@
Pgp-Sig-Url-Mangle: s%$%.sig%

#
Version: 5

Source: http://www.cpan.org/modules/by-module/Text/
Matching-Pattern: Text-CSV_XS-@ANY_VERSION@@ARCHIVE_EXT@
Pgp-Sig-Url-Mangle: s%$%.sig%


# HTTP site (funny version)
Version: 5

Source: http://www.site.com/pub/foobar/
Matching-Pattern: foobar_v(\d+)_(\d+)@ARCHIVE_EXT@


# HTTP site (DFSG)
Version: 5

Source: http://some.site.org/some/path/
Matching-Pattern: foobar-@ANY_VERSION@@ARCHIVE_EXT@
Dversion-Mangle: s/\+dfsg\d*$//
Repacksuffix: +dfsg


# HTTP site (Filename-Mangle)
Version: 5

Source: http://foo.bar.org/dl/
Matching-Pattern: \?path=&dl=foo-@ANY_VERSION@@ARCHIVE_EXT@
Filename-Mangle: s/.*=(.*)/$1/

#
Version: 5

Source: http://foo.bar.org/dl/
Matching-Pattern: \?path=&dl_version=@ANY_VERSION@
Filename-Mangle: s/.*=(.*)/foo-$1\.tar\.gz/

#
Version: 5

Source: http://foo.bar.org/dl/@ANY_VERSION@/
Matching-Pattern: foo.tar.gz
Filename-Mangle: s|.*/dl/(.*)/foo\.tar\.gz|foo-$1\.tar\.gz|


# HTTP site (Download-Url-Mangle)
Version: 5

Source: http://developer.berlios.de/project/showfiles.php?group_id=2051
Matching-Pattern: http://prdownload.berlios.de/softdevice/vdr-softdevice-@ANY_VERSION@@ARCHIVE_EXT@
Download-Url-Mangle: s/prdownload/download/


# HTTP site (Oversion-Mangle, MUT)
Version: 5

Source: http://example.com/~user/release/foo.html
Matching-Pattern: files/foo-@ANY_VERSION@@ARCHIVE_EXT@
Oversion-Mangle: s/(.*)/$1+dfsg/

Component: bar
Source: http://example.com/~user/release/foo.html
Matching-Pattern: files/bar-@ANY_VERSION@@ARCHIVE_EXT@
Version-Constraint: same


# HTTP site (Page-Mangle)
Version: 5

Source: href=/g"
Matching-Pattern: http://example.com/release/foo.html
Page-Mangle: "s/<a\s+bogus=/<a
Version-Constraint: files/@PACKAGE@@ANY_VERSION@@ARCHIVE_EXT@

#
Version: 5

Source: http://example.com/release/foo.html
Matching-Pattern: (?:.*)/@PACKAGE@@ANY_VERSION@@ARCHIVE_EXT@
Page-Mangle: s%<Key>([^<]*)</Key>%<Key><a href="$1">$1</a></Key>%g


# FTP site (basic)
Version: 5

Source: ftp://ftp.tex.ac.uk/tex-archive/web/c_cpp/cweb/
Matching-Pattern: cweb-@ANY_VERSION@@ARCHIVE_EXT@


# FTP site (regex special characters)
Version: 5

Source: ftp://ftp.worldforge.org/pub/worldforge/libs/Atlas-C++/transitional/
Matching-Pattern: Atlas-C\+\+-@ANY_VERSION@@ARCHIVE_EXT@


# FTP site (funny version)
Version: 5

Source: ftp://ftp.ibiblio.org/pub/Linux/ALPHA/wine/development/
Matching-Pattern: Wine-@ANY_VERSION@@ARCHIVE_EXT@
Uversion-Mangle: s/^/0.0./


# sf.net
Version: 5

Source: https://sf.net/audacity/
Matching-Pattern: audacity-minsrc-@ANY_VERSION@@ARCHIVE_EXT@

#
Version: 5

Source: http://sourceforge.net/projects/audacity/files/audacity/@ANY_VERSION@/
Matching-Pattern: (?:.*)audacity-minsrc-@ANY_VERSION@@ARCHIVE_EXT@/download
Filename-Mangle: s%(?:.*)audacity-minsrc-(.+)\.tar\.xz/download%audacity-$1.tar.xz%
Uversion-Mangle: s/-pre/~pre/


# github.com
Version: 5

Template: Github
Owner: <user>
Project: <project>

#
Version: 5

Source: https://api.github.com/repos/<user>/<project>/git/matching-refs/tags/
Matching-Pattern: https://api.github.com/repos/[^/]+/[^/]+/git/refs/tags/@ANY_VERSION@
Download-Url-Mangle: s%(api.github.com/repos/[^/]+/[^/]+)/git/refs/%$1/tarball/refs/%g
Filename-Mangle: s%.*/@ANY_VERSION@%@PACKAGE@-$1.tar.gz%
Search-Mode: plain

#
Version: 5

Source: https://api.github.com/repos/<user>/<project>/git/matching-refs/tags/v1
Matching-Pattern: https://api.github.com/repos/[^/]+/[^/]+/git/refs/tags/@ANY_VERSION@
Download-Url-Mangle: s%(api.github.com/repos/[^/]+/[^/]+)/git/refs/%$1/tarball/refs/%g
Filename-Mangle: s%.*/@ANY_VERSION@%@PACKAGE@-$1.tar.gz%
Search-Mode: plain

#
Version: 5

Source: https://api.github.com/repos/<user>/<project>/git/matching-refs/tags/
Matching-Pattern: https://api.github.com/repos/[^/]+/[^/]+/git/refs/tags/@ANY_VERSION@
Download-Url-Mangle: s%api.github.com/repos/([^/]+/[^/]+)/git/refs/tags/@ANY_VERSION@%github.com/$1/archive/refs/tags/$2.tar.gz%g
Filename-Mangle: s%.*/@ANY_VERSION@%@PACKAGE@-$1.tar.gz%
Search-Mode: plain

#
Version: 5

Source: https://api.github.com/repos/<user>/<project>/releases?per_page=100
Matching-Pattern: https://api.github.com/repos/<user>/<project>/tarball/@ANY_VERSION@
Filename-Mangle: s%.*/@ANY_VERSION@%@PACKAGE@-$1.tar.gz%
Search-Mode: plain

#
Version: 5

Source: https://api.github.com/repos/ImageMagick/ImageMagick/git/matching-refs/tags/
Matching-Pattern: https://api.github.com/repos/[^/]+/[^/]+/git/refs/tags/@ANY_VERSION@
Download-Url-Mangle: s%(api.github.com/repos/[^/]+/[^/]+)/git/refs/.*%$1/tarball/0123456789abcdf01234567890abcef012345678%g
Filename-Mangle: s%.*%1.2.3~git.tar.gz%
Oversion-Mangle: s/.*/1.2.3~git/g
Search-Mode: plain


# Forgejo (Codeberg)
Version: 5

Source: https://codeberg.org/api/v1/repos/<user>/<project>/releases
Matching-Pattern: https://codeberg.org/<user>/<project>/releases/download/[^/-_v]*@ANY_VERSION@/[^"]*@ARCHIVE_EXT@
Search-Mode: plain

#
Version: 5

Source: https://codeberg.org/api/v1/repos/<user>/<project>/releases
Matching-Pattern: https://codeberg.org/<user>/<project>/archive/[^"-_v]*@ANY_VERSION@@ARCHIVE_EXT@
Search-Mode: plain
Filename-Mangle: s%.*/[^"-_v]*@ANY_VERSION@%@PACKAGE@-$1%

#
Version: 5

Source: https://codeberg.org/api/v1/repos/<user>/<project>/tags
Matching-Pattern: https://codeberg.org/<user>/<project>/archive/[^"-_v]*@ANY_VERSION@@ARCHIVE_EXT@
Search-Mode: plain
Filename-Mangle: s%.*/[^"-_v]*@ANY_VERSION@%@PACKAGE@-$1%


# PyPI
Version: 5

Source: https://pypi.python.org/packages/source/c/cfn-sphere/
Matching-Pattern: cfn-sphere-@ANY_VERSION@@ARCHIVE_EXT@

#
Version: 5

Source: https://pypi.python.org/pypi/cfn-sphere/
Matching-Pattern: https://pypi.python.org/packages/.*/.*/.*/cfn-sphere-@ANY_VERSION@@ARCHIVE_EXT@#.*


# npmjs.org (node example)
Version: 5

Template: Npmregistry
Dist: @lemonldap/handler


# Grouped package
Version: 5
Version-Schema: group

Source: https://registry.npmjs.org/mongodb
Matching-Pattern: https://registry.npmjs.org/mongodb/-/mongodb-@ANY_VERSION@@ARCHIVE_EXT@
Search-Mode: plain

Component: bson
Source: https://registry.npmjs.org/bson
Matching-Pattern: https://registry.npmjs.org/bson/-/bson-@ANY_VERSION@@ARCHIVE_EXT@
Search-Mode: plain

Component: mongodb-core
Source: https://registry.npmjs.org/mongodb-core
Matching-Pattern: https://registry.npmjs.org/mongodb-core/-/mongodb-core-@ANY_VERSION@@ARCHIVE_EXT@
Search-Mode: plain

Component: requireoptional
Source: https://registry.npmjs.org/require_optional
Matching-Pattern: https://registry.npmjs.org/require_optional/-/require_optional-@ANY_VERSION@@ARCHIVE_EXT@
Search-Mode: plain

#
Version: 5
Version-Schema: checksum

Source: https://registry.npmjs.org/mongodb
Matching-Pattern: https://registry.npmjs.org/mongodb/-/mongodb-@ANY_VERSION@@ARCHIVE_EXT@
Search-Mode: plain

Component: bson
Source: https://registry.npmjs.org/bson
Matching-Pattern: https://registry.npmjs.org/bson/-/bson-@ANY_VERSION@@ARCHIVE_EXT@
Search-Mode: plain

Component: mongodb-core
Source: https://registry.npmjs.org/mongodb-core
Matching-Pattern: https://registry.npmjs.org/mongodb-core/-/mongodb-core-@ANY_VERSION@@ARCHIVE_EXT@
Search-Mode: plain

Component: requireoptional
Source: https://registry.npmjs.org/require_optional
Matching-Pattern: https://registry.npmjs.org/require_optional/-/require_optional-@ANY_VERSION@@ARCHIVE_EXT@
Search-Mode: plain


# direct access to the git repository (tags)
Version: 5

Source: http://git.ao2.it/tweeper.git
Matching-Pattern: refs/tags/v@ANY_VERSION@
Git-Mode: full
Mode: git


# direct access to the git repository (HEAD)
Version: 5

Source: https://github.com/Debian/dh-make-golang
Matching-Pattern: HEAD
Mode: git


# direct access to the git repository (with submodules)
Version: 5

Source: https://github.com/namespace/project
Matching-Pattern: [refs/tags/v@ANY_VERSION@|HEAD]
Git-Mode: shallow
Git-Modules: all
Mode: git

#
Version: 5
Source: https://github.com/namespace/project
Matching-Pattern: [refs/tags/v@ANY_VERSION@|HEAD]
Git-Mode: shallow
Git-Modules: m4;doc/common
Mode: git


# direct access to the Subversion repository (tags)
Version: 5

Source: svn://svn.code.sf.net/p/jmol/code/tags/
Matching-Pattern: @ANY_VERSION@\/
Mode: svn


# direct access to the Subversion repository (HEAD)
Source: svn://svn.code.sf.net/p/jmol/code/trunk/
Matching-Pattern: HEAD
Mode: svn


# Fossil
Version: 5

Source: http://grammalecte.net:8080/taglist
Matching-Pattern: /timeline\?t=@ANY_VERSION@
Download-Url-Mangle: s#/timeline\?t=(@ANY_VERSION@)#/tarball/Grammalecte.tar.gz?r=$1#
Filename-Mangle: s/timeline\?t=(@ANY_VERSION@)/@PACKAGE@-$1.tar.gz/
Search-Mode: plain


# Gitlab
Version: 5

Template: Gitlab
Dist: https://salsa.debian.org/debian/devscripts

#
Version: 5

Source: https://salsa.debian.org/debian/devscripts
Mode: gitlab
Matching-Pattern: @STABLE_VERSION@
Pgp-Mode: none
Filename-Mangle: s/.*(@ARCHIVE_EXT@)/@PACKAGE@.tar.gz/


# Examples from uscan-template(5)

# Github
Version: 5

Template: Github
Owner: guimard
Project: llng-docker
Version-Mangle: auto


# Metacpan
Version: 5

Template: Metacpan
Dist: MetaCPAN-Client


# Npmregistry
Version: 5

Template: Npmregistry
Dist: @lemonldapng/handler

#
Version: 5

Source: https://registry.npmjs.org/@lemonldapng/handler
Matching-Pattern: https://registry.npmjs.org/@lemonldapng/handler/-/handler-@ANY_VERSION@@ARCHIVE_EXT@
Search-Mode: plain


# Gitlab
Version: 5

Template: Gitlab
Dist: https://salsa.debian.org/debian/devscripts
