From 4922fbd1a27fe98f5fadff69492f5666c845ba42 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sat, 12 Sep 2009 19:11:26 -0700 Subject: [PATCH] nrelease - Redo /usr/Makefile to use only git repos. * Make and make help are now context sensitive based on what files already exist in /usr/pkgsrc and /usr/src (if any). * Use git for the pkgsrc repo. * Use a remote setup instead of git-clone to make it easier to add additional remotes. --- etc/Makefile.usr | 131 ++++++++++++++++++++++++----------------------- 1 file changed, 67 insertions(+), 64 deletions(-) diff --git a/etc/Makefile.usr b/etc/Makefile.usr index f32d22e836..6bb6f7cc2d 100644 --- a/etc/Makefile.usr +++ b/etc/Makefile.usr @@ -4,82 +4,85 @@ # # $DragonFly: src/etc/Makefile.usr,v 1.8 2008/09/03 10:38:55 hasso Exp $ -CVSROOT_PKGSRC?= anoncvs@anoncvs.NetBSD.org:/cvsroot -CVSROOT_PKGSRC_WIP?= anoncvs@anoncvs.NetBSD.se:/cvsroot -GIT_DRAGONFLY?= git://chlamydia.fs.ei.tum.de/dragonfly.git -GIT_BRANCH?= master - help all: - @echo "Extract /usr/pkgsrc from pkgsrc-all.tgz" - @echo " make release-pkgsrc-extract" - @echo "Or, install or update /usr/pkgsrc using NetBSDs anoncvs" - @echo " make pkgsrc-checkout" - @echo " make pkgsrc-update" + @echo "HELP:" + @echo "" +.if exists(${.CURDIR}/pkgsrc/.git) +.if exists(${.CURDIR}/pkgsrc/Makefile) + @echo " make pkgsrc-update - update your pkgsrc repo from the net" +.else + @echo " make pkgsrc-checkout - initial checkout of your pre-packaged" + @echo " pkgsrc repo." + @echo " make pkgsrc-update - update your pkgsrc repo from the net" + @echo " after the initial checkout." +.endif +.else + @echo " make pkgsrc-create - fetch initial pkgsrc repo from the net" + @echo " make pkgsrc-update - update your pkgsrc repo from the net" +.endif @echo "" - @echo "These targets download/update the DragonFly git repository into" - @echo "/usr/src" - @echo " make git-clone" - @echo " make git-update" +.if exists(${.CURDIR}/src/.git) +.if exists(${.CURDIR}/src/Makefile) + @echo " make src-update - update your src repo from the net" +.else + @echo " make src-checkout - initial checkout of your pre-packaged src repo" + @echo " make src-update - update your src repo from the net" + @echo " after the initial checkout." +.endif +.else + @echo " make src-create - fetch initial src repo from the net" + @echo " make src-update - update your src repo from the net" +.endif @echo "" - @echo "Install or update /usr/pkgsrc/wip using NetBSD.se anoncvs" - @echo " make pkgsrc-wip-checkout" - @echo " make pkgsrc-wip-update" +.if exists(${.CURDIR}/src-sys.tgz) + @echo " make release-sys-extract - extract the pre-packaged sys-only sources" +.endif @echo "" - @echo "Extract kernel sources from src-sys.tgz in this directory" - @echo " make release-sys-extract" - @echo "Extract full DragonFly sources from src-all.tgz in this directory" - @echo " make release-src-extract" + @echo "If automating please feel free to run git pull's from cron." + @echo "We prefer once a day but you can run them more often if you" + @echo "desire." @echo "" - @echo "If automating please restrict updates from the NetBSD anoncvs" - @echo "server to no more than once a week and run gits no more often" - @echo "than daily." + @echo "If you have a repo previously maintained via CVS you should" + @echo "rm -rf it (save any local modifications) and then use the" + @echo "make src-create and/or make pkgsrc-create to set up the initial" + @echo "git repo." + +pkgsrc-create: + @echo "If problems occur you may have to rm -rf pkgsrc and try again." + @echo "" + mkdir -p ${.CURDIR}/pkgsrc + cd ${.CURDIR}/pkgsrc && git init + cd ${.CURDIR}/pkgsrc && \ + git remote add origin git://git.dragonflybsd.org/pkgsrc.git + cd ${.CURDIR}/pkgsrc && git fetch origin + cd ${.CURDIR}/pkgsrc && git branch vendor origin/vendor + cd ${.CURDIR}/pkgsrc && git checkout vendor + cd ${.CURDIR}/pkgsrc && git pull pkgsrc-checkout: - cd ${.CURDIR}; \ - cvs -d ${CVSROOT_PKGSRC} checkout -P pkgsrc + cd ${.CURDIR}/pkgsrc && git checkout vendor pkgsrc-update: - cd ${.CURDIR}; \ - cvs -d ${CVSROOT_PKGSRC} -q update -Pd pkgsrc - -pkgsrc-wip-checkout: - cd ${.CURDIR}; \ - mkdir -p pkgsrc/wip; \ - cd pkgsrc; \ - cvs -d ${CVSROOT_PKGSRC_WIP} checkout -P wip + cd ${.CURDIR}/pkgsrc && git pull -pkgsrc-wip-update: - cd ${.CURDIR}/pkgsrc; \ - cvs -d ${CVSROOT_PKGSRC_WIP} -q update -Pd wip +src-create: + @echo "If problems occur you may have to rm -rf src and try again." + @echo "" + mkdir -p ${.CURDIR}/src + cd ${.CURDIR}/src && git init + cd ${.CURDIR}/src && \ + git remote add origin git://git.dragonflybsd.org/dragonfly.git + cd ${.CURDIR}/src && git fetch origin + cd ${.CURDIR}/src && git branch master origin/master + cd ${.CURDIR}/src && git checkout master + cd ${.CURDIR}/src && git pull -release-pkgsrc-extract: - cd ${.CURDIR}; \ - mkdir -p pkgsrc; \ - cd pkgsrc; \ - tar xvpzf ${.CURDIR}/pkgsrc-all.tgz +src-checkout: + cd ${.CURDIR}/src && git checkout master -release-src-extract: - cd ${.CURDIR}; \ - tar xvpzf src-all.tgz +src-update: + cd ${.CURDIR}/src && git pull release-sys-extract: - cd ${.CURDIR}; \ - tar xvpzf src-sys.tgz + cd ${.CURDIR} && tar xvpzf src-sys.tgz -git-clone: - @if [ -z "`which git`" ]; then \ - echo "Please install devel/scmgit from pkgsrc"; \ - exit 1; \ - fi - git clone -n ${GIT_DRAGONFLY} ${.CURDIR}/src - if [ "${GIT_BRANCH}" != master ]; then \ - git --git-dir=${.CURDIR}/src/.git branch --track -l -f ${GIT_BRANCH} origin/${GIT_BRANCH}; \ - fi - cd ${.CURDIR}/src && git checkout ${GIT_BRANCH} - -git-update: - @if [ -z "`which git`" ]; then \ - echo "Please install devel/scmgit from pkgsrc"; \ - exit 1; \ - fi - cd ${.CURDIR}/src && git pull -- 2.41.0