Commit Graph

910 Commits

Author SHA1 Message Date
Colin Walters
1a1e08fbf7 core: Verify no %posts for imported packages
This is bringing forward an old PR for libhif:
https://github.com/rpm-software-management/libhif/pull/39

Right now, we aren't running `%post` or any of the other variants.  A
lot of packages will work if we just ignore `%post`, others won't.
Let's be conservative until we start running them, and don't imply we
support things we don't yet.

Closes: #311
Approved by: jlebon
2016-06-15 01:11:01 +00:00
Colin Walters
84c691af8a compose: Explicitly clear out context object before removing rootfs
This squashes an ugly `/var/tmp/rootfs.XXXX/usr/share/rpm: ENOENT`
warning that occurs because we were nuking the temporary rootfs
before cleaning up the context object, which was indirectly
holding references to it.

Closes: #319
Approved by: jlebon
2016-06-13 20:39:18 +00:00
Colin Walters
b7d1b827b7 status: Support --json option
It's really simple to reflect the DBus API into JSON, which tools like
Ansible or `jq` from the command line or whatever can parse to find
interesting things like the current version.

Closes: #301

Closes: #315
Approved by: jlebon
2016-06-13 14:54:25 +00:00
Colin Walters
0578e13de8 core: Set a useragent
See https://github.com/rpm-software-management/libhif/pull/140

I just noticed this while debugging HTTP requests.

Closes: #318
Approved by: giuseppe
2016-06-12 16:20:33 +00:00
Colin Walters
81cc46d2e8 daemon: Use memory GSettings backend explicitly
See: https://bugzilla.gnome.org/show_bug.cgi?id=767183

This suppresses a warning when a HTTP proxy is enabled.

Closes: #312
Approved by: jlebon
2016-06-09 20:59:36 +00:00
Jonathan Lebon
b243ac1b70 status: print version string in bold
I think 99% of the time, that's the only thing users are interested in.
Make it bold to make it easier to see.

Closes: #314
Approved by: miabbott
2016-06-09 20:34:11 +00:00
Colin Walters
46e93e5d77 Vagrantfile: Bump RAM to 2048, update comment
I was running out of RAM doing builds in the VM with just 512MB.
I think for single host machines, we can assume a lot of RAM.
If one is doing multi-node Vagrant that's a different thing.

Also update the comment at the top.

Closes: #313
Approved by: jlebon
2016-06-09 19:53:56 +00:00
Colin Walters
d587051d0f daemon: Add base-commit to deployment metadata
I think most users are really going to be interested in the base/origin
commit, and not whatever the stuff they made locally happened to hash
to.

Closes: #295
Approved by: jlebon
2016-06-09 19:33:19 +00:00
Colin Walters
879ecbe6f1 daemon: More error handling cleanup for loading deployment metadata
I really don't like doing a `g_warning()` in the middle of a call
stack and stumbling onwards.  If we fail to load a commit, we should
pass the error back up to toplevel boundary - normally a DBus method
invocation.  As opposed to giving partial or incorrect data.

This is a preparatory (git) commit for adding more data from the
(ostree) commit to the deployment variant.

Closes: #295
Approved by: jlebon
2016-06-09 19:33:19 +00:00
Colin Walters
0b3dfefff6 daemon: Cleanup error handling in rpmostreed_os_load_internals()
- `ostree_sysroot_get_deployments()` cannot fail (only assert)
 - Relying on setting a GError to detect the rollback only to
   clear it was a bit weird; instead just pass `NULL` there.

Closes: #295
Approved by: jlebon
2016-06-09 19:33:19 +00:00
Colin Walters
c756d55127 status: Print unlocked state
For obvious reasons it's data we'd like to show.

Closes: #295
Approved by: jlebon
2016-06-09 19:33:19 +00:00
Colin Walters
ea4fdf1692 daemon: Insert unlocked state into deployment dict
So we can consume it via `rpm-ostree status` etc.

Closes: #295
Approved by: jlebon
2016-06-09 19:33:19 +00:00
Colin Walters
0724240092 status: Replace status with key-value output
With the end goal in mind that I want to optimize for the case
of 1-2 deployments, it's actually a lot simpler to just
nuke the whole current column base.

It just really doesn't make sense with layered packages, and even
before then, I usually found the timestamp and osname columns
redundant.

