Skip site navigation (1)Skip section navigation (2)
Date:      Thu,  4 May 2006 11:10:28 +0000 (GMT)
From:      ivan.lago@ifom-ieo-campus.it
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/96763: fixed asvn, a contrib of svn, to work ok FreeBSD
Message-ID:  <20060504111028.7DEF843D45@mx1.FreeBSD.org>
Resent-Message-ID: <200605041120.k44BKGdI051824@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         96763
>Category:       ports
>Synopsis:       fixed asvn, a contrib of svn, to work ok FreeBSD
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 04 11:20:15 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Ivan Lago
>Release:        FreeBSD 5.4-RELEASE-p8 i386
>Organization:
European Institute of Oncology
>Environment:
System: FreeBSD aaatest 5.4-RELEASE-p8 FreeBSD 5.4-RELEASE-p8 #0: Wed Nov 16 14:30:10 CET 2005 root@genebox:/usr/obj/usr/src/sys/GENEBOX i386


	
>Description:
 asvn, a scipt in svn contribs that traks ownership and permissions changes on versioned files, used GNU find so didn't work on BSD. I modified it to use gfind and I put findutils in RUN_DEPENDS in the case WITH_ASVN is valorized. I also made some improvements to the script
>How-To-Repeat:

>Fix:

--- svn.patch begins here ---
diff -ruN /usr/ports/devel/subversion/Makefile ./Makefile
--- /usr/ports/devel/subversion/Makefile	Thu May  4 10:29:33 2006
+++ ./Makefile	Thu May  4 13:03:55 2006
@@ -6,7 +6,7 @@
 
 PORTNAME=	subversion
 PORTVERSION=	1.3.1
-PORTREVISION?=	0
+PORTREVISION?=	1
 CATEGORIES=	devel
 MASTER_SITES=	http://subversion.tigris.org/downloads/:main \
 		http://svnbook.red-bean.com/en/1.1/:bookhtml \
@@ -37,6 +37,10 @@
 PORTDOCS=	${TXT_DOCS}
 .endif
 
+.if defined(WITH_ASVN)
+RUN_DEPENDS= ${LOCALBASE}/bin/gfind:${PORTSDIR}/misc/findutils:install
+.endif
+
 .if !defined(WITHOUT_NLS)
 USE_GETTEXT=		yes
 PLIST_SUB+=		WITHOUT_GETTEXT=""
@@ -299,6 +303,12 @@
 	@${ECHO_MSG} "You can install the Subversion Book by defining WITH_BOOK."
 .endif
 	@${ECHO_MSG} ""
+.if defined(WITH_ASVN)
+	@${ECHO_MSG} "asvn will be installed"
+.else
+	@${ECHO_MSG} "You can install asvn from contrib by defining WITH_ASVN"
+.endif
+	@${ECHO_MSG} ""
 	@${ECHO_MSG} "Many useful scripts will be installed into ${PREFIX}/share/subversion"
 
 post-extract:
@@ -375,6 +385,9 @@
 	${INSTALL_DATA} ${DISTDIR}/svn-book.html ${DOCSDIR}/book
 	${INSTALL_DATA} ${DISTDIR}/svn-book.pdf ${DOCSDIR}/book
 .endif
+.endif
+.if defined(WITH_ASVN)
+	${INSTALL_SCRIPT} ${WRKSRC}/contrib/client-side/asvn ${PREFIX}/bin
 .endif
 .if defined(WITH_PERL)
 	cd ${WRKSRC} ; \
