Commit Graph

898 Commits

Author SHA1 Message Date
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
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