Commit Graph

991 Commits

Author SHA1 Message Date
Jonathan Lebon
f8b87efc1f RpmOstreeContext: add set_repo()
The new context methods recently added for unprivileged infrastructure
would set the ostreerepo member when calling new_unprivileged(). Since
here we will be using the sysroot repo, we need the ability to set the
repo. Just add a new set function for now, maybe move it into
new_system() later.

Also, make sure we dereference the repo on finalize.

Pull request: #240
Approved by: cgwalters
2016-03-21 19:57:06 +00:00
Jonathan Lebon
224e4b31d8 RpmOstreeTreespec: allow missing ref element
There will be cases where we don't actually want to tag a ref on the
final assembled commit. This will be true for package layering.

Pull request: #240
Approved by: cgwalters
2016-03-21 19:57:06 +00:00
Jonathan Lebon
bf44928f40 RpmOstreeContext: remove unused params
Pull request: #240
Approved by: cgwalters
2016-03-21 19:57:06 +00:00
Jonathan Lebon
8594931c67 RpmOstreeTreespec: allow missing repos element
We allow the "repos" key to be missing, which just means that we let
libhif do its job, i.e. automatically use the repos in repodir that are
enabled.

We still do a check in rpmostree_context_setup() to make sure that at
least one repo is functional.

Pull request: #240
Approved by: cgwalters
2016-03-21 19:57:06 +00:00
Colin Walters
ad92d7e0ec daemon: Ignore unconfigured-state for rebase
It's expected to be able to switch to something different when
rebasing, even if the current origin has unconfigured-state.

Closes #232

Pull request: #238
Approved by: jlebon
2016-03-21 18:17:38 +00:00
Jonathan Lebon
ca61d0dcad rpm_ostree_db_diff: fix bad pointer
This was causing `rollback` to SEGV.

Pull request: #239
Approved by: cgwalters
2016-03-21 14:40:53 +00:00
Colin Walters
c77470f274 docs/admin: Fix examples, document deploy verb
Just some minor updates as I read through the docs.

Pull request: #234
Approved by: jlebon
2016-03-16 13:55:58 +00:00
Colin Walters (automation)
5396dc3358 !!! Temporary commit !!!
This commit is artifically made up to mark PR 235 as merged.

If this commit remained in the history, you can safely reset HEAD to f69895c80b.
This is possibly due to protected branches, which forbids force-pushing.
You are advised to turn off protected branches, or disable certain Homu
features that require force-pushing, such as linear history or
auto-squashing.

[ci skip]
2016-03-15 15:35:55 -04:00
Colin Walters
f69895c80b Add a stub travis file to enable Homu
I'd like to use Homu immediately as a replacement for the github merge
button, because I really dislike merge commits for single patches.

I think it shouldn't be too hard to unify our existing PR testing with
this.

Pull request: #235
Approved by: jlebon
2016-03-15 19:34:19 +00:00
Colin Walters
9f3f1ad06a build: Work without gtk-doc installed
This follows the pattern used by e.g. glib.  If people (commonly
embedded systems) don't want docs, we should support that.

Pull request: #235
Approved by: jlebon
2016-03-15 19:34:19 +00:00
Colin Walters
e06f6582c4 Add a stub travis file to enable Homu
I'd like to use Homu immediately as a replacement for the github merge
button, because I really dislike merge commits for single patches.

I think it shouldn't be too hard to unify our existing PR testing with
this.
2016-03-15 14:04:06 -04:00
Colin Walters
34647ed78f build: Work without gtk-doc installed
This follows the pattern used by e.g. glib.  If people (commonly
embedded systems) don't want docs, we should support that.
2016-03-15 14:04:06 -04:00
Colin Walters
429487231f Merge pull request #229 from cgwalters/tests-container
Tests container
2016-03-11 08:44:52 -05:00
Colin Walters
f925d9ced4 tests-container: New experimental testing code path
This generates a docker image that contains a cached blob of RPMs, so
it's easy to test compose tree.

