From: Pete P. <pp...@mv...> - 2001-07-03 06:11:29
|
Paul Mundt wrote: >Hi Pete, > >Nice work on the script. One thing though, I ran into a few issues while I >was testing it.. namely, it had some problems forcibly overwriting existing >files with the symlink (ie, ln -sf behavior). > I'm not sure I understand what happens here. I wanted to rename the original file and then create a link to the linux-mips file. Apparently something else is the result? >I talked to Charles Duffy about it, and he suggested something like the >attached patch. After applying the patch, everything worked properly for me. > >Anyways, unless anyone has any issues with the patch, I'll shove it into >CVS. > Cool. First python script :-) Pete > > >On Sun, Jul 01, 2001 at 07:32:44PM -0700, Pete Popov wrote: > >>Don't know if this would be useful to anyone else but Paul mentioned a >>similar script that he uses for another drop in tree. This one works for >>me and helps keep the linux-mips tree in a separate directory so I don't >>have cvs problems when updating, committing, etc. The script takes the >>linux-mips tree, the stock kernel tree, and a new development directory >>as inputs. It copies the stock tree to the new dev directory; then it >>recurses through the new dev directory and: >>* renames all files that are in common between the linux-mips and new >>dev tree directories to *.stock >>* creates a link in the new dev directory that points to the file in the >>linux-mips directory. >> >>That way you can develop in the new directory, but you can still easily >>update and commit from within the linux-mips directory. >> > >Regards, > > >------------------------------------------------------------------------ > >--- treelink.orig Mon Jul 2 22:54:11 2001 >+++ treelink Mon Jul 2 20:48:25 2001 >@@ -76,6 +76,7 @@ > line = f.readline() > continue > >+ file = re.match('^/*(.*)?$', file).group(1) > orig_stock_file = os.path.normpath(os.path.join(abs_dev_dir,file)) # orig file in stock kernel > link_file = os.path.normpath(os.path.join(abs_drop_in_dir,file)) # what we'll link it to > >@@ -86,7 +87,11 @@ > elif (os.path.isfile(orig_stock_file) == 1): > os.rename(orig_stock_file, orig_stock_file + ".stock") > >- os.symlink(link_file, orig_stock_file) >+ try: os.remove(orig_stock_file) >+ except OSError: pass >+ >+ try: os.symlink(link_file, orig_stock_file) >+ except: pass > line = f.readline() > > f.close() > > Part 1.1.1 > > Content-Type: > > text/plain > Content-Encoding: > > quoted-printable > > > ------------------------------------------------------------------------ > treelink.diff > > Content-Type: > > text/plain > Content-Encoding: > > quoted-printable > > |