#!/bin/sh # converts old changed dirnames to the previous format again # where slots aren't reflected in the dir path name slots=$(find /var/db/pkg -name SLOT) for slot in $slots; do dir=${slot%SLOT} pf=$(cat $dir/PF) newdir=$(dirname $dir) newdir="$newdir/$pf" if [ ! -d $newdir ] then mv $dir $newdir echo "$dir has been converted" else echo "$newdir already exists" fi done