pkg repo woes

PMc

Daemon

Reaction score: 626
Messages: 1,284

The manpage pkg-repo() states:

Code:
     To create a package repository catalogue, specify the top-level directory
     beneath which all the packages are stored as repo-path.  pkg repo will
     search the filesystem beneath repo-path to find all the packages it
     contains.  Directories starting with ‘.’ or named Latest are not
     traversed.

Sadly, this is not true. Only some directories starting with '.' are not traversed. Specifically, those with more than one letter after the '.'

This seems to be a widespread "anti-pattern": in order to avoid grabbing .. togheter with .*, people seem to require at least two charaters after the dot. Example.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 11,625
Messages: 37,973

in order to avoid grabbing .. together with .*, people seem to require at least two characters after the dot. Example.
.[^.]* is better in my opinion.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 11,625
Messages: 37,973

To delete . directories I always use ".??*"
This won't delete a file or directory named .a or .b for example. The question marks are 1 character, so .??* requires at least two characters after the dot.
 
OP
PMc

PMc

Daemon

Reaction score: 626
Messages: 1,284

The point here is: the ports-mgmt/pkg should be a compiled binary, and not do shell globbing. I think I do not want to look into that code...
 
Top