[PC-BSD Dev] pcbsd system source idea and question

Joe Maloney jpm820 at gmail.com
Sat Dec 14 14:43:45 PST 2013


Yep.  Thats basically what I was doing with the scripts I linked to in pastebin.  I meant that I had to add several more steps by adding the upstream repo and running git fetch as the git clone command itself didn’t support cloning into a non empty directory.  However I wasn’t thinking of the checkout command.  That might work as well.

Joe Maloney

On Dec 14, 2013, at 3:30 PM, Dave Cottlehuber <dch at jsonified.com> wrote:

> Hey Joe,
> 
> It's possible to clone into a non-empty directory:
> 
> cd /usr/ports
> git init
> # add in upstream repo and pull in the data
> git remote add origin git://git.freebsd.org/things.git
> git fetch
> # instead of cloning, we now check out
> git checkout -t origin/master
> # update .gitignore as needed
> git add -A
> git commit -m "all the stuff"
>> 
> Depending on your needs for pushing stuff upstream this might or might not be a suitable solution, there are a number of other options
> http://stackoverflow.com/questions/2411031/how-do-i-clone-into-a-non-empty-directory
> A+
> Dave
> 
> 
> 
> On 14 December 2013 18:56, Joe Maloney <jpm820 at gmail.com> wrote:
> Ok since this is going to take me a while here is what I have so far.
> 
> portsnapprogress.h
> http://pastebin.com/yDLMJnhk
> 
> portsnapprogress.cpp
> http://pastebin.com/S8BsmpSr
> 
> When I first started this I ran into the limitation with git that it can’t clone into a dir like /usr/ports/ which has an existing dir like /usr/ports/distfiles.  Which also is a dataset.  Otherwise this would have been easy by just using your example for fetchsource() and renaming the buttons in portsnapprogress.ui.  
> 
> The only way to fix this in git was to change some things in the global configuration for git so I didn’t think that would be a good idea.  I didn’t think running git clone to a temp dir and moving it was a really clean way of doing it either.  So I started with the idea that I would init a fresh repo in /usr/ports.  Then add the pcbsd ports tree as an upstream repo.  Then fetch the ports and merge them.  This way if /usr/ports/.git/config existed with an upstream repo I could just fetch and merge only the updates and not have to re-clone the entire thing.  I think this could work for fetchsource() also if you wanted to only grab the updates quickly each time.
> 
> What I’m missing is the code to check /usr/ports/.git/config to check to see if the upstream repo has been added, add it, otherwise continue on to fetch ports.  Then continue on to fetchports() mergeports().  Also I’ve ripped out some of the functions the fetch done stuff at the end of the script while I was testing.
> 
> Although I’ve learned a few things so far I’m by no means an expert in qt.  So I figured I would pass along what I’ve been able to figure out so far.  I see that some similar things already with pcdm as far as parsing config files with qt so I suspect someone will know how to finish this.  I just wasn’t sure how to implement that type of function for what I was trying to do here.  I will continue researching it but if someone is able to finish this before I do or do it another way I will just learn from the examples.  
> 
> Joe Maloney
> 
> 
> On Dec 13, 2013, at 8:06 AM, Joe Maloney <jpm820 at gmail.com> wrote:
> 
>> I almost finished this up last night.  I should have something in another day or so.
>> 
>> Joe Maloney
>> 
>> On Tue, 2013-12-10 at 17:16 -0500, Kris Moore wrote:
>>> 
>>> On 12/08/2013 17:20, Joe Maloney wrote:
>>> > I was playing around with porthshaker to fetch and merge the latest
>>> > virtualbox development ports.  I thought of something as I told it to
>>> > grab the freebsd-ports fork from pcbsd rather than the freebsd ports
>>> > tree.  I've noticed that in system manager the source fetching tool is
>>> > now using git.  Does it now grab the source from pcbsd's github?  
>>> >
>>> > I was just thinking how cool it would be if it did grab the source from
>>> > github for whatever running kernel and world revision the user is
>>> > updated to.  Likewise if the fetch ports feature would fetch the
>>> > modified ports from pcbsd rather than the ports tree from pcbsd.  Maybe
>>> > they could be renamed to "fetch pcbsd system source", and "fetch pcbsd
>>> > ports".  
>>> >
>>> > I wasn't sure if you might already be heading in the direction.  However
>>> > I am sure it would solve a lot of problems that I've had in the past
>>> > with building things that require the source for the running kernel.
>>> > This would also spare the user having to rebuild and reinstall kernel
>>> > and world to install something like virtualbox from ports.  I'm just
>>> > curious is this something that might already be in development or sound
>>> > like a good idea?
>>> >
>>> > Joe Maloney
>>> 
>>> Part of it is done. I've already switched it on 10 to download the
>>> system sources from our "git" fork, so that if you recompile kernel you
>>> get our PEFS merge and such. We just need to switch the ports tree over
>>> to do the same and rename the buttons as you suggested. If thats
>>> something you want to do, please feel free, otherwise it may be a few
>>> days before I can get to it.
>>> 
>> 
> 
> 
> _______________________________________________
> Dev mailing list
> Dev at lists.pcbsd.org
> http://lists.pcbsd.org/mailman/listinfo/dev
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pcbsd.org/pipermail/dev/attachments/20131214/d13d3349/attachment.html>


More information about the Dev mailing list