Commit Graph

991 Commits

Author SHA1 Message Date
Colin Walters
8d357565b6 Release 2015.10 2015-11-21 10:07:53 -05:00
Colin Walters
54d9263149 man: Document deploy 2015-11-21 10:07:53 -05:00
Colin Walters
f18ef6d291 Merge pull request #183 from miabbott/version
Use PACKAGE_STRING for version output
2015-11-19 17:00:51 -05:00
Micah Abbott
25ae79bc98 Use PACKAGE_STRING for version output
We are currently using PACKAGE_NAME for version output, which returns
exactly what it says it does: the package name.  Not very useful when
looking for version information.

PACKAGE_STRING, on the the other hand, returns the package name and the
version.  Much better!

This is nicely documented in the autoconf manual [1].

[1] http://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Initializing-configure.html#Initializing-configure

Signed-off-by: Micah Abbott <miabbott@redhat.com>
2015-11-19 14:22:48 -05:00
Colin Walters
37ef92b966 Merge pull request #182 from mbarnes/rebase-tolerant-cleanup
Don't fail during rebase cleanup
2015-11-16 15:43:29 -05:00
Matthew Barnes
6c197455e1 daemon: Don't fail during rebase cleanup
Ignore errors during cleanup after a successful rebase.  The source
origin ref may not actually exist.  The issue linked below describes
one such case.

Fixes https://github.com/projectatomic/rpm-ostree/issues/179
2015-11-16 15:35:39 -05:00
Matthew Barnes
e1dc5fdbac libglnx: Pick up g_autoptr backport for GCancellable 2015-11-06 10:07:36 -05:00
Matthew Barnes
e61fbd144c Merge pull request #178 from mbarnes/enhanced-rebase 2015-11-06 09:16:09 -05:00
Matthew Barnes
9c81c47f2f tests: Add deploy command tests 2015-11-06 09:10:48 -05:00
Matthew Barnes
63d7ff8d5f daemon: Add rpmostreed_parse_revision()
Determines a revision argument to either be a SHA256 checksum or a version
metadata value.

The revision string may have a "revision=" prefix to denote a SHA256
checksum, or a "version=" prefix to denote a version metadata value.  If
the revision string lacks either prefix, the function attempts to infer
the type of revision.  The prefixes are case-insensitive.
2015-11-06 09:10:48 -05:00
Matthew Barnes
6114255b8e app: Split upgrade --check-diff into separate options
rpm-ostree upgrade --preview   - Just preview package differences,
                                 like deploy --preview
rpm-ostree upgrade --check     - Just check if an upgrade is available

In both cases, the exit codes are 0 (upgrade available), 77 (no upgrade
available) and 1 (error).

The --check-diff option still works but is deprecated and not shown in
the --help option listing.
2015-11-06 09:10:48 -05:00
Matthew Barnes
1c01141e0c app: Define a special exit code for no changes (77)
Used by upgrade and deploy to allow scripts to test for changes.
2015-11-06 09:10:48 -05:00
Matthew Barnes
a555af0050 app: Redo "update --check-diff" implementation
Don't remember why we're not using the daemon for this, but I already
went to the trouble of writing rpmostree_print_package_diffs() for the
"deploy" command.  Use it here as well.
2015-11-06 09:10:48 -05:00
Matthew Barnes
6f184d6072 daemon: Remove equivalence check for details variant
rpmostreed_commit_generate_cached_details_variant() returns NULL if the
origin checksum of an OstreeDeployment matches the checksum of a refspec,
which may also be the OstreeDeployment's origin.

I don't understand the reasoning for that, especially since none of the
callers are prepared to deal with a NULL return.  Nor is there a comment,
so remove the check.

This was making the daemon crash on

  rpm-ostree deploy --preview <current-deployment-checksum>

which should just indicate no package differences.
2015-11-06 09:10:48 -05:00
Matthew Barnes
56d28a76f3 app: Add "deploy" command
Command-line interface for new D-Bus "Deploy" methods.
2015-11-06 09:10:48 -05:00
Matthew Barnes
de7b750728 app: Add rpmostree_print_package_diffs()
Takes a GVariant returned by the daemon's various "PkgDiff" methods.
2015-11-06 09:10:48 -05:00
Matthew Barnes
0a7706c241 daemon: Strip override-commit when upgrading
Deploy method locks the deployment at a particular commit by adding an
"override-commit" line to the origin file.

