Strange contents on some ftp mirrors

Marcin Wisnicki mwisnicki+freebsd at gmail.com
Wed Jul 28 23:30:15 UTC 2010


On Thu, 29 Jul 2010 00:18:01 +0200, Dominic Fandrey wrote:

> On 28/07/2010 23:24, Andrew W. Nosenko wrote:
>> 
>> Excuse me?  The ports check downloaded source tarball against SHA
>> checksum.  Just for nay case like downloading error or malicious
>> inject.  Did you try to say that binary package have no such safeguard?
> 
> Exactly. The INDEX does not contain such information. The thing is to do
> that, the pointyhat INDEX format would have to differ from the ports
> INDEX format.
> 

It could be renamed to PKGINDEX.

> A possiblity of course, but also a source of trouble if the INDEX format
> of the ports should ever change, something I desire:
> http://www.freebsd.org/cgi/query-pr.cgi?pr=148783
> 

It's also missing ranged versions of dependencies like foo>=2.0.

> Another solution would be to add an empty column that pointyhat can fill
> in.

Actually I'd rather have less data in INDEX.
Some columns have no use in case of packages ({BUILD,FETCH,EXTRACT,PATCH}_DEPENDS).

Additional data can be stored in separate files as long as there is some way
to verify they all belong to same build. It could be some information
in header (does INDEX support comments?) or some assumption such as that
modification times may not differ by more than a couple of seconds
(just touch them all at the end of build).

I think storing all columns in separate files would be better and allow
future extensibility.
For example consider PKGINDEX subdirectory with following files,
each having one entry per line:

 # PKGINDEX/format:
 MANDATORY org.freebsd.PKGINDEX 1
 OPTIONAL com.mycomany.PKGINDEX 1

# this one actually has custom format
# list base format and extensions
# mandatory must be supported by client, optional can be ignored
# i'm probably overengineering here a little ;)
 
 # PKGINDEX/packages.list:
 bar-2.0
 baz-3.2
 foo-1.0

# *.list files are just lists (ordered alphabetically)

 # PKGINDEX/run-depends.map:
 foo-1.0 bar-2.0
 foo-1.0 baz>=3.1

# *.map files have "<key> <value>+" pairs (ordered alphabetically)
# in this case foo needs bar & baz
# in future it could support boolean operators
# e.g.:
#   foo-1.0 (bar-2.0 || bar-alternate=2.0)
#   foo-1.0 (baz>=3.1 && baz<4.0)
# where '-' is "soft" requirement like currently implemented in pkg_add
# new operators would be strictly enforced

 # PKGINDEX/category.map:
 foo-1.0 sysutils databases devel

# sysutils is primary category of foo-1.0
# additional categories follow in alphabetic order

 # PKGINDEX/origin.map:
 foo-1.0 sysutils/foo

 # PKGINDEX/description.map:
 bar-3.2 Bar is better than foo
 foo-1.0 Foo is great

etc...
I have some awk scripts to produce something like that from INDEX ;)

General idea is to have sorted files where first column is always a key.
You can then operate on them using utilities like join(1) and tsort(1).

Having potentially large but rarely used attributes like description
in separate files greatly reduces amount of text needed to be loaded and
parsed by utilities in common operations.




More information about the freebsd-ports mailing list