source: proiecte/HadoopJUnit/hadoop-0.20.1/src/saveVersion.sh @ 141

Last change on this file since 141 was 120, checked in by (none), 14 years ago

Added the mail files for the Hadoop JUNit Project

  • Property svn:executable set to *
File size: 1.7 KB
Line 
1#!/bin/sh
2
3# Licensed to the Apache Software Foundation (ASF) under one or more
4# contributor license agreements.  See the NOTICE file distributed with
5# this work for additional information regarding copyright ownership.
6# The ASF licenses this file to You under the Apache License, Version 2.0
7# (the "License"); you may not use this file except in compliance with
8# the License.  You may obtain a copy of the License at
9#
10#     http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17
18
19# This file is used to generate the BuildStamp.java class that
20# records the user, url, revision and timestamp.
21unset LANG
22unset LC_CTYPE
23version=$1
24user=`whoami`
25date=`date`
26if [ -d .git ]; then
27  revision=`git log -1 --pretty=format:"%H"`
28  hostname=`hostname`
29  branch=`git branch | sed -n -e 's/^* //p'`
30  url="git://$hostname/$cwd on branch $branch"
31else
32  revision=`svn info | sed -n -e 's/Last Changed Rev: \(.*\)/\1/p'`
33  url=`svn info | sed -n -e 's/URL: \(.*\)/\1/p'`
34fi
35mkdir -p build/src/org/apache/hadoop
36cat << EOF | \
37  sed -e "s/VERSION/$version/" -e "s/USER/$user/" -e "s/DATE/$date/" \
38      -e "s|URL|$url|" -e "s/REV/$revision/" \
39      > build/src/org/apache/hadoop/package-info.java
40/*
41 * Generated by src/saveVersion.sh
42 */
43@HadoopVersionAnnotation(version="VERSION", revision="REV",
44                         user="USER", date="DATE", url="URL")
45package org.apache.hadoop;
46EOF
Note: See TracBrowser for help on using the repository browser.