Upgrade method must undo the override so we always upgrade to the latest
available commit.
2015-11-06 09:10:48 -05:00
Matthew Barnes
9eabc1ba3c daemon: Add "RpmDiff" methods to supplement Deploy
DownloadDeployRpmDiff and GetCachedDeployRpmDiff, which take the same
revision argument as Deploy.
2015-11-06 09:10:48 -05:00
Matthew Barnes
9a13d39a25 daemon: Add Deploy() method
Deploy(revision) pulls and deploys a particular revision on the
branch of the currently booted deployment.  The revision can be
expressed as a SHA256 checksum or as a version metadata value.
2015-11-06 09:10:48 -05:00
Matthew Barnes
316f927aef daemon: Add rpmostreed_repo_lookup_cached_version()
Similar to rpmostreed_repo_lookup_version(), except without pulling from
a remote repository.  It traverses whatever commits are available in the
local repository.
2015-11-06 09:10:48 -05:00
Matthew Barnes
b3ecdd10b6 daemon: Add primitives for version lookup
rpmostreed_repo_pull_ancestry() downloads an ancestry of commit objects
starting from a given refspec.  An optional visitor function is called
for each commit object.  The visitor function can stop the recursion,
such as when looking for a particular commit.

rpmostreed_repo_lookup_version() builds on this by supplying a visitor
function that examines commit metadata for a particular version value.
When the version value is found, the commit's checksum is returned to
the caller.
2015-11-06 09:10:48 -05:00
Matthew Barnes
a5dd7d1a1a daemon: Miscellaneous diff operation cleanups 2015-11-06 09:10:48 -05:00
Matthew Barnes
1af2a08e54 app: Allow for custom exit status codes
Change the command callback return type to integer, so commands can
return a custom exit status.  Usually it should be EXIT_SUCCESS (0)
or EXIT_FAILURE (1).
2015-11-06 09:10:48 -05:00
Matthew Barnes
554a631ca7 app: Add rpmostree_usage_error()
Convenience function for missing or invalid command-line arguments.
2015-11-06 09:10:48 -05:00
Matthew Barnes
9b5cc4af9a app: Frivolous GError cleanup 2015-11-06 09:10:48 -05:00
Colin Walters
f84ad5d954 Merge pull request #181 from giuseppe/giuseppe/dracut-reproducible
postprocess: provide --gzip and --reproducible to dracut if supported
2015-11-05 21:32:35 -05:00
Giuseppe Scrivano
bb2f32502b postprocess: provide --gzip and --reproducible to dracut if supported
This should help to generate the same initrd when the files didn't
change.

Newer versions of gzip (or pigz when available) can generate rsync
friendly files and if present, Dracut already takes advantage of it.

Also use --reproducible, to instruct Dracut to generate CPIO
reproducible files.  It is required a version of GNU CPIO that
has support for it.

Check that Dracut has --reproducible in its --help output before
setting it.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-11-04 12:33:55 +01:00
Colin Walters
b7e8c7bdc5 compose: Ensure we've cleaned up references to tmpfs workdir before umount
Otherwise the `umount()` will always fail.  This hasn't been a problem
so far while running in a external container (docker/systemd-nspawn),
but is when running in `mock` because it doesn't set its namespace to
be private.