It's hacky and ugly, but it's better than nothing.
2016-03-11 08:38:06 -05:00
Colin Walters
180d5c5374 packaging: Make a yum repo 2016-03-11 08:38:06 -05:00
Colin Walters
aa3f7700f8 Merge pull request #230 from cgwalters/app-use-libglnx-console
app: Use libglnx console API
2016-03-10 19:33:30 -05:00
Colin Walters
3947538932 app: Use libglnx console API
libgsystem has long been deprecated, so this is a small step for man,
and not really a gigantic leap at all for anyone but hey, at least I
changed something in git today.
2016-03-10 19:18:24 -05:00
Colin Walters
ed3165cd37 Merge pull request #231 from cgwalters/git-mk-clean
build: Use git.mk, make git status clean
2016-03-10 19:17:33 -05:00
Colin Walters
a9a49e72cd build: Use git.mk, make git status clean
Having a clean `git status` is really important for not missing files
one wants to `git add`.
2016-03-10 14:36:44 -05:00
Colin Walters
b7152a8874 Merge pull request #228 from cgwalters/docs-mkdocs
Docs mkdocs
2016-03-09 11:38:47 -05:00
Colin Walters
e66333393e Move gtk-doc into api-doc
Since that's all it is now, we use mkdocs for the manual.
2016-03-09 11:20:06 -05:00
Colin Walters
d06c5d694b docs: Start using mkdocs
Matching https://git.gnome.org/browse/ostree/commit/docs/CONTRIBUTING.md?id=64ebe2b82ac25f1933f39a5cf8a24a5e0096cf6f
2016-03-09 11:10:58 -05:00
Colin Walters
9c1a24d55e Merge pull request #226 from cgwalters/sysroot-sync-2
Sysroot sync 2
2016-03-08 15:17:46 -05:00
Colin Walters
f3800ec939 libtest: Make it easier to source interactively
When running the tests by hand, I wanted to be able to source
`libtest.sh` from a running shell.  Make this slightly easier by
allowing one to set `SRCDIR`, since `$0` won't work.
2016-03-08 14:54:22 -05:00
Colin Walters
d5efcc5a26 daemon: Honor RPMOSTREE_USE_SESSION_BUS for startup too
While I was debugging the tests, I wanted to run the daemon
interactively under gdb but still on the session.  In our previous
logic this was only possible if we were exec'd by dbus-daemon which
made attaching gdb annoying.

Let's honor the environment variable consistently on client and
server.
2016-03-08 14:54:22 -05:00
Colin Walters
c3f1e7c85a upgrade: Only exit 77 with explicit option
This was a semantic change could potentially impact a lot of users who
weren't aware of the new '77 == unchanged' status and would treat it
as an error.

We retain the 77 for `--check` as I feel it's likely fewer people were
scripting that, and the ones that were would more quickly adapt to the
change.

As part of this, change the logic for detecting a change to be more
explicit by comparing the defaults.  I think this will fix a potential
bug where we could get a property change notification even if nothing
changed.
2016-03-08 14:54:22 -05:00
Colin Walters
3e289ffab0 daemon: Drop internal mutexes for sysroot
Now that the internal reading methods operate on the mainloop, and we
know there can only be one write transaction at a time, it should be
safe to drop the internal mutexes (and multithreading).

Updates to the `OstreeSysroot` instance and DBus API all happen off
the mainloop now.  The write transactions now use a separate
`OstreeSysroot` instance, and do not perform any changes to process
state on their own.  We always reload state from disk.

I think this is a lot simpler to reason about from a correctness point
of view, at a likely negligble loss in performance for read
transactions.
2016-03-08 14:54:22 -05:00
Colin Walters
467ecf268d daemon: Delete some now-dead code
This was only used by the threading API calls.
2016-03-08 14:54:22 -05:00
Colin Walters
769841fc9c daemon: De-thread os_handle_get_deployments_rpm_diff()
See the previous commits; this is a read-only task that doesn't
download any data, so we can run it from the main loop easily enough.
2016-03-08 14:54:22 -05:00
Colin Walters
3f60c317d3 daemon: De-thread os_handle_get_cached_deploy_rpm_diff()
See the previous commits; this is a read-only task that doesn't
download any data, so we can run it from the main loop easily enough.
2016-03-08 14:54:22 -05:00
Colin Walters
94600b7b83 daemon: De-thread os_handle_get_cached_update_rpm_diff()
See the previous commit; this is a read-only task that doesn't
download any data, so we can run it from the main loop easily enough.
2016-03-08 14:54:22 -05:00
Colin Walters
67142078c4 daemon: De-thread get_rebase_diff_variant()
I'd like to move towards a model where internal worker threads don't
touch the "main context data", i.e. we only use message passing (via
main contexts).  This means we wouldn't use a mutex.

