URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [contrib/] [reghunt/] [bin/] [gcc-svn-ids] - Rev 723
Compare with Previous | Blame | View Log
#! /bin/sh# Convert one kind of changeset identifier to another.## Usage: gcc-svn-ids -f from_kind -t to_kind id## Where from_kind is one of:# index index into the changeset list used by the reghunt tools# rev is the Subversion revision name# and to_kind is one of:# index index into the changeset list used by the reghunt tools# rev is the Subversion revision name# date expanded UTC date string# branch the branch, or "trunk" for mainline# author the person who checked in the patcherrmsg () {echo $1 1>&2}usage () {echo 'cvs_ids -f kind -t kind id' 1>&2echo ' where from_kind is index or rev' 1>&2echo ' and to_kind is index, rev, date, author, or branch' 1>&2echo "error"exit 1}if [ "x${REG_CHANGESET_LIST}" = "x" ]; thenerrmsg "REG_CHANGESET_LIST is not defined"echo "error"exit 1fiif [ ! -f ${REG_CHANGESET_LIST} ]; thenerrmsg "changeset list ${REG_CHANGESET_LIST} does not exist"echo "error"exit 1fi# Use a shorter name here.LIST=${REG_CHANGESET_LIST}while getopts "f:t:" ARG; docase ${ARG} inf) FROM_KIND="${OPTARG}";;t) TO_KIND="${OPTARG}";;h) usage;;*) errmsg "unrecognized option: ${ARG}";usage;;esacdoneshift `expr ${OPTIND} - 1`if [ $# -eq 0 ]; thenerrmsg "too few arguments, ID is missing"usagefiif [ $# -gt 1 ]; thenerrmsg "unexpected arguments: $*"usagefiID="$1"case ${FROM_KIND} inindex) LINE=`awk -F '|' -v id="${ID}" '{if ($1 == id) print }' < ${LIST}`;;rev) LINE=`awk -F '|' -v id="${ID}" '{if ($2 == id) print }' < ${LIST}`;;*) errmsg "unrecognized FROM kind: ${FROM_KIND}";usage;;esacif [ "x${LINE}" = "x" ]; thenerrmsg "no entry found for ${FROM_KIND} = ${ID}"echo "error"exit 1ficase ${TO_KIND} inindex) TO_ID="`echo ${LINE} | awk -F '|' '{ print $1 }'`";;rev) TO_ID="`echo ${LINE} | awk -F '|' '{ print $2 }'`";;author) TO_ID="`echo ${LINE} | awk -F '|' '{ print $3 }'`";;date) TO_ID="`echo ${LINE} | awk -F '|' '{ print $4 }'`";;branch) TO_ID="`echo ${LINE} | awk -F '|' '{ print $5 }'`";;*) errmsg "unrecognized TO kind: ${TO_KIND}";usage;;esacecho ${TO_ID}
