Skip to content

Commit

Permalink
lcov: use install -pD -m <mode> for file installation
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Oberparleiter authored and oberpar committed Jun 10, 2014
1 parent bdce1bd commit 5da3521
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
24 changes: 12 additions & 12 deletions Makefile
Expand Up @@ -37,18 +37,18 @@ clean:
make -C example clean

install:
bin/install.sh bin/lcov $(BIN_DIR)/lcov
bin/install.sh bin/genhtml $(BIN_DIR)/genhtml
bin/install.sh bin/geninfo $(BIN_DIR)/geninfo
bin/install.sh bin/genpng $(BIN_DIR)/genpng
bin/install.sh bin/gendesc $(BIN_DIR)/gendesc
bin/install.sh man/lcov.1 $(MAN_DIR)/man1/lcov.1
bin/install.sh man/genhtml.1 $(MAN_DIR)/man1/genhtml.1
bin/install.sh man/geninfo.1 $(MAN_DIR)/man1/geninfo.1
bin/install.sh man/genpng.1 $(MAN_DIR)/man1/genpng.1
bin/install.sh man/gendesc.1 $(MAN_DIR)/man1/gendesc.1
bin/install.sh man/lcovrc.5 $(MAN_DIR)/man5/lcovrc.5
bin/install.sh lcovrc $(CFG_DIR)/lcovrc
bin/install.sh bin/lcov $(BIN_DIR)/lcov -m 755
bin/install.sh bin/genhtml $(BIN_DIR)/genhtml -m 755
bin/install.sh bin/geninfo $(BIN_DIR)/geninfo -m 755
bin/install.sh bin/genpng $(BIN_DIR)/genpng -m 755
bin/install.sh bin/gendesc $(BIN_DIR)/gendesc -m 755
bin/install.sh man/lcov.1 $(MAN_DIR)/man1/lcov.1 -m 644
bin/install.sh man/genhtml.1 $(MAN_DIR)/man1/genhtml.1 -m 644
bin/install.sh man/geninfo.1 $(MAN_DIR)/man1/geninfo.1 -m 644
bin/install.sh man/genpng.1 $(MAN_DIR)/man1/genpng.1 -m 644
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

uninstall:
bin/install.sh --uninstall bin/lcov $(BIN_DIR)/lcov
Expand Down
11 changes: 7 additions & 4 deletions bin/install.sh
@@ -1,6 +1,6 @@
#!/bin/bash
#
# install.sh [--uninstall] sourcefile targetfile
# install.sh [--uninstall] sourcefile targetfile [install options]
#


Expand All @@ -9,15 +9,17 @@ if test "x$1" == "x--uninstall" ; then
UNINSTALL=true
SOURCE=$2
TARGET=$3
shift 3
else
UNINSTALL=false
SOURCE=$1
TARGET=$2
shift 2
fi

# Check usage
if test -z "$SOURCE" || test -z "$TARGET" ; then
echo Usage: install.sh [--uninstall] source target >&2
echo Usage: install.sh [--uninstall] source target [install options] >&2
exit 1
fi

Expand All @@ -30,8 +32,9 @@ do_install()
{
local SOURCE=$1
local TARGET=$2
local PARAMS=$3

install -D $SOURCE $TARGET
install -p -D $PARAMS $SOURCE $TARGET
}


Expand Down Expand Up @@ -62,7 +65,7 @@ do_uninstall()
if $UNINSTALL ; then
do_uninstall $SOURCE $TARGET
else
do_install $SOURCE $TARGET
do_install $SOURCE $TARGET "$*"
fi

exit 0

0 comments on commit 5da3521

Please sign in to comment.