From 31cb76a3c0aa41ba1161024f852a23f84af61086 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 17 Jan 2013 11:19:00 -0500 Subject: [PATCH] version.sh: A script for recording version info of a Gentoo system You can get a reasonable way towards this with: $ equery list '*' but that doesn't give you revision granularity for live ebuilds (where ebuild version 9999 could be anything :p). Since most of my experimental stack is live, I wrote up this script. --- notes/version.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 notes/version.sh diff --git a/notes/version.sh b/notes/version.sh new file mode 100755 index 0000000..8d363ac --- /dev/null +++ b/notes/version.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +if [ "$1" = '-s' ]; then + filename=$(date +'%Y-%m-%dT%H-%M-%S-software-versions') + exec >"versions/$filename" +fi + +echo "Live Git packages" +echo +for package in /usr/src/linux.git/.git /usr/portage/distfiles/egit-src/*; do + name=$(basename "$package") + if [ "$name" = '.git' ]; then + name=$(basename $(dirname "$package")) + fi + echo -en "$name\t" + GIT_DIR="$package" git --no-pager log -n1 --oneline +done + +echo +echo "Live Subversion packages" +echo +for package in /usr/portage/distfiles/svn-src/*; do + name=$(basename "$package") + echo -en "$name\t" + svn info "$package"/trunk +done + +echo +echo "Dead packages" +echo +for package in /var/db/pkg/*/*; do + name_version=$(basename "$package") + category=$(basename $(dirname "$package")) + echo "=$category/${name_version}" +done -- 2.26.2