[Unison-hackers] Unison on launchpad (was: [unison-users] Broken unicode handling in unison 2.27.57)

Benjamin Pierce bcpierce at cis.upenn.edu
Tue May 5 09:00:16 EDT 2009


Hi Martin,

Yes, the patch looks OK to me.  But it doesn't seem to apply cleanly  
-- I get

~/current/unison/trunk/src> patch -i p.tmp
patching file .bzrignore
patching file Makefile
patch: **** malformed patch at line 30: all:: INSTALL

Am I applying it the wrong way?

   -- Benjamin


On May 4, 2009, at 12:21 PM, Martin von Gagern wrote:

> Hi!
>
> Benjamin Pierce wrote:
>> I'm willing to help with repository issues, but I'd prefer to wait a
>> little till it's clear that this project is making progress before
>> sinking a lot of time into setting things up.  Would it make sense  
>> just
>> to take a copy of the sources, put it somewhere convenient for
>> collaboration among whoever is interested in this, let things run  
>> for a
>> little while, and then synchronize the two replicas and set up a  
>> way of
>> keeping them in sync?
>
> Russel Winder was so kind to create the unison group and project on
> launchpad.net, and I've uploaded a bzr-svn import of the repository. I
> think I'll keep that in sync manually for now, and when this works out
> ask you to automate the synchronization.
>
> The project page:       https://launchpad.net/unison
> The developer team:     https://launchpad.net/~unison
> Available bzr branches: https://code.launchpad.net/unison
>
> The build relies on svn keyword substitution to keep track of the
> current version number. bzr doesn't replace keywords by default, and  
> has
> a different idea of revision numbers as well, as they are per branch,
> not per repository. I've attached a patch that deals with the  
> situation
> by finding the bzr revision number corresponding to the origin svn
> revision, and starts counting from there. Should not cause trouble for
> developers using svn, as it only gets called when the keyword isn't
> expanded.
>
> I've also improved behaviour of the build in case the mkProjectInfo
> build fails. Without modification, this can lead to an empty
> Makefile.ProjectInfo causing an empty $(NAME) and thus an empty
> dependency in "buildexecutable:: $(NAME)$(EXEC_EXT)", so nothing was
> build, and no error was signaled. Now I'm deleting files on error, and
> depending on Makefile.ProjectInfo, so the build will fail.
>
> Are you willing to merge this patch into the main unison trunk, or
> should it exist as a separate branch on launchpad? I'd prefer a merge.
>
>> P.S.  Since the discussion is getting pretty technical, I suggest we
>> move it to the unison-hackers list.  I'll cross-post this there so  
>> you
>> can just "reply all" and then edit headers.  (You'll need to sign  
>> up for
>> that list, but you should do that anyway, since it's where commit  
>> logs
>> get sent.)
>
> Fine with me. And those commit messages will help me keep stuff in  
> sync,
> I believe.
>
> I guess I'll soon get back to you with a wishlist of stuff I want
> explained. Just a note for now: I found out Glib.Utf8 provides a
> normalize function, so I might end up using that instead of camomile.
>
> Greetings,
> Martin
> # Bazaar merge directive format 2 (Bazaar 0.90)
> # revision_id: martin.vgagern at gmx.net-20090504154753-1ht6w3g5cbwpm9yu
> # target_branch: http://bazaar.launchpad.net/~unison/unison/trunk
> # testament_sha1: 729c80164fd2e5e562afa3b4c4b40fd4e5a22cbe
> # timestamp: 2009-05-04 18:04:34 +0200
> # source_branch: http://bazaar.launchpad.net/~unison/unison/bzrbuild
> # base_revision_id: svn-v4:4bce34ff-96ee-0310-b826-\
> #   95abcfff6e26:trunk:321
> #
> # Begin patch
> === added file '.bzrignore'
> --- .bzrignore	1970-01-01 00:00:00 +0000
> +++ .bzrignore	2009-05-04 15:47:53 +0000
> @@ -0,0 +1,9 @@
> +src/Makefile.ProjectInfo
> +src/mkProjectInfo
> +src/TAGS
> +src/ubase/projectInfo.ml
> +src/unison
> +src/unison.exe
> +src/**/*.cmi
> +src/**/*.cmx
> +src/**/*.cmo
>
> === modified file 'src/Makefile'
> --- src/Makefile	2008-08-21 14:39:05 +0000
> +++ src/Makefile	2009-05-04 15:47:53 +0000
> @@ -37,6 +37,16 @@
>
> all:: INSTALL
>
> +.PHONY: all clean install doinstall installtext text \
> +	setupdemo-old setupdemo modifydemo demo \
> +	run runbatch runt rundebug runp runtext runsort runprefer \
> +	prefsdocs runtest repeattest \
> +	selftest selftestdebug selftestremote testmerge \
> +	checkin installremote
> +
> +.DELETE_ON_ERROR:
> +# to avoid problems when e.g. mkProjectInfo fails to run
> +
> INSTALL: $(NAME)$(EXEC_EXT)
> # file isn't made for OS X, so check that it's there first
> 	(if [ -f $(NAME) ]; then ./$(NAME) -doc install > INSTALLATION; fi)
> @@ -50,11 +60,14 @@
> # NAME, VERSION, and MAJORVERSION, automatically generated
> -include Makefile.ProjectInfo
>
> -Makefile.ProjectInfo: mkProjectInfo
> +../.bzr/branch/last-revision:
> +# Do nothing to create this target if it doesn't already exist.
> +
> +Makefile.ProjectInfo: mkProjectInfo ../.bzr/branch/last-revision
> 	./mkProjectInfo > $@
>
> mkProjectInfo: mkProjectInfo.ml
> -	ocamlc -o $@ $^
> +	ocamlc -o $@ unix.cma str.cma $^
>
> clean::
> 	$(RM) mkProjectInfo
>
> === modified file 'src/Makefile.OCaml'
> --- src/Makefile.OCaml	2009-05-02 00:57:23 +0000
> +++ src/Makefile.OCaml	2009-05-04 15:47:53 +0000
> @@ -125,6 +125,7 @@
>   endif
> endif
>
> +.PHONY: buildexecutable
> buildexecutable::
> 	@echo NATIVE = $(NATIVE)
> 	@echo THREADS = $(THREADS)
> @@ -132,7 +133,7 @@
> 	@echo OSTYPE = $(OSTYPE)
> 	@echo OSARCH = $(OSARCH)
>
> -ubase/projectInfo.ml: mkProjectInfo
> +ubase/projectInfo.ml: Makefile.ProjectInfo
> 	echo 'let myName = "'$(NAME)'";;' > $@
> 	echo 'let myVersion = "'$(VERSION)'";;' >> $@
> 	echo 'let myMajorVersion = "'$(MAJORVERSION)'";;' >> $@
> @@ -160,6 +161,7 @@
> # NOTE: the OCAMLLIBDIR is not getting passed correctly?
> # The two cases for cltool are needed because Xcode 2.1+
> # builds in build/Default/, and earlier versions use build/
> +.PHONY: macexecutable
> macexecutable: $(NAME)-blob.o
> #	sed -e's/@@VERSION@@/$(VERSION)/' $(UIMACDIR)/Info.plist.template  
> > $(UIMACDIR)/Info.plist
> 	(cd $(UIMACDIR); xcodebuild OCAMLLIBDIR="$(OCAMLLIBDIR)"  
> SYMROOT=build)
> @@ -388,6 +390,7 @@
> 	-$(RM) -r *.obj *.lib *.exp
> 	-$(RM) -r *.tmp *.bak?.tmp .*.bak?.tmp
>
> +.PHONY: paths
> paths:
> 	@echo PATH = $(PATH)
> 	@echo OCAMLLIBDIR = $(OCAMLLIBDIR)
>
> === modified file 'src/mkProjectInfo.ml'
> --- src/mkProjectInfo.ml	2009-05-02 01:30:31 +0000
> +++ src/mkProjectInfo.ml	2009-05-04 13:14:57 +0000
> @@ -42,9 +42,36 @@
> (*  
> ---------------------------------------------------------------------- *)
> (* You shouldn't need to edit below. *)
>
> +(* run the bzr tool to get version information for bzr branches *)
> +exception BzrException of Unix.process_status;;
> +let bzr args =
> +  let bzr = (try Sys.getenv "BZR" with Not_found -> "bzr") in
> +  let cmd = bzr ^ " " ^ args in
> +  let inc = Unix.open_process_in cmd in
> +  let buf = Buffer.create 16 in
> +  (try
> +     while true do
> +       Buffer.add_channel buf inc 1
> +     done
> +   with End_of_file -> ());
> +  let status = Unix.close_process_in inc in
> +  match status with
> +    Unix.WEXITED 0 -> Buffer.contents buf
> +  | _ -> raise (BzrException status);;
> +
> +(* extract a substring using a regular expression *)
> +let extract_str re str =
> +  let _ = Str.search_forward (Str.regexp re) str 0 in
> +  Str.matched_group 1 str;;
> +let extract_int re str = int_of_string (extract_str re str);;
> +
> let revisionString = "$Rev$";;
> -let revision = Scanf.sscanf revisionString "$Rev: %d " (fun x -> x);;
> -let pointVersion = revision - pointVersionOrigin;;
> +let pointVersion = if String.length revisionString > 5
> +then Scanf.sscanf revisionString "$Rev: %d " (fun x -> x) -  
> pointVersionOrigin
> +else let pvo = extract_int "^revno:[ \t]*\\([0-9]+\\)[ \t]*$"
> +                           (bzr ("log -r svn:" ^
> +                                 string_of_int pointVersionOrigin))  
> in
> +     extract_int "^\\([0-9]+\\)$" (bzr "revno") - pvo;;
>
> Printf.printf "MAJORVERSION=%d.%d\n" majorVersion minorVersion;;
> Printf.printf "VERSION=%d.%d.%d\n" majorVersion minorVersion  
> pointVersion;;
>



More information about the Unison-hackers mailing list