# pkg repo woes



## PMc (May 20, 2021)

The manpage pkg-repo() states:


```
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 (May 20, 2021)

PMc said:


> in order to avoid grabbing .. together with .*,  people seem to require at least two characters after the dot. Example.


`.[^.]*` is better in my opinion.


----------



## Alain De Vos (May 22, 2021)

To delete . directories I always use ".??*"


----------



## SirDice (May 22, 2021)

Alain De Vos said:


> 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.


----------



## PMc (May 22, 2021)

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...


----------



## SirDice (May 22, 2021)

PMc said:


> and not do shell globbing.


It doesn't.









						pkg/pkg_repo_create.c at 944de38df95d891cf72e5c3b22cabb9706dc41cd · freebsd/pkg
					

Package management tool for FreeBSD. Help at #pkg on Libera Chat or pkg@FreeBSD.org - pkg/pkg_repo_create.c at 944de38df95d891cf72e5c3b22cabb9706dc41cd · freebsd/pkg




					github.com


----------



## PMc (May 22, 2021)

Okay, I do look into the code. 
What is this: https://github.com/freebsd/pkg/blob...2cabb9706dc41cd/libpkg/pkg_repo_create.c#L238

I have a habit: if I want to do move/keep something out of the way, I create a directory .t 
It didn't work that way here.


----------



## Jose (May 22, 2021)

PMc said:


> Okay, I do look into the code.
> What is this: https://github.com/freebsd/pkg/blob...2cabb9706dc41cd/libpkg/pkg_repo_create.c#L238


That is a great question. I'd ask on `freebsd-ports` or on the Github issue tracker.








						Issues · freebsd/pkg
					

Package management tool for FreeBSD. Help at #pkg on Libera Chat or pkg@FreeBSD.org - Issues · freebsd/pkg




					github.com
				




Edit: Wrong Github project.


----------

