Re: debcheckout -a 码云 仓库 配置
Boyuan Yang <[email protected]> Tue, 24 Oct 2023 23:53:16 -0400
| Newsgroups | gmane.linux.debian.user.chinese.gb |
|---|---|
| Organization | Debian Project |
| Message-ID | <[email protected]> |
在 2023-10-25星期三的 10:14 +0800,xiao sheng wen(肖盛文)写道: > 大家好! > > 使用 debcheckout -a 可以直接设置好仓库提交权限的 URL。 > > man debcheckout 看到有个 DEBCHECKOUT_AUTH_URLS 变量可以增加自定义的 git > 仓库设置: > > DEBCHECKOUT_AUTH_URLS > This variable should be a space separated list of Perl regular > expressions and replacement texts, which must come in pairs: > REGEXP > TEXT REGEXP TEXT ... and so on. Each pair denotes a substitution > which is applied to repository URLs if other built-in means of > building URLs for authenticated mode (see -a) have failed. > > References to matching substrings in the replacement texts are > allowed as usual in Perl by the means of $1, $2, ... and so on. > > This setting is used to configure the "authenticated mode" > location > for repositories. The Debian repositories on > salsa.debian.org are > implicitly defined, as is github.com. > > Here is a sample snippet suitable for the configuration files: > > DEBCHECKOUT_AUTH_URLS=' > ^\w+://(svn\.example\.com)/(.*) svn+ssh://$1/srv/svn/$2 > ^\w+://(git\.example\.com)/(.*) git+ssh://$1/home/git/$2 > ' > > 想请教大家下, 该如何设置 码云 的这个正则表达式呢? > > 如: > > debcheckout -a atzlinux-update-patch > can't use authenticated mode on repository > 'https://gitee.com/atzlinux/atzlinux-update-patch.git' since it is not a > known repository (e.g. salsa.debian.org) > > 报错,希望能够设置为: > > [email protected]:atzlinux/atzlinux-update-patch.git 自己要设置的话本质上和手册页里的示例没什么区别:REGEXP 和 TEXT 两部分,REGEXP 中将示例的 svn.example.com 替换成 gitee 的域名,TEXT 中搭好 ssh 克隆使用的字符串的骨架(也就是 username@domain:user/repo.git 这样)然后仍然是 $1 替换域名 $2 替换冒号之后的字符串,唯一注意一下 @ 符号要转义即可。 谢谢, Boyuan Yang
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEfncpR22H1vEdkazLwpPntGGCWs4FAmU4kSwACgkQwpPntGGC Ws6A+xAAmXdMePh5sihs1lwqzYKtyzA9iZAI+J7uxGfs4wDH5EzfdFRUyI2YFTga rFeaLABFkp2bYI+wk3ms9sAaVc02hSkRUxmLxFILq2Doyy7b2hynaBhn5h8ETmCn 8wL/34ejMcxbrWp3tAD7mtkEmmSVndH7YEuNJC4VLaZKNirQT0JcH2G5jR6+IhCW x22mBxmVlQtxNVEvxY040o+j+h1lwJz004MF3Oep4XRtHiqm5TRuPyUVBeb8UaYH dbyruyqttQbVcKoA/n9Nb7fjOC1VEMkuniPOunt82FZVMDd7gEzdmma9mVGDCNBF rn20ldz0IyrpAA+B3e9W0dg4z1ELOvP7a6Ll82tTTRl0z4rJVYFLNsNocUpJOu9I PpeNanobq3ANjOjS6l57LI0NJdkx61rzgbjArI6CDaNgxfeKxsrOsgZsZbpihSQa mo32+ZfQt43OH+wnzy1D7hvW/n3aPEbzFInPExGR32jfYo3KGyt1IAknuOXbjQk2 xFJD1Ny0MjW1tyQJaQc2bGwf+JgqOvagY4LObsDQ/BI/noHxkwxFriZBP5+J7Tku KYP/9ZK6FAIcvFmxhnJnDRsazbjQFFBXq7gKfjnKsd0V/Yx6HJXVwsH6nuJCrP7o 3eUIH2YmSg9QWA84UD95y6GnJ0dXvGISJo8ogi4BNPxRyB3E7c0= =aMd7 -----END PGP SIGNATURE-----