Closes: #295
Approved by: jlebon
2016-06-09 19:33:19 +00:00
Colin Walters
b82405d17b status: Move current status display into function
Pure code motion, no real functional changes.  Preparation for having
multiple statuses.

Closes: #295
Approved by: jlebon
2016-06-09 19:33:19 +00:00
Colin Walters
20e69a9692 status: Import systemd bits to use UTF-8 circle
It's slightly prettier, but this is just laying some
groundwork/precedent for importing more systemd code and using it for
our formatting.

Closes: #295
Approved by: jlebon
2016-06-09 19:33:19 +00:00
Jonathan Lebon
d99df468c7 libhif: always prefix include directives
This is in response to:
https://github.com/rpm-software-management/libhif/pull/138

Closes: #310
Approved by: cgwalters
2016-06-09 12:27:53 +00:00
Colin Walters
a3769a7219 vmcheck: Experiment with the name nxs
I find myself not liking the name rpm-ostree anymore; it's
descriptive, but unfortunately we compete with other projects with
easier and sexier names.

Also, people continually find the ostree and rpm-ostree layering
unclear.  It's *much* easier to say "nxs depends on ostree", even
though textually it's obvious "rpm-ostree depends on ostree".

Anyways, just an experiment for now.

Closes: #307
Approved by: giuseppe
2016-06-08 14:26:08 +00:00
Jonathan Lebon
c1de9f5c46 RpmOstreeSysrootUpgrader: update self on override
When a user called `set_origin_override()`, we were updating the origin,
but not our current state.

Resolves: #306

Closes: #309
Approved by: cgwalters
2016-06-08 13:26:54 +00:00
Jonathan Lebon
66daf13d68 rpm-ostree-1.pc.in: fix cflags
Closes: #308
Approved by: cgwalters
2016-06-08 13:19:45 +00:00
Colin Walters
77eb3e2b5b tests: Introduce "vmcheck"
This is infrastructure that's oriented around Vagrant, we do builds
inside the target VM (actually inside a Docker container), but then
directly `make install DESTDIR=/host/`.

The goal here is to have a convenient workflow for:

  - dev -> hand testing
  - dev -> run destructive tests

Closes: #303
Approved by: jlebon
2016-06-07 18:39:46 +00:00
Jonathan Lebon
6b07755d68 add RPMOSTREE_UNINSTALLED_PKGLIBDIR
Since we now run everything uninstalled, we can't expect the tmpfiles
conf file to be installed. We add an env var that will allow us to tell
rpm-ostree to look elsewhere. This is then used in test-compose.sh.

Closes: #304
Approved by: cgwalters
2016-06-06 21:14:07 +00:00
Jonathan Lebon
acd3c8ff41 tests: restructure dirs
- Move all the uninstalled, non-destructive tests to check/
- Add a README
- Move utilities to utils/
- Move common files to common/

Closes: #304
Approved by: cgwalters
2016-06-06 21:14:07 +00:00
Jonathan Lebon
9eefc59220 tests: no longer use installed tests
For now, we don't remove the ability to install tests (e.g. the
necessary blurbs in glib-tap.mk are still there), but we take out all
our previously installed tests from the list.

All the previously installed tests are then converted to work
uninstalled. This also allows us to do some simplifications in the test
cases.

Also do some cleanups in the Makefile to improve legibility.

Closes: #304
Approved by: cgwalters
2016-06-06 21:14:07 +00:00
Jonathan Lebon
7f3c5288d4 man page: add pkg-add and pkg-delete
Closes: #302
Approved by: cgwalters
2016-06-03 19:13:13 +00:00
Jonathan Lebon
dc8e94d7e6 man page: reorder, reflow, refresh
No text changes actually made here (except for very small space fixes
and such)

- Fix synopsis
- Abide by 72 max line
- Reflow all the tags to get the right indentation (and in the process
  replace all errant tabs with spaces).
- Re-order the commands in the same order they appear in `rpm-ostree
  --help`.
- Get rid of duplicate `deploy` section.
- Rename 'rpm' command to 'db' (which is what was done in the code).

Closes: #302
Approved by: cgwalters
2016-06-03 19:13:13 +00:00
Colin Walters
3a93fc162f core: Checksum package checksums, not just NEVRA for change detection
GPG signing an RPM doesn't change its NEVRA, and we need to support
detecting the case when RPMs change from unsigned to signed (or vice
versa).

