Commit Graph

862 Commits

Author SHA1 Message Date
Colin Walters
e2e754e94c compose: Reuse previous commit lookup in passwd checking
A future commit is going to change our parsing of the "ref" member in
treefiles, so ensure we only load it once early on in compose-tree.
We already looked up the previous commit there, so just pass it down
rather than reloading the ref.

Closes: #274
Approved by: jlebon
2016-04-28 15:38:53 +00:00
Colin Walters
9541cc693f Vagrantfile: Add a stub here
Closes: #269
Approved by: jlebon
2016-04-28 15:12:33 +00:00
Colin Walters
3aaae9ecb4 Add a LICENSE symlink
See https://github.com/projectatomic/atomic/pull/344
The original submitter of #265 hasn't updated the PR, but
it's easy enough to just redo it.

Closes: #265

Closes: #273
Approved by: giuseppe
2016-04-28 13:09:22 +00:00
Giuseppe Scrivano
9f29b24805 tests: add tests for compose+add files
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #253
Approved by: cgwalters
2016-04-27 20:21:12 +00:00
Giuseppe Scrivano
91ba02924f compose: add cache for added files
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #253
Approved by: cgwalters
2016-04-27 20:21:12 +00:00
Giuseppe Scrivano
94a2804b0a compose: support adding external files
This will allow to copy arbitrary files into the rootfs, specifying something like:

"add-files": [["service.template", "/exports/service.template"],
              ["config.json.template", "/exports/config.json.template"]]

It is quite useful when building a container image.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #253
Approved by: cgwalters
2016-04-27 20:21:12 +00:00
Colin Walters
d935767c0e Error for unknown subcommands overrides unknown option
If one does `rpm-ostree foo --bar`, one would expect to see
`Unknown subcommand foo`, not `Unknown option --bar`.

Closes: #267

Closes: #270
Approved by: jlebon
2016-04-27 13:50:36 +00:00
Giuseppe Scrivano
41e3d124bf tests: check an error is returned on the wrong option
awk is already used by the tap driver, so it won't be an additional
dependency.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #263
Approved by: cgwalters
2016-04-12 14:10:16 +00:00
Colin Walters
24c923444c main: Consistently set exit code as failure in option processing
Otherwise we `exit(0)`, but trip an internal warning.

We have so much copy/paste going on here, but let's fix the
bug first.

Closes: #261

Closes: #262
Approved by: giuseppe
2016-04-12 08:05:36 +00:00
Colin Walters
aa4b4c2f73 Remove .gitignore from git
Followup to <https://github.com/projectatomic/rpm-ostree/pull/231>

Now that it's autogenerated, we don't want to actually store it in
git.

Closes: #259
Approved by: giuseppe
2016-04-08 11:55:47 +00:00
Colin Walters
63761e5127 core: Skip over local packages for downloads
Because `hif_source_get_location()` is actually a reference to the
upstream repo, we shouldn't create a cache directory there.

This is just a two line fix, but I changed some things so that we keep
track of the number of local packages, in order to make the "Need to
download" print accurate.

We still need to add them (confusingly) to the `packages_to_download`
because that's also used for the container path which imports them.

Closes: #255

Closes: #256
Approved by: jlebon
2016-03-31 17:56:19 +00:00
Colin Walters
7e55b484e3 build: Use gnu99 by default
It's actually very nice to be able to declare loop variables inside
the initializer.

Closes: #254
Approved by: jlebon
2016-03-30 20:51:34 +00:00
Colin Walters
484c74ae04 doc: Explain bootstrap_packages a bit more
Closes: #242

Closes: #252
Approved by: miabbott
2016-03-29 19:10:07 +00:00
Colin Walters
168e12d32f Release 2016.1 2016-03-28 10:58:46 -04:00
Colin Walters
3eaea54e6f build: Update .gitignore
Closes: #250
Approved by: cgwalters
2016-03-26 14:22:41 +00:00
Colin Walters
81e3c5fd6a packaging: Modernize Dockerfile a bit
As long as we require uid 0, we should encourage people to run
`compose tree` in its current state inside a Docker/nspawn container.

I didn't spend a lot of time on this yet but it works.  Am considering
switching to a CentOS base though.

Closes: #249
Approved by: giuseppe
2016-03-25 08:32:17 +00:00
Colin Walters
4342c92082 main: Hide the container builtin for now
It's not really baked, totally undocumented etc.  Let's leave it in as
a tech demonstration for people who saw my Devconf.cz talk, but that's
it for now.

Pull request: #248
Approved by: jlebon
2016-03-24 19:34:35 +00:00
Colin Walters
dea5040e41 README: Elaborate a bit on building
Pull request: #244
Approved by: jlebon
2016-03-22 18:46:52 +00:00
Colin Walters
3350c0e062 postprocess: Fix "compose tree" regression with /etc
The fact that we didn't notice this is a testament to the state of
testing =(

I think I want to change the container build path to also only
grab /usr and /etc rather than having the paths be different,
but for now - the quick fix.

Pull request: #243
Approved by: jlebon
2016-03-22 18:35:33 +00:00
Colin Walters
ed7fc02b04 postprocess: Ensure we error out if selinux is enabled, but no policy found
I was tracking another regression where we seem to have lost
`/usr/etc` contents which manifested as `Labeling with... (null)`
which was clearly wrong.

Now this change actually impacts the test suite - we now (again IMO
correctly) error out if `selinux: true`.  The `no-selinux-tag` test
no longer makes sense, so delete it.

We do need more "real" tests that use selinux on and off.

Pull request: #243
Approved by: jlebon
2016-03-22 18:35:33 +00:00
Colin Walters
c4d2da5596 tests: Delete intermediate source RPM so it isn't in repodata
Currently the libhif logic for selecting packages to install might
choose source packages, which causes all sorts of problems in both
libhif and rpm-ostree which aren't prepared to "install" source RPMs.

Fix this by deleting the srpm, which means it won't end up in the
repodata, and we won't abort deep in the bowels of librpm.

Pull request: #245
Approved by: giuseppe
2016-03-22 16:04:32 +00:00
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