Technical difficulty: trivial When commiting package.mask files to CVS, a pre-commit script should validate all atoms. This is trivial to implement via a script; I will write it if we are interested in doing this. -Alec
Give me a script and I'll put it in place.
And it's checking STRICTLY syntax, not existence.
Do you want it to blow up if it's trying to revert something not in a parent profile?
What about a repoman script?
repoman doesn't run in /profiles
(In reply to comment #3) > Do you want it to blow up if it's trying to revert something not in a parent > profile? > This is not an exhaustive check and it is not meant to ensure that what the developer wanted is actually occurring. It is to prevent obvious cases of human error involving atoms (our most common p.mask screwup is typos). The check is meant to be quick (not CPU intensive), easy to write, easy to deploy, and easy to maintain. at a minimum it is : from portage.SOMETHING import isvalidatom f = open(pmask) for line in f: line = line.strip() if line.startswith('#'): continue if not isvalidatom(line): return False return True Thats all I plan to do. -Alec
(In reply to comment #6) > This is not an exhaustive check and it is not meant to ensure that what the > developer wanted is actually occurring. It is to prevent obvious cases of > human error involving atoms (our most common p.mask screwup is typos). > > The check is meant to be quick (not CPU intensive), easy to write, easy to > deploy, and easy to maintain. That's not what I asked, although my questioning is re: crafting an exhaustive check. The pkgcore implementation of profiles is fairly strict (meaning it could be used for checking any profile file instead of just package.mask) w/ a minor tweak, and weighing in around 10 lines I'd figure. So.. should the check try and enforce that a node's attempted reversal of a parents masking is an error, or...?
ferringb: for these checks running on the server side, the CVS hooks run them in a temporary directory, with ONLY the new files in directory. They need to depend on no other files, because there is no specific guarantee that they will exist. Eg, for the GDP guys, we have post-commit hooks that update the seperate copies of the DTDs on the CVS servers, so that they can use a pre-commit hook on the guidexml files.
(In reply to comment #7) > (In reply to comment #6) > > This is not an exhaustive check and it is not meant to ensure that what the > > developer wanted is actually occurring. It is to prevent obvious cases of > > human error involving atoms (our most common p.mask screwup is typos). > > > > The check is meant to be quick (not CPU intensive), easy to write, easy to > > deploy, and easy to maintain. > > That's not what I asked, although my questioning is re: crafting an exhaustive > check. The pkgcore implementation of profiles is fairly strict (meaning it > could be used for checking any profile file instead of just package.mask) w/ a > minor tweak, and weighing in around 10 lines I'd figure. > > So.. should the check try and enforce that a node's attempted reversal of a > parents masking is an error, or...? An explicit no to that question (in my planned implmentation). >