It's also quite common for local developers to rev RPMs without
bumping the release or whatever, so this will fix that too.

Closes: #291

Closes: #296
Approved by: jlebon
2016-06-02 18:40:32 +00:00
Colin Walters
6472b75a69 daemon: Fix regression in --preview/--check
Some code changes in the package layering broke this to always
error out with `refs are equal`.

Reading the code I was confused for a bit until it dawned on
me that `self->refspec` was the input, and we extracted the current
one in a different way.  I ended up modeling it back on the last
working commit I saw (`9eabc1ba`).

That said the logic here could be cleaned up more...it feels like we
should just have a "dry run" flag for the rebase transaction core or
something.  Anyways, going for a surgical fix now.

Closes: #299
Approved by: jlebon
2016-06-02 15:02:06 +00:00
Colin Walters
93e4039f60 core: Dedup hardlink/tempfile code
I wanted to avoid yet another copy of the "generate tempfile name"
code, so moved it to libglnx:

  https://github.com/GNOME/libglnx/pull/14

This also closes the TODO about deduping the "break one hardlink" code
with the "break all links in one dir" code.  The core observation here
is that it's simpler to copy to a tempfile and rename over the
existing, rather than rename, create, unlink.

Closes: #293
Approved by: jlebon
2016-06-01 15:15:11 +00:00
Jonathan Lebon
e0637544bd test-basic.sh: make subtests more granular
Closes: #289
Approved by: cgwalters
2016-05-27 22:18:44 +00:00
Jonathan Lebon
336f765810 Makefile-tests.am: add env var to know when in testenv
Closes: #289
Approved by: cgwalters
2016-05-27 22:18:44 +00:00
Jonathan Lebon
ead1ecdd23 package layering: major rework
- Move the package layering logic away from pkg-add and into the
  upgrader
- Add pkg-delete
- Add dry-run option

Closes: #289
Approved by: cgwalters
2016-05-27 22:18:44 +00:00
Jonathan Lebon
a25cdde25c core: major rework
This patch prepares RpmOstreeContext for supporting package layering. A
relabel operation is added as well to support relabeling imported
packages if the sepolicy of the rootfs we're overlaying onto is
different from during import.

Closes: #289
Approved by: cgwalters
2016-05-27 22:18:44 +00:00
Jonathan Lebon
1ccc560c26 output: support printf type usage
Closes: #289
Approved by: cgwalters
2016-05-27 22:18:44 +00:00
Jonathan Lebon
ca162dece2 unpacker: major rework
- Delete unpack_to_dfd path
- Get rid of copynpaste stuff and use the newly reworked ostree
  libarchive API which now supports the callbacks we need

Closes: #289
Approved by: cgwalters
2016-05-27 22:18:44 +00:00
Jonathan Lebon
2a036cf8b4 package-layering fixups
This patch fixes up errors in the parent commit which added pkg-add.
Some of them are due to the rebase on top of the unprivileged
infrastructure.

- fix compile errors (due to libhif changes after rebase)
- delete duplicate prototype for rpmostree_sysroot_upgrader_deploy
- include allow-older in flags type
- fix change_upgrader_refspec to use g_strdup() (this was causing the
  wrong old refspec to be registered)
- in builtin-status.c, check for NULL before joining the packages array
- sysroot-upgrader: fix gtype function names
- roc_context_prepare_for_root(): delete unused param
- assemble_commit(): delete unused param
- RpmOstreeSysrootUpgraderFlags: fix docs
- Fix sysroot property name and add reboot opt

Closes: #289
Approved by: cgwalters
2016-05-27 22:18:44 +00:00
Colin Walters
beb026f701 pkg-add: New builtin to layer additional packages
This builds upon the earlier prototype in
https://github.com/cgwalters/atomic-pkglayer

The `.origin` file says for a replicated installation:

    [origin]
    refspec=local:rhel-atomic-host/7/x86_64/standard

If you then run `rpm-ostree pkg-add strace`, it will result in a new tree with:

    [origin]
    baserefspec=local:rhel-atomic-host/7/x86_64/standard

    [packages]
    requested=strace;

Work still remaining here is to teach `rpm-ostree status` and
`rpm-ostree upgrade` about this.

