tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: fixing bugs in packages



On Sat, May 12, 2012 at 02:58:51PM +0300, Aleksey Cheusov wrote:
>  >>> for example. Some time ago, I proposed the same here and still have
>  >>> "rebuild" target in my mk.conf.
>  >>
>  >> A quick search did not find it, could you please share it (again)?
>  >> Thanks,
> 
> > Original proposal is here.
> > http://mail-index.netbsd.org/tech-pkg/2009/09/15/msg003880.html
> 
> > The attached patch implements "rebuild" target and I think
> > it is ready to commit.
> 
> Sorry. patch is below.
> 
> Index: mk/bsd.pkg.barrier.mk
> ===================================================================
> RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.barrier.mk,v
> retrieving revision 1.18
> diff -u -r1.18 bsd.pkg.barrier.mk
> --- mk/bsd.pkg.barrier.mk     24 Feb 2010 22:53:34 -0000      1.18
> +++ mk/bsd.pkg.barrier.mk     12 May 2012 11:42:45 -0000
> @@ -20,6 +20,7 @@
>  _BARRIER_POST_TARGETS+=      patch
>  _BARRIER_POST_TARGETS+=      configure
>  _BARRIER_POST_TARGETS+=      build build-env
> +_BARRIER_POST_TARGETS+=      rebuild
>  _BARRIER_POST_TARGETS+=      test
>  _BARRIER_POST_TARGETS+=      all
>  _BARRIER_POST_TARGETS+=      stage-install
> Index: mk/build/build.mk
> ===================================================================
> RCS file: /cvsroot/pkgsrc/mk/build/build.mk,v
> retrieving revision 1.20
> diff -u -r1.20 build.mk
> --- mk/build/build.mk 8 Sep 2011 20:17:15 -0000       1.20
> +++ mk/build/build.mk 12 May 2012 11:42:46 -0000
> @@ -93,6 +93,26 @@
>  .endif
>  
>  ######################################################################
> +### rebuild (PUBLIC)
> +######################################################################
> +### rebuild is a special target to re-run the build target.
> +###
> +
> +.PHONY: rebuild
> +.if !target(rebuild)
> +rebuild: build-clean real-build
> +.endif
> +
> +######################################################################
> +### build-clean (PRIVATE)
> +######################################################################
> +### build-clean removes the state files for the "build" and
> +### later phases so that the "build" target may be re-invoked.
> +###
> +build-clean: .PHONY install-clean 
> +     ${RUN} ${RM} -f ${PLIST} ${_COOKIE.install} ${_COOKIE.build} 
> ${_DEPENDS_PLIST}
> +

Incomplete. Doesn't handle package. Also should likely kill .destdir and
the various PLIST check files. I'm not completely sure about the
post-barrier implications for this either.

Joerg


Home | Main Index | Thread Index | Old Index