I find this model to be significantly simpler to reason about.
2016-03-08 14:54:22 -05:00
Colin Walters
6f13c39aba transaction: Hoist main context wrapper creation up
Every transaction runs in a thread now, and there's no real drawback
to consistently creating a main context to go with it always.  Most
of the transaction types now do a pull, which needs it.
2016-03-08 14:54:22 -05:00
Colin Walters
7c970e3860 daemon: Maintain sysroot/repo persistently, close race in change updates
Now that we have `ostree_sysroot_load_if_changed()`, we know more
precisely (and cheaply) when things change.  Use inotify to detect
changes as before, but we don't need a timeout because all we do is
call `fstatat()` which is basically free; the inode is going to be in
memory.

This will hopefully help with
https://github.com/projectatomic/rpm-ostree/issues/220
but more investigation is needed.
2016-03-08 14:54:22 -05:00
Colin Walters
4619ee04cf sysroot: Use new ostree_sysroot_init_osname() API
Dumps a lot of duplicate code.
2016-03-08 14:54:22 -05:00
Colin Walters
1785cf825e sysroot: Inline basename check
Avoids a `malloc()` and I think is cleaner.
2016-03-08 14:54:22 -05:00
Colin Walters
799fe4d7c7 packaging: Drop hawkey BR
We're now tracking libhif master only.
2016-03-08 14:53:23 -05:00
Colin Walters
3eb085c8f8 daemon: Clean up sysroot loading
We were loading the list of osnames by walking the FS, but it's a lot
simpler to just extract the set of known osnames from the deployment
array.

This is part of an effort to unify the "sync cached state with disk"
code in order to address race conditions.
2016-03-03 10:49:12 -05:00
Colin Walters
6b4becaef3 daemon: Generate more predictable "id" variables for deployments
We can't rely on the the GLib hash functions not changing (or being
stable across host systems).  Basically here we have a "stringified"
deployment...it might be simpler to just declare this stable.
2016-03-03 10:49:12 -05:00
Colin Walters
18b9da97ab compose: Add a --dry-run option
This way it's easier for people to inspect the next system state.
2016-03-02 18:39:13 -05:00
Jonathan Lebon
dbaade3c4f status.c: don't print trailing spaces for last field
This will allow users' terminals to be 5 columns thinner without
seemingly printing a blank line between each row.
2016-03-02 13:55:11 -05:00
Jonathan Lebon
170ad1946d status.c: fix case where header is longer than fields
For the columns that can vary in width, check that the minimum width of
the column is at least the length of the column header. Otherwise, we
can run in a situation where some columns are stuck to each other. The
trivial strlen() should be optimized to a constant by the compiler.
2016-03-02 13:55:11 -05:00
Colin Walters
50fb99ed5a Merge pull request #219 from jlebon/pr/testenv-helper
Fix up libtest.sh and add testenv helper
2016-02-26 13:21:56 -05:00
Jonathan Lebon
774c2a43ba libtest.sh: add include guard 2016-02-26 13:06:00 -05:00
Jonathan Lebon
b129df69dc Makefile-tests.am: add helper testenv target
The 'testenv' target enters an environment in which a tmpdir is created
and the daemon is set up and started. This is useful for easy testing.

$ make -j4 && make install
$ make testenv
===== ENTERING TESTENV =====
$ # now we can easily test our new code
$ # we can even make use of helper funcs
$ source ../tests/libtest.sh
$ setup_os_repository archive-z2 syslinux
$ exit
===== EXITING TESTENV =====
2016-02-26 13:06:00 -05:00
Jonathan Lebon
657f48377b setup-session.sh: use libtest.sh for setup
The libtest.sh script is aware of whether a tmpdir needs to be created
or not for the test. Make use of this in setup-session.sh so that we're
sure we're in the right directory before creating the sysroot dir.
2016-02-26 12:17:52 -05:00
Colin Walters
78d0bbbf12 Merge pull request #215 from cgwalters/unpacker-32
unpacker: Fix a 32 bit format string error
2016-02-23 21:09:25 -05:00
Colin Walters
9a0a59f7e5 Merge pull request #217 from jlebon/pr/local-test-repo
test-ucontainer.sh: use test-repo in srcdir
2016-02-23 20:54:16 -05:00
Jonathan Lebon
1c81b7f56e test-ucontainer.sh: use test-repo in srcdir
Running `make check` would fail because test-ucontainer.sh uses
test-repo, which points directly to the installed_testdir, where it is
not installed yet.

We make another processed version of test-repo.repo.in which instead
points to the repo in the srcdir and make use of that in
test-ucontainer.sh.

There are probably other ways of solving this, but this is the one that
jumped out at me.
2016-02-23 17:53:46 -05:00
Colin Walters
f46302c2ab unpacker: Fix a 32 bit format string error 2016-02-23 13:44:14 -05:00