scripts/jannet: Add two new commands

Add build-date and built-today

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2017-06-10 19:08:50 +00:00
commit 606994f875

View file

@ -20,16 +20,18 @@ cat << EOT
command is one of
help: show this help screen
init: initialize
uninit: undo initialization
install: install packages in [arguments]
update: update all jannet software on the system
restore: restore a previous jannet software version state
info: query information about installed software
checklog: update the installation log file if necessary
rpmnew: remove superfluous rpmnew files and show conflicts
for others
help: show this help screen
init: initialize
uninit: undo initialization
install: install packages in [arguments]
update: update all jannet software on the system
restore: restore a previous jannet software version state
info: query information about installed software
checklog: update the installation log file if necessary
rpmnew: remove superfluous rpmnew files and show conflicts
for others
build-date: show installed jannet packages along with build date
built-today: show installed jannet packages that were built today
EOT
if [ "$1" ]; then
@ -128,6 +130,24 @@ cmd_diff()
done
}
cmd_build_date()
{
list_all_packages |
xargs rpm -q --queryformat '%{BUILDTIME} %{NAME}\n' |
sort -n |
sed 's/-run\|-devel//' |
sort -u |
while read t p; do
echo `date --date=@$t --rfc-3339=seconds` $p
done
}
cmd_built_today()
{
local today=`date +'%Y-%m-%d'`
cmd_build_date | grep $today | cut -d' ' -f3
}
cmd="$1"
shift
get_opts $*
@ -193,10 +213,15 @@ rpmnew)
diff)
cmd_diff $@
;;
build-date)
cmd_build_date
;;
built-today)
cmd_built_today
;;
help)
usage 0
;;
*)
usage 1
;;