19 Aug 2022 |
@janne.hess:helsinki-systems.de | @@ -119,7 +119,7 @@ sub parse_nix_file($nix_file, $cb=undef) { # Parses a perl-packages.nix file
my $nix = Mojo::File->new($nix_file)->slurp;
my (@ret);
- while ($nix =~ m/((\w+)\s+=\s+buildPerl(Package|Module)\s+(?:rec)?\s*)
+ while ($nix =~ m/(([^\s]+)\s+=\s+buildPerl(Package|Module)\s+(?:rec)?\s*)
($RE{balanced}{-parens=>'{}'})/gx) {
my ($prepart, $attrname, $build_fun, $part) = ($1, $2, $3, $4);
if ($cb) {
| 14:07:58 |
@janne.hess:helsinki-systems.de | not sure if that is too open though | 14:08:02 |
stigo |
| 14:08:15 |
stigo | * @@ -118,7 +118,7 @@ sub parse_nix_file($nix_file, $cb=undef) { # Parses a perl-packages.nix file
my $nix = Mojo::File->new($nix_file)->slurp;
my (@ret);
- while ($nix =~ m/((\w+)\s+=\s+buildPerl(Package|Module)\s+(?:rec)?\s*)
+ while ($nix =~ m/(([\w-]+)\s+=\s+buildPerl(Package|Module)\s+(?:rec)?\s*)
($RE{balanced}{-parens=>'{}'})/gx) {
my ($prepart, $attrname, $build_fun, $part) = ($1, $2, $3, $4);
if ($cb) {
| 14:08:20 |
stigo | \w is probably too open too | 14:08:43 |
@janne.hess:helsinki-systems.de | yeah your whitelist approach is probably better than my blacklist approach | 14:08:44 |
stigo | allowlist you mean? :) | 14:08:54 |
@janne.hess:helsinki-systems.de | In reply to @stigo:matrix.org \w is probably too open too okay what is an identifier :/ | 14:08:58 |
stigo | [A-Za-z0-9_-] is probably better | 14:09:20 |
stigo | prefer being explicit when matching stuff | 14:09:34 |
stigo | but would be nicer to get the code from nix itself i think | 14:09:53 |
stigo | rather than parsing it with regexps, if that's possible | 14:10:13 |
stigo | (oh, the attributes can be optionally quoted too...) | 14:11:05 |
@janne.hess:helsinki-systems.de | In reply to @stigo:matrix.org rather than parsing it with regexps, if that's possible nix eval --impure --raw --expr 'builtins.concatStringsSep " " (builtins.attrNames (import ./. {}).perlPackages)' | 14:11:24 |
@janne.hess:helsinki-systems.de | better: nix eval --impure --json --expr 'builtins.attrNames (import ./. { config.allowAliases = false; }).perlPackages' | 14:12:18 |
stigo | https://github.com/NixOS/nixpkgs/pull/187480 <-- feel like patching HTTP::Tiny so it verifies TLS connections by default :) | 17:49:44 |
@qbit:tapenet.org | nice! | 18:26:09 |
@qbit:tapenet.org | i was following a thread on the perl mailing list that was talking about enabling tls by default.. but i can't find it now.. did that happen? | 18:29:20 |
@qbit:tapenet.org | dang: https://marc.info/?t=163769025000001&r=1&w=2 nope | 18:33:35 |
stigo | Probably not yet, perl is usually quite deeply rooted in dependency trees.. openssl requires perl to build for instance. | 18:34:07 |
@qbit:tapenet.org | right, but that build doesn't have to include openssl :D | 18:34:36 |
stigo | Very true, i totally agree that tls should be available in perl's core by default | 18:35:12 |
stigo | the issue became highlighted after the GPG signature scheme on cpan was shown to be quite broken | 18:36:04 |
@qbit:tapenet.org | ahh | 18:36:18 |
@qbit:tapenet.org | https://gist.github.com/afresh1/c4ac35cdd29e6b2cd15eef38246c4c71 <-- my fav approach so far :D | 18:36:26 |
stigo | Nice :D | 18:36:47 |
stigo | btw, I've been looking at creating a replacement for the (also somewhat broken) Module::Signature module using openssh instead of gpg (very early work though) https://github.com/stigtsp/CPAN-Author-Signature | 18:38:49 |
stigo | * btw, I've been looking at proposing an alternative to the (also somewhat broken) Module::Signature module using openssh instead of gpg (very early work though) https://github.com/stigtsp/CPAN-Author-Signature | 18:39:15 |
@qbit:tapenet.org | awesome! | 18:39:38 |
stigo | it uses metacpan -> (github|gitlab|foobar) as a trust root for ssh keys etc | 18:40:44 |