Skip to content

Commit

Permalink
Add tool vdb-report-snapshot
Browse files Browse the repository at this point in the history
changelog: new-command: vdb-report-snapshot
  • Loading branch information
kentfredric committed Feb 8, 2017
1 parent 6cd884c commit d7905fb
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- new-command: installed-match-atom
- new-command: installed-match-atom-blacklisted
- new-command: list-blacklisted-for
- new-command: vdb-report-snapshot
- tarball generator now prefixes with ${P}

0.1.0 2017-01-31/01
Expand Down
56 changes: 56 additions & 0 deletions libexec/vdb-report-snapshot
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash

# ABSTRACT: Takes a snapshot of your portage package state for debugging

source "${LIBDIR}/core-functions.sh" || exit 1

[[ $# == 1 ]] || die "Expected argument [tar.xz] in: ${cmdname} [tar.xz]"

require_bin tar app-arch/tar

set -euo pipefail

tarfile=$1

shift;

tar -caf "${tarfile}" \
-C "${EPREFIX:-/}" \
--exclude CONTENTS \
--exclude '*.ebuild' \
--exclude 'environment.bz2' \
--exclude 'NEEDED*' \
--no-xattrs \
--sort=name \
--no-acls \
--no-selinux \
--exclude-vcs \
--exclude-vcs-ignores \
--dereference \
-v \
--totals \
./etc/portage \
./var/db/pkg \
$(cd ${EPREFIX:-/} && echo ./var/lib/portage/world* )

# help: Invocation
# help: gentoo-perl vdb-report-snapshot /tmp/vdb.tar.xz
# help:
# help: Outputs:
# help: A .tar.xz file of a minimal subset of the following portage
# help: files for the purpose of reporting portage dependency resolution
# help: issues:
# help: - /var/db/pkg
# help: - /etc/portage
# help: - /var/lib/portage/world*
# help:
# help: PRIVACY NOTE
# help: although most of the files collected by this process
# help: are *probably* OK and not leaking anything interesting,
# help: there's still substantial room for personal stuff to leak.
# help:
# help: It can also serve as a data file for using in an attack, as knowing
# help: the exact versions of software you run can help a wouldbe attacker
# help: specialise their attack.
# help:
# help: Subsequently, use this command wisely or not at all.
1 change: 1 addition & 0 deletions maint/MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ libexec/list-commands
libexec/list-commands-desc
libexec/list-excluded-abis
libexec/print-matching-abi
libexec/vdb-report-snapshot
libexec/version
t/bin/interface.t.sh
t/cmd/gen-upgrade-sets.t.sh
Expand Down
2 changes: 2 additions & 0 deletions t/runtest.expected
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ list-commands
list-commands-desc
list-excluded-abis
print-matching-abi
vdb-report-snapshot
version
==== [ bin/gentoo-perl list-commands-desc ] ====
gen-upgrade-sets : generates/updates sets in /etc/portage/sets for helping dev-lang/perl upgrades
Expand All @@ -137,6 +138,7 @@ version
list-commands-desc : Lists all commands with descriptions extracted from "ABSTRACT" headings
list-excluded-abis : Lists all known ABI's except the one specified
print-matching-abi : Validate and expand an ABI version
vdb-report-snapshot : Takes a snapshot of your portage package state for debugging
version : Print the version of gentoo-perl helpers
==== [ bin/gentoo-perl print-matching-abi 5.24 ] ====
dev-lang/perl:0/5.24
Expand Down

0 comments on commit d7905fb

Please sign in to comment.