diff -ruN /usr/ports/devel/subversion/files/patch-contrib::client-side::asvn ./files/patch-contrib::client-side::asvn
--- /usr/ports/devel/subversion/files/patch-contrib::client-side::asvn	Thu Jan  1 01:00:00 1970
+++ ./files/patch-contrib::client-side::asvn	Thu May  4 11:04:45 2006
@@ -0,0 +1,188 @@
+--- asvn	Tue Jun 15 06:02:44 2004
++++ /tmp/subversion/work/subversion-1.3.1/contrib/client-side/asvn	Thu May  4 11:04:22 2006
+@@ -36,6 +36,7 @@
+ #
+ #
+ #-------------------------------------------------------------------------
++EDITOR=vi
+ SVN=/usr/local/bin/svn
+ ACTION=""
+ DEV_PROP="dir:devices"
+@@ -46,13 +47,15 @@
+ TMPFILE2=/tmp/asvn.tmp2.$$
+ PCWD=`/bin/pwd`
+ SKIPSVN='\( -name .svn -prune -false \)'
+-PRINTDETAILS="-printf \"file='%p' mode=%m user=%u(%U) group=%g(%G)\n\""
++PRINTDETAILS="-printf \"file='%p' mode=%m user=(%U) group=(%G)\n\""
++STAMP=`date "+%Y%m%d%H%M%S"`
+ 
+ trap cleanup 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
+ 
+ function cleanup()
+ {
+     rm -f $TMPFILE $TMPFILE1 $TMPFILE2
++    [ -d /tmp/$STAMP.svn ] && rm -Rf /tmp/$STAMP.svn
+ }
+ 
+ function basedirname()
+@@ -105,7 +108,7 @@
+ 
+ function recorddirinfo
+ {
+-    eval "find $PCWD $SKIPSVN -o \( -type d ! -name .svn  -print \)" |while read dirlist
++    eval "gfind $PCWD $SKIPSVN -o \( -type d ! -name .svn  -print \)" |while read dirlist
+     do
+ 	updatedirsymlinks $1 $dirlist
+ 	updatedirdevices $1 $dirlist
+@@ -126,9 +129,9 @@
+     #
+     # Obtain the list of devices in this directory
+     #
+-    find "$dir" \( \( -type b -o -type c -o -type p \) -print \)  -o  -type d ! -name "`basename $dir`" -prune | while read file
++    gfind "$dir" \( \( -type b -o -type c -o -type p \) -print \)  -o  -type d ! -name "`basename $dir`" -prune | while read file
+     do
+-	echo -n `find $file -printf "file='%f' mode=%m user=%u(%U) group=%g(%G)"`
++	echo -n `gfind $file -printf "file='%f' mode=%m user=(%U) group=(%G)"`
+ 	[ -b $file ] && echo -n ' type=b'
+ 	[ -c $file ] && echo -n ' type=c'
+ 	[ -p $file ] && echo ' type=p'
+@@ -194,10 +197,10 @@
+ 	    grep -q "$info" $TMPFILE && continue # This line still matches
+ 	    file=`expr "$info" : "file='\(.*\)' "`
+ 	    mode=`expr "$info" : ".*' mode=\([0-9]*\) "`
+-	    user=`expr "$info" : ".* user=\([^(]*\)("`
+-	    uid=`expr "$info" : ".* user=[^(]*(\([0-9]*\) "`
+-	    group=`expr "$info" : ".* group=\([^(]*\)("`
+-	    gid=`expr "$info" : ".* group=[^(]*(\([0-9]*\) "`
++#	    user=`expr "$info" : ".* user=\([^(]*\)("`
++	    uid=`expr "$info" : ".* user=[^(]*(\([0-9]*\)"`
++#	    group=`expr "$info" : ".* group=\([^(]*\)("`
++	    gid=`expr "$info" : ".* group=[^(]*(\([0-9]*\)"`
+ 	    type=`expr "$info" : ".* type=\(.\)"`
+ 	    major=`expr "$info" : ".* major=\([0-9]*\)"`
+ 	    minor=`expr "$info" : ".* minor=\([0-9]*\)"`
+@@ -207,7 +210,8 @@
+ 	    #
+ 	    rm -f $dir/$file
+ 	    mknod --mode=$mode $dir/$file $type $major $minor
+-	    chown $user:$group $dir/$file
++#	    chown $user:$group $dir/$file
++	    chown $uid:$gid $dir/$file
+ 	    addignorefile $dir/$file
+ 	done
+     fi
+@@ -228,7 +232,7 @@
+     #
+     # Obtain the list of symlinks in this directory
+     #
+-    find "$dir" \( -type l -printf "file='%f' dest='%l'\n" \)  -o  -type d ! -name "`basename $dir`" -prune |
++    gfind "$dir" \( -type l -printf "file='%f' dest='%l'\n" \)  -o  -type d ! -name "`basename $dir`" -prune |
+ 	sort >$TMPFILE
+     
+     #
+@@ -294,7 +298,7 @@
+ 
+ 	    if [ -L $dir/$file  ]
+ 	    then
+-		[ "`find $dir/$file -printf '%l'`" = "$dest" ] && continue
++		[ "`gfind $dir/$file -printf '%l'`" = "$dest" ] && continue
+ 	    fi 
+ 	    rm -f $dir/$file
+ 	    ln -s $dest $dir/$file
+@@ -313,37 +317,39 @@
+ 
+     # Find all the directories and files
+     cp /dev/null $TMPFILE
+-    eval "find $PCWD $SKIPSVN -o \( \( -type d ! -name .svn  \) -o -type f \) $PRINTDETAILS" | while read info
++    eval "gfind $PCWD $SKIPSVN -o \( \( -type d ! -name .svn  \) -o -type f \) $PRINTDETAILS" | while read info
+     do
+ 	device=`expr "$info" : "file='\(.*\)' mode"`
+ 	info=`expr "$info" : "file='.*' \(mode.*\)"`
++	#echo DEBUG: device vale $device
+ 	if [ "$PCWD" = "$device" ]
+ 	then
+ 	    dir="."
+ 	    file=""
+ 	else
+ 	    dir="`basedirname $PCWD $device`"
+-	    file="`basename $device`"
++	    file=`basename "$device"`
+ 	fi
+ 	# see if the properties have changed.
+-	if [ "`$SVN propget $FILE_PROP $dir/$file`" != "$info" ]
++	if [ "`$SVN propget $FILE_PROP \"$dir/$file\"`" != "$info" ]
+ 	then
+ 	    if [ "$CHECKIN" = "true" ]
+ 	    then
+-		$SVN propset $FILE_PROP  "$info" $dir/$file
++		$SVN propset $FILE_PROP  "$info" "$dir/$file"
+ 	    else
+ 		info=`$SVN propget $FILE_PROP "$dir/$file"`
+ 		mode=`expr "$info" : "mode=\([0-9]*\) "`
+-		user=`expr "$info" : ".* user=\([^(]*\)("`
+-		uid=`expr "$info" : ".* user=[^(]*(\([0-9]*\) "`
+-		group=`expr "$info" : ".* group=\([^(]*\)("`
+-		gid=`expr "$info" : ".* group=[^(]*(\([0-9]*\) "`
+-		if  [ "$user" = "" -o "$group" = ""  -o "$mode" = "" ]
++#		user=`expr "$info" : ".* user=\([^(]*\)("`
++		uid=`expr "$info" : ".* user=[^(]*(\([0-9]*\)"`
++#		group=`expr "$info" : ".* group=\([^(]*\)("`
++		gid=`expr "$info" : ".* group=[^(]*(\([0-9]*\)"`
++		if  [ "$uid" = "" -o "$gid" = ""  -o "$mode" = "" ]
+ 		then
+ 		    echo "property $FILE_PROP not set for $dir/$file"
+ 		else
+-		    chown $user:$group  $dir/$file
+-		    chmod $mode $dir/$file
++#	    		chown $user:$group $dir/$file
++		    chown $uid:$gid  "$dir/$file"
++		    chmod $mode "$dir/$file"
+ 		fi
+ 	    fi
+ 	fi
+@@ -364,19 +370,35 @@
+     if [ "$CHDIR" = "true" ]
+     then
+ 	shift $(($# -1))
+-	cd $1
+-    PCWD="$PCWD/$1"
++        WD=`echo $1 | sed "s/\/$//" | awk -F "/" '{print $(NF)}' `
++        cd $WD
++        PCWD="$PCWD/$WD"
+     fi
+     recorddirinfo 
+     recordpermissions 
+ }
+ 
++function copy_rep()
++{
++    echo settin repository properties
++    mkdir /tmp/$STAMP.svn
++    cd /tmp/$STAMP.svn
++    $SVN co $3
++    WD=`echo $3 | awk -F "/" '{print $(NF -1)}' `
++    cd $WD
++    cp -RPp $2/* .
++    asvn commit -m 'fix_permissions'
++}
++
++
+ CHDIR=false
+ case "$1" in
+ checkout|co)	CHDIR=true; ACTION="post";;
+ commit|ci)	ACTION="pre";;
+ switch|sw)	ACTION="post";;
+ update|up)	ACTION="post";;
++#import)		PCWD=$2; ACTION="imp";;
++import)		ACTION="imp";;
+ *);;
+ esac
+ 
+@@ -386,6 +408,7 @@
+ 
+ [ $? = 0 -a "$ACTION" = "post" ] && post_checkout $@
+ 
++[ "$ACTION" =  "imp" ] && copy_rep $@
+ cleanup
+ #
+ # vim: set ai ts=8 sw=4
diff -ruN /usr/ports/devel/subversion/pkg-plist ./pkg-plist
--- /usr/ports/devel/subversion/pkg-plist	Fri Mar 24 10:11:23 2006
+++ ./pkg-plist	Thu May  4 12:25:40 2006
@@ -4,6 +4,7 @@
 bin/svndumpfilter
 bin/svnlook
 bin/svnserve
+%%WITH_ASVN%%bin/asvn
 %%SVNSERVE_WRAPPER%%bin/svnserve.bin
 bin/svnversion
 include/subversion-1/mod_dav_svn.h
--- svn.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060504111028.7DEF843D45>