Package: myrepos
Version: 1.20180726
Severity: normal

Dear Maintainer,

when the .mrconfig file contains a URL from the
[sr.ht](https://sourcehut.org) forge it doesn't recognise it as
trusted.

For example, if I have this in .mrconfig:

    [builds.sr.ht]
    checkout = git clone 'https://git.sr.ht/~sircmpwn/core.sr.ht' 'core.sr.ht'

and run the `mr update` command, I get:

    mr: illegal checkout command "git clone 
'https://git.sr.ht/~sircmpwn/core.sr.ht' 'core.sr.ht'" in untrusted 
<somewhere>/.mrconfig line 3
    (To trust this file, list it in ~/.mrtrust.)

It seems this is because of the "unusual" tilde character in the URL.
The mr source has the following regex in `is_trusted_checkout`:

    # Match all the typical characters found in
    # urls, plus @ which svn can use. Note
    # that the "url" might also be a local
    # directory.
    $match=(
        defined $words[$c] &&
        $words[$c] =~ /^[-_.+:@\/A-Za-z0-9]+$/
    );
    $url=$words[$c];

My guess is adding "~" to the character class would fix the issue.

Thanks,
--Daniel

-- System Information:
Debian Release: 10.3
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-3-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en 
(charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages myrepos depends on:
ii  perl  5.28.1-6

Versions of packages myrepos recommends:
ii  libfile-homedir-perl  1.004-1
ii  libhtml-parser-perl   3.72-3+b3
ii  libio-pty-easy-perl   0.10-1
ii  libwww-perl           6.36-2

Versions of packages myrepos suggests:
pn  ack | ack-grep    <none>
ii  bzr               2.7.0+bzr6622-15
ii  curl              7.64.0-4+deb10u1
ii  cvs               2:1.12.13+real-27
ii  darcs             2.14.1-3
pn  dgit              <none>
pn  fossil            <none>
ii  git [git-core]    1:2.20.1-2+deb10u3
ii  git-annex         7.20190129-3
pn  git-big-picture   <none>
ii  git-svn           1:2.20.1-2+deb10u3
pn  kdesdk-scripts    <none>
ii  liburi-perl       1.76-1
ii  mercurial         4.9-2
ii  perl-doc          5.28.1-6
ii  stow              2.2.2-1
ii  subversion        1.10.4-1+deb10u1
pn  subversion-tools  <none>
ii  tig               2.4.1-1
ii  unison            2.48.4-1+b1
ii  vcsh              1.20151229-1
ii  xdg-utils         1.1.3-1

-- no debconf information

Reply via email to