Call for Help: need script for patching ports tree, building with poudriere

Ricky G ricky1252 at hotmail.com
Wed Nov 25 20:49:52 UTC 2015


> That is a good attitude :) I am doing this also just to get in touch 
> with something new and learn.
> As a professional trainer there is a trick in learning: whenever a 
> question arises - by yourself or by another person: take the chance and 
> look for it. So you will remember the answer much better. :)
> If you need a programming-mentor for this project feel free to contact 
> me off-list.


 That would be great! your time will be most appreciated!
> 
> To answer my own question, yes there is
> 
> You wrote:
> 
> ===
> if [ -d "${PORTSDIR}" ]; then
> else
> ===
> 
> Which directly skips the if condition without doing something.
> 
> Rewrite it with:
> 
> ===
> if ! [ -d "${PORTSDIR}" ]; then
> ===
> 
> This will test if the dir is non existent - exactly what you want! :)


 Yes, I remember this problem now and its fixed! I couldn't figure out where the explanation mark went. Just missed the space! Thanks so much for clearing that up.
> >> Line 162: BUILD_LIST="`(cat ${PATCH_FILE} | grep -o '^Index:[ ].*'
> >> | sed 's/Index: // ; s/Mk.*// ; s/Tools.*// ; s/Templates.*// ;
> >> s/Keywords.*//' | grep -o -e '.*\/.*\/' | sed 's/.*\/.*\/files\/$//
> >> ; s/\/$//' | sort | awk '!a[$0]++')`"
> >>
> >> This line is relative complicated. Is there any reason not to let
> >> svn do the work? Like: BUILD_LIST="`${SVN} status | grep -o -e
> >> '.*\/.*\/' | awk '{ print $2 }'`> Your way is faster (and more
> >> accurate, since i'm currently too short on time), but the other way
> >> would allow applying multiple patches and manual changes without
> >> any problems. But i'm not sure if this is really needed.
>  >
> > Using the diff file instead of svn is of course faster because there
> > has much less data to go through. I was considering adding multiple
> > diff support. Going to take a closer look at this. Do you think its
> > more important to focus on the diff file or the port tree for
> > generating a build list?
> 
> That is a hard question. I asked for svn because i am from Germany and 
> facing often problems with umlauts. My lastname is "Z¨¹hlsdorff" but i 
> rewrite it for non-german person and programs to "Zuehlsdorff". Sounds 
> the same, means the same.
> 
> Back to the core of the question: encoding problems.
> 
> Can you guarantee that cat and sed work correctly on files with for 
> example an "¨¹" or containing something like 'ºÏšÝµÀ'? ;)> > Using svn avoids this problem, because in the portstree you could not 
> find filenames with such characters.


 Just added an option that will generate a list via tree over diff. You have a very valid point about encoding. Have never considered this and I have no idea how to work this problem out. My only (human) language is english. Will message you off-list to see if we can fix this issue.

 There are a few things that need to be filtered in order to guarantee a properly generated list. Also the change I made recently, it fixes the issue with striping possible 15ish ports that end with files, however it will remove the cat/port/files instead of just striping files. Still trying to find the best solution.


> 
> An additional though: you are assuming that everything is fine with the 
> input. It accepts all tracks of my music folder without any hestination 
> as a patch-file. ;) Okay, patching fails - but i tries hard and the new 
> versions provides much binary trash through the "cat" after failing.
> 
> I don't believe we must make it bullet proof. Here we need some input 
> from Craig about the way and environment the script will be used in.


 Another great point. Did consider this when I started, however haven't yet come up with the proper solution for verifying diff file or not. The way I was considering was just something along the lines of head -5 | grep -o Index:    as it is the most consistent thing in patch files. If you wondering why I choose -5, in cases of comments being on header, 5 lines seems reasonable. This could cause more encoding issues tho, I'm not sure.


> > The main reason I didn't want to use the
> > port tree, at least in my case, is because I have so many ports that
> > are not sync'd with the current FreeBSD tree.
> 
> Okay, but therefore you added the PORTSDIR variable?


 Think this may have been misunderstood, or I mislead. I have many ports not synced with the current head. Rather not generate a list for each of those as well as the patched ones I want to test.


> >> Line 201: svn revert -R would do the same, both of our approaches
> >> have a problem: the ignore for example added files.
>  >
> > Yeah, I agree. This is a big problem with added patchfiles. I added a
> > "Hard Revert" (-R) option that I was considering making make the
> > default that should fix this problem. Can you check and see if it
> > does for you?
> 
> I will check this.
> 
> > I know some people maybe weary of the rm -rf command,
> > It is also why I added so many checks on a properly set port tree. Do
> > you think it would be better to just do this "Hard Revert" and remove
> > the other option? Thanks for the feedback!
> 
> The revert option should do what they say: reverting. The technical 
> details are the second step. As a rule of thumb: do not lie. When you 
> claim to revert do this. If this needs an rm than do the rm.


 I have been contemplating on taking advantage of zfs snapshots as a way of reverting. This would be the quickest way to revert, but still deciding on proper implementation or even if anyone would want this feature.



> > I'v already started
> > working on 0.0.2! I just finished adding better failed patch output.
> > Going to also add a option to override the scripts portsdir, and add
> > support for multiple diff files, and take another look at my
> > BUILD_LIST to make it simpler. Keep the feed back coming please! =]
> 
> That are great news :)
> 
> One last question: is there any reason you choose this license? The 
> FreeBSD license contains just the first 2 paragraphs which makes 
> redistribution much easier. Especially paragraph 3 makes you script for 
> example incompatible with the GNU licensed programs.
> 
> https://www.freebsd.org/copyright/freebsd-license.html
> 



 Yeah, the legal side has never interested me. I just found the first BSD license I saw and copy/pasted it. Ill change it to a more compatible license for this project.


 Thanks for all the feedback! Although this was started for one person, I would like to make portest something beneficial for everyone. When I feel it is more complete, will see about adding it to the port tree. =]


Ricky 		 	   		  


More information about the freebsd-testing mailing list