summaryrefslogtreecommitdiff
path: root/morphlib/sourcemanager.py
Commit message (Collapse)AuthorAgeFilesLines
* Rework the bundle code to set the bundle filename outside _wget().Jannis Pohlmann2012-02-241-12/+5
| | | | | This is a bit stupid and requires tests to be adjusted (which is done in this commit as well).
* Make sure to always remove bundles on errors or when we've cloned them.Jannis Pohlmann2012-02-241-0/+6
|
* Make sure to remove cached git dirs if cloning/extracting fails.Jannis Pohlmann2012-02-221-1/+5
|
* Improve log messages and warnings when caching repos.Jannis Pohlmann2012-02-221-2/+3
|
* Fix exception when updating a cached clone in _cache_repo_from_url().Jannis Pohlmann2012-02-221-0/+1
|
* Delay bundle and base URL errors until we are sure all of them failed.Jannis Pohlmann2012-02-201-15/+21
| | | | | | | This is done to not print confusing errors in situations where one of the bundles or base URLs works and everything is fine. If all of them are failing though, we now print all the error messages in order to give users an overview over what might have gone wrong.
* Update quote_url() to replace : with _.Jannis Pohlmann2012-02-201-4/+9
|
* Use a colon-less local filename for saved bundlesLars Wirzenius2012-02-161-0/+1
| | | | Otherwise we have to deal with git's not liking colons in filenames.
* Log whenever updating origin fails.Jannis Pohlmann2012-02-141-0/+1
|
* Ignore remote update failures in bootstrap mode.Jannis Pohlmann2012-02-141-1/+3
| | | | | | This is needed because if there are any connection errors during bootstrap, we do not want that to affect the build. It is mostly a hack that should not be necessary. But it is and that's life.
* Drop an unnecessary print statement.Jannis Pohlmann2012-02-141-1/+0
|
* Fix something that was inserted by accident.Jannis Pohlmann2012-02-141-1/+0
|
* First check for cached repo, then try bundles, then repos.Jannis Pohlmann2012-02-141-21/+34
| | | | This order makes most sense in all regards.
* Try original repo as well if no bundle is available.Jannis Pohlmann2012-02-141-11/+13
|
* Rewrite get_treeish(), fetching and update code.Jannis Pohlmann2012-02-141-91/+106
| | | | This is to improve logging, error reporting and readability of the code.
* Fix potential out of memory errors when fetching large bundles.Jannis Pohlmann2012-02-141-5/+11
|
* SourceManager: Do not attempt to fetch bundle if update is false.Jannis Pohlmann2012-02-131-41/+48
| | | | | | | If the SourceManager is told to not update repositories, then it should always assume that we have the repo cached for at least one of the base URLs. In that case it should never try to download a bundle from a bundle server and just skip all bundles.
* Add missing import for loggingLars Wirzenius2012-02-091-0/+1
|
* Add --ignore-submodules flag to avoid updating/unpacking submodules.Jannis Pohlmann2012-02-091-7/+10
|
* Fix test coverageLars Wirzenius2012-02-091-2/+2
|
* Ignore (for now) errors updating cached git reposLars Wirzenius2012-02-091-2/+8
| | | | | | This is the WRONG thing to do, in the long run, but for now, without this I can't ever get the bootstrap build to finish more than once in a while, since git or gitorious or something keeps failing during the git updates.
* Replace use of wget with pure Python code, for bootstrapping to workLars Wirzenius2012-02-091-3/+14
| | | | We don't have wget in the bootstrap chroot, so we need to deal with this.
* Change how git clones are created from bundlesLars Wirzenius2012-02-091-3/+5
| | | | | | For some reason, "git bundle unbundle" doesn't work for me, but "git clone" does. Then, adding a remote fails, because the cloned bundle already has one, so now we'll use "git remote set-url" and "git remote update".
* Create bundle URL so it actually points at the bundle serverLars Wirzenius2012-02-091-1/+1
| | | | | | Previously, urljoin wouldn't add the bundle server, since the pathname at the server contains a colon. We now use a simpler way of joining (lowly string catenation) which should always work.
* Cache submodule repositories recursively.Jannis Pohlmann2012-02-081-30/+57
| | | | | | | | | | | | | | | | | | | | | | This commit introduces the following new classes: morphlib.git.Submodules: * takes a parent repo treeish * parses the .gitmodule file into morphlib.git.Submodule objects * provides iterator/container functionality for submodules morphlib.git.Submodule: * represents a single entry in a .gitmodules file * stores a Treeish for the corresponding repository In addition to this, the exception classes InvalidTreeish and SourceNotFound where renamed to InvalidReferenceError and RepositoryUpdateError. Several new exception classes were added for when resolving submodules fails. The SourceManager now resolves the Submodules and Submodule objects for the submodules of a Treeish in SourceManager.get_treeish() and also takes care of caching submodule repositories whenever necessary.
* Stop after updating the repo successfully from one of the base URLs.Jannis Pohlmann2012-02-011-0/+2
|
* Make the code of SourceManager.get_treeish() easier to understand.Jannis Pohlmann2012-02-011-12/+12
| | | | | | Also, avoid raising a KeyError when reaching the end of the base URL traversal without having had success in updating a repository. Instead, raise a SourceNotFound error.
* Add an update option to prevent the source manager from updating origin.Jannis Pohlmann2012-01-261-3/+7
| | | | | | This is useful because we still have a mix of sudo and fakeroot, which can cause permission issues in repos. This way, we can work around this problem in some situations.
* Add controller, worker classes and a new "build-distributed" command.Jannis Pohlmann2012-01-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces four new classes: BuildController: * takes an app instance and a tempdir * allows to add BuildWorker objects * provides a build() method that takes a set of blobs and a build order that is then built by assigning work to the build workers as needed * the build() method takes care of polling the workers for their state, moving them between busy and idle states reliably, collect and print their output in a non-confusing order, and makes sure to wait for all workers to finish before processing the next group in the build order. * at this point, when waiting for one or more workers to become idle to assign them another blob to build, the controller always picks the worker that has been idling for the longest period of time. this can be changed later. BuildWorker: * base class for all worker classes * takes a name and an app instance * has a idle_since datetime property * provides a build() method that takes a Blob object and builds it in whatever way the subclasses implement it * provides a check_complete(timeout) method that checks whether the worker has finished building the blob yet or not LocalBuildWorker: * worker class for local builds that don't go through SSH * it uses morphlib.execute.Execute to run morph in a child process in build() * at the moment, this class executes "./morph" instead of "morph" as it assumes the user to run morph from its source tree. obviously, this will have to be fixed later. RemoteBuildWorker: * doesn't implement anything yet, will be used for distributing work to other machines running morph via SSH Notes: * At the moment, there is a degree of undesired redundancy when building a stratum in a worker, as this will cause the worker to rebuild all its dependencies. This will have to be fixed as it is avoidable and wastes a lot of time and processing power.
* Bump copyright years, get rid of long lines and unused imports.Jannis Pohlmann2012-01-231-2/+2
|
* Improve the logging output of SourceManager.Jannis Pohlmann2012-01-231-58/+79
|
* Disable logging in SourceManager (too verbose), save build times again.Jannis Pohlmann2012-01-231-20/+13
|
* Port everything to using Treeish objects instead of (repo, ref).Jannis Pohlmann2012-01-201-9/+14
| | | | | | | | | | | This affects pretty much every part of morph, so this might not be fully working and stable yet. This commit also introduces the "update-gits" command that can be used to update all cached repositories from the list of base URLs. The tree walk when resolving the Treeish objects in Builder.get_cache_id() is a bit similar to what we do in BuildDependencyGraph, maybe we can merge that one day.
* Document get_treeish() of the SourceManager.Jannis Pohlmann2012-01-191-0/+10
|
* Coding style cleanup.Jannis Pohlmann2012-01-191-19/+19
|
* Fix coding style, update copyrights, drop unused imports.Jannis Pohlmann2012-01-191-5/+1
|
* Remove bad whitespaceRob Taylor2012-01-191-4/+4
|
* Complete SourceManager testsRob Taylor2012-01-191-18/+44
|
* initial version of Sourcemanager and testsRob Taylor2012-01-181-0/+112