Closes: #289
Approved by: cgwalters
2016-05-27 22:18:44 +00:00
Jonathan Lebon
d9e8535bcf treecompose: fix crash when "remove-from-packages" used
This works around a potential issue with libsolv if we go down the
rpmostree_get_pkglist_for_root() path. Though rpm has been using the
/usr/share/rpm location (since the RpmOstreeContext set the _dbpath
macro), the /var/lib/rpm directory will still exist, but be empty.
libsolv gets confused because it sees the /var/lib/rpm dir and doesn't
even try the /usr/share/rpm location, and eventually dies when it tries
to load the data.

So we set the symlink now. This is also what we do on boot anyway for
compatibility reasons using tmpfiles.

This also means we don't have to do the /var/lib/rpm --> /usr/share/rpm
transition during the rootfs postprocess (but we still have to clean up
db and lock files).

Also get rid of the unused pkglist variable.

NB: I used the GFile & gs APIs to mesh with the surrounding code.

Closes: #290
Approved by: cgwalters
2016-05-27 17:06:08 +00:00
Colin Walters
b1bb193871 README/docs: A few more links around composes
Mostly just to test Homu again.

Closes: #288
Approved by: cgwalters
2016-05-26 18:48:27 +00:00
Colin Walters
24ec30180c Release 2016.3 2016-05-20 08:54:05 -04:00
Colin Walters
2cab8216b4 core: Adapt to libhif API query change
We'll track git master.

Closes: #286
Approved by: jlebon
2016-05-19 17:44:34 +00:00
Colin Walters
8dc292a62a Release 2016.2 2016-05-19 10:20:11 -04:00
Colin Walters
cbadc9bdaa libpriv: Print repository name for each package too
I'm trying to debug why I'm getting an older version of `docker`,
and it's useful to see the repository name we're getting something
from.  Yum does this by default.

(Though we should probably consider column formatted output too
 on a tty)

Closes: #282
Approved by: jlebon
2016-05-11 16:07:50 +00:00
Jonathan Lebon
582650e9c7 daemon: add TaskBegin, TaskEnd, and PercentProgress
Closes: #260
Approved by: cgwalters
2016-05-11 15:03:38 +00:00
Colin Walters
218804f22d vagrant: Switch to CentOS by default
Because this now works:

```
ostree remote add --set=gpg-verify=false centos-atomic-continuous https://ci.centos.org/artifacts/sig-atomic/rdgo/centos-continuous/ostree/repo/
rpm-ostree rebase centos-atomic-continuous:centos-atomic-host/7/x86_64/devel/continuous
```

In the future we'll need infra to switch between Fedora and CentOS for
dev, but for now, I think we should focus on CentOS becuase it has to
work in order to produce downstream work.

Closes: #283
Approved by: giuseppe
2016-05-10 12:17:41 +00:00
Colin Walters
b718e28d79 postprocess: Add --add ostree to dracut invocation
Right now the `ostree.rpm` package always configures dracut to inject
the ostree setup via a conf file.  But it's actually simpler and
cleaner to just have callers specify it explicitly.

https://bugzilla.redhat.com/show_bug.cgi?id=1331369

Closes: #276
Approved by: jlebon
2016-05-06 14:50:42 +00:00
Colin Walters
7276acccda docs: A few random tweaks; link to ostree and issues
Just doing today's docs commit.

Closes: #281
Approved by: miabbott
2016-05-06 13:55:30 +00:00
Colin Walters
603180bcf2 docs: Point compose server intro to CentOS
We should make this less abstract and rather point people directly at
the CentOS bits as it's more likely to be a real-world useful example
and produce something they want.

Fix a few other typos and bits.

Closes: #279
Approved by: miabbott
2016-05-03 14:29:59 +00:00
Colin Walters
4fc25d74a3 compose: Introduce variable substitution for ${basearch}
This comes from the tradition of yum repo files.  It's significantly
easier for rpm-ostree users building multiple architectures if some
core templating for the treefiles is built in.

Otherwise, everyone needs to learn about a new wrapper tool for
rpm-ostree, and said tool would need to re-do the same "basearch"
evaluation that is already occuring inside libhif.

This commit also paves the way for introducing `${releasever}`
substitution.

NOTE: This depends on pending changes to libhif git.

Closes: #274
Approved by: jlebon
2016-04-28 15:38:53 +00:00
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