Skip to content

Commit

Permalink
lcov: Finalize release 1.12
Browse files Browse the repository at this point in the history
 - Use full git describe output as tool version
 - Update version numbers and last-changed-dates in man pages,
   spec and README file
 - Replace static CHANGES file with git log
 - Switch Makefile logic to use mktemp for generating a temporary
   directory

Signed-off-by: Peter Oberparleiter <[email protected]>
  • Loading branch information
oberpar committed Oct 5, 2015
1 parent 1ad4f77 commit de33f51
Show file tree
Hide file tree
Showing 18 changed files with 54 additions and 586 deletions.
551 changes: 0 additions & 551 deletions CHANGES

This file was deleted.

31 changes: 16 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@

VERSION := $(shell bin/get_version.sh --version)
RELEASE := $(shell bin/get_version.sh --release)
FULL := $(shell bin/get_version.sh --full)

CFG_DIR := $(PREFIX)/etc
BIN_DIR := $(PREFIX)/usr/bin
MAN_DIR := $(PREFIX)/usr/share/man
TMP_DIR := /tmp/lcov-tmp.$(shell echo $$$$)
FILES := $(wildcard bin/*) $(wildcard man/*) README CHANGES Makefile \
TMP_DIR := $(shell mktemp -d)
FILES := $(wildcard bin/*) $(wildcard man/*) README Makefile \
$(wildcard rpm/*) lcovrc

.PHONY: all info clean install uninstall rpms
Expand Down Expand Up @@ -49,17 +50,17 @@ install:
bin/install.sh man/gendesc.1 $(MAN_DIR)/man1/gendesc.1 -m 644
bin/install.sh man/lcovrc.5 $(MAN_DIR)/man5/lcovrc.5 -m 644
bin/install.sh lcovrc $(CFG_DIR)/lcovrc -m 644
bin/updateversion.pl $(BIN_DIR)/lcov $(VERSION) $(RELEASE)
bin/updateversion.pl $(BIN_DIR)/genhtml $(VERSION) $(RELEASE)
bin/updateversion.pl $(BIN_DIR)/geninfo $(VERSION) $(RELEASE)
bin/updateversion.pl $(BIN_DIR)/genpng $(VERSION) $(RELEASE)
bin/updateversion.pl $(BIN_DIR)/gendesc $(VERSION) $(RELEASE)
bin/updateversion.pl $(MAN_DIR)/man1/lcov.1 $(VERSION) $(RELEASE)
bin/updateversion.pl $(MAN_DIR)/man1/genhtml.1 $(VERSION) $(RELEASE)
bin/updateversion.pl $(MAN_DIR)/man1/geninfo.1 $(VERSION) $(RELEASE)
bin/updateversion.pl $(MAN_DIR)/man1/genpng.1 $(VERSION) $(RELEASE)
bin/updateversion.pl $(MAN_DIR)/man1/gendesc.1 $(VERSION) $(RELEASE)
bin/updateversion.pl $(MAN_DIR)/man5/lcovrc.5 $(VERSION) $(RELEASE)
bin/updateversion.pl $(BIN_DIR)/lcov $(VERSION) $(RELEASE) $(FULL)
bin/updateversion.pl $(BIN_DIR)/genhtml $(VERSION) $(RELEASE) $(FULL)
bin/updateversion.pl $(BIN_DIR)/geninfo $(VERSION) $(RELEASE) $(FULL)
bin/updateversion.pl $(BIN_DIR)/genpng $(VERSION) $(RELEASE) $(FULL)
bin/updateversion.pl $(BIN_DIR)/gendesc $(VERSION) $(RELEASE) $(FULL)
bin/updateversion.pl $(MAN_DIR)/man1/lcov.1 $(VERSION) $(RELEASE) $(FULL)
bin/updateversion.pl $(MAN_DIR)/man1/genhtml.1 $(VERSION) $(RELEASE) $(FULL)
bin/updateversion.pl $(MAN_DIR)/man1/geninfo.1 $(VERSION) $(RELEASE) $(FULL)
bin/updateversion.pl $(MAN_DIR)/man1/genpng.1 $(VERSION) $(RELEASE) $(FULL)
bin/updateversion.pl $(MAN_DIR)/man1/gendesc.1 $(VERSION) $(RELEASE) $(FULL)
bin/updateversion.pl $(MAN_DIR)/man5/lcovrc.5 $(VERSION) $(RELEASE) $(FULL)

uninstall:
bin/install.sh --uninstall bin/lcov $(BIN_DIR)/lcov
Expand All @@ -79,12 +80,12 @@ dist: lcov-$(VERSION).tar.gz lcov-$(VERSION)-$(RELEASE).noarch.rpm \
lcov-$(VERSION)-$(RELEASE).src.rpm

lcov-$(VERSION).tar.gz: $(FILES)
mkdir $(TMP_DIR)
mkdir $(TMP_DIR)/lcov-$(VERSION)
cp -r * $(TMP_DIR)/lcov-$(VERSION)
bin/copy_dates.sh . $(TMP_DIR)/lcov-$(VERSION)
make -C $(TMP_DIR)/lcov-$(VERSION) clean
bin/updateversion.pl $(TMP_DIR)/lcov-$(VERSION) $(VERSION) $(RELEASE)
bin/updateversion.pl $(TMP_DIR)/lcov-$(VERSION) $(VERSION) $(RELEASE) $(FULL)
bin/get_changes.sh > $(TMP_DIR)/lcov-$(VERSION)/CHANGES
cd $(TMP_DIR) ; \
tar cfz $(TMP_DIR)/lcov-$(VERSION).tar.gz lcov-$(VERSION)
mv $(TMP_DIR)/lcov-$(VERSION).tar.gz .
Expand Down
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-------------------------------------------------
- README file for the LTP GCOV extension (LCOV) -
- Last changes: 2014-05-23 -
- Last changes: 2014-06-18 -
-------------------------------------------------

Description
Expand Down
2 changes: 1 addition & 1 deletion bin/gendesc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use Cwd qw/abs_path/;

# Constants
our $tool_dir = abs_path(dirname($0));
our $lcov_version = 'LCOV version '.`$tool_dir/get_version.sh --version`;
our $lcov_version = 'LCOV version '.`$tool_dir/get_version.sh --full`;
our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php";
our $tool_name = basename($0);

Expand Down
2 changes: 1 addition & 1 deletion bin/genhtml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ use Cwd qw/abs_path/;
# Global constants
our $title = "LCOV - code coverage report";
our $tool_dir = abs_path(dirname($0));
our $lcov_version = 'LCOV version '.`$tool_dir/get_version.sh --version`;
our $lcov_version = 'LCOV version '.`$tool_dir/get_version.sh --full`;
our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php";
our $tool_name = basename($0);

Expand Down
2 changes: 1 addition & 1 deletion bin/geninfo
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ if( $^O eq "msys" )

# Constants
our $tool_dir = abs_path(dirname($0));
our $lcov_version = 'LCOV version '.`$tool_dir/get_version.sh --version`;
our $lcov_version = 'LCOV version '.`$tool_dir/get_version.sh --full`;
our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php";
our $gcov_tool = "gcov";
our $tool_name = basename($0);
Expand Down
2 changes: 1 addition & 1 deletion bin/genpng
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use Cwd qw/abs_path/;

# Constants
our $tool_dir = abs_path(dirname($0));
our $lcov_version = 'LCOV version '.`$tool_dir/get_version.sh --version`;
our $lcov_version = 'LCOV version '.`$tool_dir/get_version.sh --full`;
our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php";
our $tool_name = basename($0);

Expand Down
13 changes: 13 additions & 0 deletions bin/get_changes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
#
# Usage: get_changes.sh
#
# Print lcov change log information as provided by Git

TOOLDIR=$(cd $(dirname $0) ; pwd)

cd $TOOLDIR

if ! git --no-pager log --no-merges --decorate=short --color=never 2>/dev/null ; then
cat "$TOOLDIR/../CHANGES" 2>/dev/null
fi
13 changes: 8 additions & 5 deletions bin/get_version.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Usage: get_version.sh --version|--release
# Usage: get_version.sh --version|--release|--full
#
# Print lcov version or release information as provided by Git, .version
# or a fallback.
Expand All @@ -15,6 +15,7 @@ if [ -z "$GITVER" ] ; then
fi
else
# Get version information from git
FULL=${GITVER:1}
VERSION=${GITVER%%-*}
VERSION=${VERSION:1}
if [ "${GITVER#*-}" != "$GITVER" ] ; then
Expand All @@ -24,8 +25,10 @@ else
fi

# Fallback
[ -z "$VERSION" ] && VERSION=1.0
[ -z "$RELEASE" ] && RELEASE=1
[ -z "$VERSION" ] && VERSION="1.0"
[ -z "$RELEASE" ] && RELEASE="1"
[ -z "$FULL" ] && FULL="$VERSION"

[ "$1" == "--version" ] && echo -n $VERSION
[ "$1" == "--release" ] && echo -n $RELEASE
[ "$1" == "--version" ] && echo -n "$VERSION"
[ "$1" == "--release" ] && echo -n "$RELEASE"
[ "$1" == "--full" ] && echo -n "$FULL"
2 changes: 1 addition & 1 deletion bin/lcov
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ use Cwd qw /abs_path getcwd/;

# Global constants
our $tool_dir = abs_path(dirname($0));
our $lcov_version = 'LCOV version '.`$tool_dir/get_version.sh --version`;
our $lcov_version = 'LCOV version '.`$tool_dir/get_version.sh --full`;
our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php";
our $tool_name = basename($0);

Expand Down
6 changes: 4 additions & 2 deletions bin/updateversion.pl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
our $directory = $ARGV[0];
our $version = $ARGV[1];
our $release = $ARGV[2];
our $full = $ARGV[3];

our @man_pages = ("man/gendesc.1", "man/genhtml.1", "man/geninfo.1",
"man/genpng.1", "man/lcov.1", "man/lcovrc.5");
Expand All @@ -23,7 +24,7 @@
our @spec_files = ("rpm/lcov.spec");

if (!defined($directory) || !defined($version) || !defined($release)) {
die("Usage: $0 DIRECTORY|FILE VERSION RELEASE\n");
die("Usage: $0 DIRECTORY|FILE VERSION RELEASE FULL_VERSION\n");
}

# Determine mode of operation
Expand Down Expand Up @@ -127,7 +128,7 @@ ($)
open(OUT, ">$filename.new") ||
die("Error: cannot create $filename.new\n");
while (<IN>) {
s/^(our\s+\$lcov_version\s*=).*$/$1 "LCOV version $version";/g;
s/^(our\s+\$lcov_version\s*=).*$/$1 "LCOV version $full";/g;
print(OUT $_);
}
close(OUT);
Expand Down Expand Up @@ -187,5 +188,6 @@ ($)
open($fd, ">", $filename) or die("Error: cannot write $filename: $!\n");
print($fd "VERSION=$version\n");
print($fd "RELEASE=$release\n");
print($fd "FULL=$full\n");
close($fd);
}
2 changes: 1 addition & 1 deletion man/gendesc.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH gendesc 1 "LCOV 1.11" 2014\-05\-23 "User Manuals"
.TH gendesc 1 "LCOV 1.12" 2014\-06\-10 "User Manuals"
.SH NAME
gendesc \- Generate a test case description file
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion man/genhtml.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH genhtml 1 "LCOV 1.11" 2014\-05\-23 "User Manuals"
.TH genhtml 1 "LCOV 1.12" 2014\-09\-26 "User Manuals"
.SH NAME
genhtml \- Generate HTML view from LCOV coverage data files
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion man/geninfo.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH geninfo 1 "LCOV 1.11" 2014\-05\-23 "User Manuals"
.TH geninfo 1 "LCOV 1.12" 2015\-04\-22 "User Manuals"
.SH NAME
geninfo \- Generate tracefiles from .da files
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion man/genpng.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH genpng 1 "LCOV 1.11" 2014\-05\-23 "User Manuals"
.TH genpng 1 "LCOV 1.12" 2014\-06\-10 "User Manuals"
.SH NAME
genpng \- Generate an overview image from a source file
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion man/lcov.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH lcov 1 "LCOV 1.11" 2014\-05\-23 "User Manuals"
.TH lcov 1 "LCOV 1.12" 2014\-06\-10 "User Manuals"
.SH NAME
lcov \- a graphical GCOV front\-end
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion man/lcovrc.5
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH lcovrc 5 "LCOV 1.11" 2014\-05\-23 "User Manuals"
.TH lcovrc 5 "LCOV 1.12" 2015\-04\-22 "User Manuals"

.SH NAME
lcovrc \- lcov configuration file
Expand Down
2 changes: 1 addition & 1 deletion rpm/lcov.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Summary: A graphical GCOV front-end
Name: lcov
Version: 1.11
Version: 1.12
Release: 1
License: GPL
Group: Development/Tools
Expand Down

0 comments on commit de33f51

Please sign in to comment.