This should help Fedora's Bodhi, which uses rpm-ostree inside mock.
2015-10-30 21:40:14 -04:00
Colin Walters
054ceebb76 Merge pull request #175 from giuseppe/giuseppe/reboot-after-upgrade
giuseppe/reboot-after-upgrade
2015-10-08 13:37:57 -04:00
Giuseppe Scrivano
4b0b2b94f1 rebase,rollback,upgrade: use rpm-ostreed to reboot
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-10-07 08:46:30 +02:00
Giuseppe Scrivano
aa6415bb9c upgrade: reject --reboot and --check-diff used together
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-10-07 08:42:11 +02:00
Giuseppe Scrivano
f140f33d4d rpm-ostree: support 'reboot' immediately after a rebase
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-10-07 08:33:06 +02:00
Giuseppe Scrivano
b5cd3f2d1e rpmostreed: refactor common code in the new function rpmostreed_reboot
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-10-07 08:22:36 +02:00
Matthew Barnes
58e826f76c status: Fix the asterisk
Asterisk next to the booted deployment broke at some point during
daemon development.
2015-10-06 17:04:04 -04:00
Giuseppe Scrivano
f8cc2e05a8 fixup! rpm-ostree: support 'reboot' immediately after a rollback 2015-10-06 08:35:10 +02:00
Giuseppe Scrivano
fad97b901c fixup! rpm-ostree: support 'reboot' immediately after an upgrade 2015-10-06 08:32:15 +02:00
Giuseppe Scrivano
1bc2029173 rpm-ostree: support 'reboot' immediately after a rollback
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-10-05 09:18:50 +02:00
Giuseppe Scrivano
391522ecdb rpm-ostree: support 'reboot' immediately after an upgrade
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-10-05 09:14:51 +02:00
Colin Walters
da621d1551 Merge pull request #171 from petervo/cached-info
daemon: Add info dictionary to cached results
2015-09-29 20:45:25 -04:00
petervo
85c82816b6 daemon: Add detail variant to rpm diff methods
Allows clients to see version, timestamp
and other detailed information along with
the rpm diffs for cached updates and rebases.

This will be used by the Cockpit interface.
2015-09-29 17:39:15 -07:00
petervo
cb6ed53fec daemon: Expose details for cached updates
Adds a CachedUpdate property that allows clients
to see version, timestamp and other detailed
information for pending updates. Additionally
changes to this property signal clients that a
new rpm-diff can be fetched with GetCachedUpdateRpmDiff.

This will be used by the Cockpit interface.
2015-09-29 17:38:51 -07:00
Matthew Barnes
f37047d61d Merge pull request #173 from petervo/expose-path
daemon: Expose the path that started a transaction
2015-09-28 22:08:11 -04:00
petervo
8ed604ef2d daemon: Expose the path that started a transaction 2015-09-28 17:25:25 -07:00
Matthew Barnes
873075206f Merge pull request #168 from jlebon/pr/building-tweaks
Squash warnings during build and small tweaks
2015-09-11 11:51:33 -04:00
Matthew Barnes
cff91513e2 Merge pull request #169 from jlebon/pr/fix-test-basic-dots
tests/test-basic.sh: make dots literal
2015-09-11 11:43:34 -04:00
Jonathan Lebon
4ea37a9aa3 tests/test-basic.sh: make dots literal
The assert[_not]_file_has_content functions used grep to check the
pattern against the content. This meant that the '.' characters are
interpreted as "any char". Yesterday, the date was 20150910 and thus the
otheros' tree's version was labelled as such. This date also happens to
match the 1.0.10 pattern, and thus caused the test to fail.

This patch makes sure this doesn't happen again by escaping all the dots
to make them literal.
2015-09-11 10:35:47 -04:00
Jonathan Lebon
367229892f automake: squash warnings re. subdir-objects
During autoreconf, automake would emit many warnings regarding the
option 'subdir-objects' being disabled. We squash those warnings by
enabling the option.

We also fix Makefile.am so that it includes the patched libglnx Makefile
rather than the original one, which would cause libglnx output to be
placed in the literal dir './$(libglnx_srcpath)'.
2015-09-11 10:30:09 -04:00
Jonathan Lebon
f994de3a93 Makefile.am: squash warning re. duplicate definition
During autoreconf, we would get a warning due to privdatadir being
defined in both Makefile-rpm-ostree.am and Makefile.am. Remove the
instance in Makefile.am.
2015-09-11 10:27:09 -04:00
Jonathan Lebon
87423f5707 Makefile-tests.am: fix program typo in note
The note mentions ostree instead of rpm-ostree. Also reword double usage
of "use".
2015-09-11 10:25:38 -04:00
Jonathan Lebon
077f83edfd autogen.sh: tweak program checking logic
With the errexit bash option turned on, these conditionals would never
actually be reached since the failure from `which` would cause the
script to exit.

As a result, if autoreconf was not installed, all the user would see
would be the error message from `which`, and not pretty error we have
for them. Similarly, even though gtk-doc should be optional, the script
would fail if gtkdocize wasn't installed.

Also fix minor typo.
2015-09-11 10:24:44 -04:00