This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] dodoc: install directories recursively


On 4/1/2012 3:52 PM, Yaakov (Cygwin/X) wrote:
From: Yaakov Selkowitz<yselkowitz@users.sourceforge.net>

---
  lib/src_install.cygpart |   18 +++++++++++++++---
  1 files changed, 15 insertions(+), 3 deletions(-)

Try this instead.

diff --git a/lib/src_install.cygpart b/lib/src_install.cygpart
index 9165f11..b17c7d5 100644
--- a/lib/src_install.cygpart
+++ b/lib/src_install.cygpart
@@ -153,10 +153,12 @@ docinto() {
  #  SYNOPSIS
  #  dodoc FILE [FILE] ...
  #  DESCRIPTION
-#  Installs the given files into $D/usr/share/doc/PN/, or a subdirectory thereof
-#  specified by the previous call to docinto.
+#  Installs the given files or directories into $D/usr/share/doc/PN/, or a
+#  subdirectory thereof specified by the previous call to docinto.
  #****
  dodoc() {
+	local docdir d f i
+
  	case "${_docinto_dir}" in
  		'')	docdir=/usr/share/doc/${PN} ;;
  		/*)	docdir=/usr/share/doc${_docinto_dir} ;;
@@ -167,7 +169,17 @@ dodoc() {

  	for i
  	do
-		if [ -f ${i} -o -L ${i} ]
+		if [ -d ${i} ]
+		then
+			d=${i%/}
+			pushd ${d}/..
+			dodir $(find ${d##*/} -type d -exec printf ${docdir}/'{}'" " \;)
+			for f in $(find ${d##*/} ! -type d)
+			do
+				__doinstall 0644 ${f} ${docdir}/${f%/*} || error "dodoc -r ${d} failed"
+			done
+			popd
+		elif [ -f ${i} -o -L ${i} ]
  		then
  			if [ "x$(file -b ${i})" != "xempty" -a ! -f ${D}${docdir}/${i} ]
  			then

It works. Thanks.


Ken


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]