Fix up the join-dupicates.sh script and add an option to pull in the required

dependecies for it.

While here, convert to USES=localbase.

PR:		224620
Submitted by:	mat
This commit is contained in:
Jason E. Hale
2017-12-29 15:47:00 +00:00
parent 98c56246e8
commit f1583dff44
2 changed files with 35 additions and 6 deletions

View File

@@ -2,7 +2,7 @@
PORTNAME= duff
PORTVERSION= 0.5.2
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= sysutils
MASTER_SITES= SF
@@ -12,17 +12,20 @@ COMMENT= Duplicate file finder
LICENSE= ZLIB
LICENSE_FILE= ${WRKSRC}/COPYING
USES= tar:bzip2
USES= localbase tar:bzip2 shebangfix
GNU_CONFIGURE= yes
CPPFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
bash_OLD_CMD= /bin/sh
SHEBANG_FILES= join-duplicates.sh
PORTDOCS= README.SHA
OPTIONS_DEFINE= NLS
OPTIONS_DEFINE= JOIN NLS
OPTIONS_SUB= yes
JOIN_DESC= Add run-dependencies for join-duplicates.sh
JOIN_RUN_DEPENDS= bash:shells/bash \
gtouch:sysutils/coreutils
NLS_USES= gettext
NLS_CONFIGURE_ENABLE= nls

View File

@@ -0,0 +1,26 @@
--- join-duplicates.sh.orig 2011-04-10 13:17:26 UTC
+++ join-duplicates.sh
@@ -25,16 +25,19 @@ duff -r '-f#' -z -p -P "$1" |
if [ "$first" == '' ]; then
first="$file"
else
- temp=`mktemp -p \`dirname $file\``
+ dir=`dirname "$file"`
+ temp=`gmktemp -p "$dir"`
mv "$file" "$temp" && \
ln "$first" "$file" && \
- touch --reference="$temp" "$file" && \
+ gtouch --reference="$temp" "$file" && \
rm "$temp"
+ echo "$first <- $file"
+
if [ $? != 0 ]; then
- echo "`basename $0`: $file: failed to join with $first"
- echo "`basename $0`: $file: may exist as $temp"
+ echo "`basename "$0"`: $file: failed to join with $first"
+ echo "`basename "$0"`: $file: may exist as $temp"
exit 1
fi
fi