From owner-freebsd-questions@FreeBSD.ORG Fri Jan 25 15:40:45 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 03ECEA54 for ; Fri, 25 Jan 2013 15:40:45 +0000 (UTC) (envelope-from glarkin@FreeBSD.org) Received: from mail1.sourcehosting.net (mail1.sourcehosting.net [74.205.51.45]) by mx1.freebsd.org (Postfix) with ESMTP id D10E0678 for ; Fri, 25 Jan 2013 15:40:44 +0000 (UTC) Received: from 24-181-237-39.dhcp.oxfr.ma.charter.com ([24.181.237.39] helo=Gregory-Larkins-iMac.local) by mail1.sourcehosting.net with esmtp (Exim 4.73 (FreeBSD)) (envelope-from ) id 1TylOM-0002lL-Uw; Fri, 25 Jan 2013 10:40:40 -0500 Received: from Gregory-Larkins-iMac.local (localhost [127.0.0.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by Gregory-Larkins-iMac.local (Postfix) with ESMTPS id 745E019AC275; Fri, 25 Jan 2013 10:40:34 -0500 (EST) Message-ID: <5102A771.1080704@FreeBSD.org> Date: Fri, 25 Jan 2013 10:40:33 -0500 From: Greg Larkin Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Xyne References: <20130116185832.GB8524@external.screwed.box> <50F6FD37.5060309@gmail.com> <20130116193534.GC8524@external.screwed.box> <50F704CE.3010904@gmail.com> <20130116200754.GD8524@external.screwed.box> <50F70C60.4000108@FreeBSD.org> <20130116205533.GE8524@external.screwed.box> <20130117045431.GB5392@external.screwed.box> <20130119052245.004da49b@archlinux.ca> <51004B62.5090305@FreeBSD.org> <20130124221636.307dca09@archlinux.ca> In-Reply-To: <20130124221636.307dca09@archlinux.ca> X-Enigmail-Version: 1.5 X-SA-Exim-Connect-IP: 24.181.237.39 X-SA-Exim-Mail-From: glarkin@FreeBSD.org X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail1.sourcehosting.net X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00, RCVD_IN_SORBS_DUL,RDNS_DYNAMIC,TVD_RCVD_IP autolearn=no version=3.3.1 Subject: Re: svn-export Re: svn bdb checkout? Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SA-Exim-Version: 4.2 X-SA-Exim-Scanned: Yes (on mail1.sourcehosting.net) Cc: Peter Vereshagin , freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: glarkin@FreeBSD.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2013 15:40:45 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 1/24/13 5:16 PM, Xyne wrote: > Greg Larkin wrote: > >> Hi Xyne, >> >> Thanks for turning that around so quickly, and I am doing some >> testing here with the idea to incorporate svn-export into the >> FreeBSD ports tree. >> >> I've run into a couple of problems that I hope you can take a >> look at it: >> >> - - Changesets containing directory or file deletions cause the >> script to exit. Here is an example where I fetched the FreeBSD >> ports tree at a particular revision, then attempted to update to >> the latest revision: >> >> # python3 svn-export --revision-file foo2.dat >> http://svn.freebsd.org/head/ports-mgmt ports-mgmt Determining >> current revision. Current revision is 310894. Determining changes >> [310000:310894]. 16 new/modified files, 5 deletions Traceback >> (most recent call last): File "svn-export", line 407, in >> svn.main() File "svn-export", line 380, in main >> self.remove_old_files(deleted) File "svn-export", line 302, in >> remove_old_files os.unlink(path) PermissionError: [Errno 1] >> Operation not permitted: 'ports-mgmt/pkg/files' >> >> - - I can't get the --to-script option to work if there are any >> file/directory deletions in the changeset. It looks like the >> actual deletion operations are attempted (like above) even when >> the - --to-script option is selected. >> >> Let me know if you need any other information. >> >> Thank you, Greg > > > Hi, > > I think I have fixed both errors in svn-export-2013.1.24, along > with another directory-related error that I discovered while > debugging (attempts to cat new directories in incremental exports > instead of recursing them). Please try again and let me know if it > works. > > If not, please post steps to reproduce the error with a publicly > accessible repo. I was unable to access the ports-mgmt repos in > your example. Hi Xyne, I mistyped the repository URL in my previous email, and I just captured a session that displays an error similar to the one above. Note that I pre-seeded the environment with a rev.dat file containing the string "310000". I did that to simulate an incremental fetch, as you'll see here: # python3 svn-export -r 310000 http://svn.freebsd.org/ports/head/ports-mgmt ports-mgmt Exporting new repository. Exported revision 310000 # python3 svn-export --revision-file rev.dat http://svn.freebsd.org/ports/head/ports-mgmt ports-mgmt Determining current revision. Current revision is 310981. Determining changes [310000:310981]. 16 new/modified files, 5 deletions Traceback (most recent call last): File "svn-export", line 459, in svn.main() File "svn-export", line 432, in main self.remove_old_files(deleted) File "svn-export", line 310, in remove_old_files os.unlink(path) PermissionError: [Errno 1] Operation not permitted: 'ports-mgmt/pkg/files' # exit As far as I can tell, svn-export attempts to remove a directory before the file contained within that directory. It seems like PermissionError isn't the best error code for Python to throw in that case, since it appears to mask the root problem. Can you re-order the deletes so all files are deleted first, then directories are deleted in a bottom-up sequence? I think that will solve this problem. > > Incidentally, if anyone is looking at the code for svn-export, feel > free to suggest a better way to incrementally export new > subdirectories (see the "get_new_files()" method). I'll take a look at that soon to see if there are any possible optimizations. > > Incidentally, my release scripts do not leave old source archives > on the server for very long after a new release and I tend to > update often when I can. If you need me to increase the shelf life > of old archives to prevent 404's, let me know (give me a reasonable > interval and I will update my scripts). In the future I may switch > to posting my private Git repos, but I tend to rewrite history and > I know that really irks people. > > Regards, Xyne > Once we create a port for svn-export, we typically point to the original download site in the port Makefile. It's a good idea for the port maintainer to find a mirror site and include that too, but if not, all distro files are eventually mirrored to the FreeBSD cluster. Ideally, the source distros remain in place forever or at least until the FreeBSD port is updated to the latest version, but if that's not possible, I can mirror the files too. Thank you, Greg - -- Greg Larkin http://www.FreeBSD.org/ - The Power To Serve http://www.sourcehosting.net/ - Ready. Set. Code. http://twitter.com/cpucycle/ - Follow you, follow me -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (Darwin) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlECp3EACgkQ0sRouByUApDo2gCfRLq1/7Cl40y7GDShUOamQTMr aqQAn0IPLS/nkcyjOadEA3cKzuoDc0Wp =3JN4 -----END PGP SIGNATURE-----