commit 28ba46a1cd9718938899ca2a671fc955acbfbb84 from: Stefan Sperling date: Thu Aug 15 11:16:37 2019 UTC add ports example; with gonzalo commit - b5bd6133383ebef019a1d03cfc0943d596d71722 commit + 28ba46a1cd9718938899ca2a671fc955acbfbb84 blob - 126742de73491b0f8156d26fe8258747ab5de1e9 blob + bf97a8b9f756c8367dc52092e98ebe37477ca486 --- examples.html +++ examples.html @@ -166,8 +166,152 @@ pick bcb49d15e041ddffb59397d2fe851fdb1729b005 fixed ve

-WIP, coming soon... +Clone the ports repository from github. This step currently requires git(1): +

+
+$ mkdir /var/git
+$ cd /var/git
+$ git clone --bare https://github.com/openbsd/ports.git
+
+

We jump into ports.git directory and we create our new branch to work with (let's say +mystuff): +

+
+$ cd ports.git
+$ got branch mystuff
+
+We check that the master and the new branch are in sync: +

+
+$ got branch -l
+master: 05a7abcec81fc1865d1983314b6783680ab31f689
+mystuff: 05a7abcec81fc1865d1983314b6783680ab31f689
+
+

Now we need to checkout the content inside our new branch mystuff +

+
+$ cd /var/git
+$ got checkout -b mystuff ports.git
+...
+A  /var/git/ports/x11/yeahconsole/distinfo
+A  /var/git/ports/x11/yeahconsole/patches/patch-Makefile
+A  /var/git/ports/x11/yeahconsole/pkg/DESCR
+A  /var/git/ports/x11/yeahconsole/pkg/PLIST
+A  /var/git/ports/x11/yeahlaunch/Makefile
+A  /var/git/ports/x11/yeahlaunch/distinfo
+A  /var/git/ports/x11/yeahlaunch/patches/patch-yeahlaunch_c
+A  /var/git/ports/x11/yeahlaunch/pkg/DESCR
+A  /var/git/ports/x11/yeahlaunch/pkg/PLIST
+Now shut up and hack
+
+

As got says, now shut up and hack: +

+
+$ cd /var/git/ports
+$ cd www/nextcloud
+$ vim pkg/README
+
+

So we changed the README file inside the Nextcloud port and we need to cook the diff: +

+
+$ got diff
+diff 05a7abcec81fc1865d1983314b6783680ab31f689 /var/git/ports
+blob - 47bfbdd7fa7aaf027971ac5c62db25dde75595d7
+file + www/nextcloud/pkg/README
+--- www/nextcloud/pkg/README
++++ www/nextcloud/pkg/README
+@@ -96,12 +96,20 @@ server "domain.tld" {
+                block return 301 "$DOCUMENT_URI/index.php"
+        }
 
+-       location "/nextcloud/ocm-provider/" {
+-               block return 301 "$DOCUMENT_URI/index.php"
++       location "/.well-known/carddav" {
++               block return 301 "https://$SERVER_NAME/nextcloud/remote.php/dav"
+        }
 
+-       location "/nextcloud/ocs-provider/" {
+-               block return 301 "$DOCUMENT_URI/index.php"
++       location "/.well-known/caldav" {
++               block return 301 "https://$SERVER_NAME/nextcloud/remote.php/dav"
++       }
++
++       location "/.well-known/webfinger" {
++               block return 301 "https://$SERVER_NAME/nextcloud/public.php?service=webfinger"
++       }
++
++       location match "/nextcloud/oc[ms]%-provider/*" {
++               directory index index.php
+        }
+ }
+ ---8<---------------------------------------------------------------------------
+
+

Time to commit those changes in our branch mystuff, so we can keep +track of our work: +

+
+$ got commit -m "Add new examples for httpd(8) to shut up warnings"
+M  www/nextcloud/pkg/README
+Created commit 7848652ef6243db09841d449f346f21fc6386633
+
+

Paranoid? Probably yes, let's check again our diff against master: +

+$ got diff master mystuff
+diff refs/heads/master refs/heads/mystuff
+blob - 47bfbdd7fa7aaf027971ac5c62db25dde75595d7
+file + www/nextcloud/pkg/README
+--- www/nextcloud/pkg/README
++++ www/nextcloud/pkg/README
+@@ -96,12 +96,20 @@ server "domain.tld" {
+                block return 301 "$DOCUMENT_URI/index.php"
+        }
+
+-       location "/nextcloud/ocm-provider/" {
+-               block return 301 "$DOCUMENT_URI/index.php"
++       location "/.well-known/carddav" {
++               block return 301 "https://$SERVER_NAME/nextcloud/remote.php/dav"
+        }
+
+-       location "/nextcloud/ocs-provider/" {
+-               block return 301 "$DOCUMENT_URI/index.php"
++       location "/.well-known/caldav" {
++               block return 301 "https://$SERVER_NAME/nextcloud/remote.php/dav"
++       }
++
++       location "/.well-known/webfinger" {
++               block return 301 "https://$SERVER_NAME/nextcloud/public.php?service=webfinger"
++       }
++
++       location match "/nextcloud/oc[ms]%-provider/*" {
++               directory index index.php
+        }
+ }
+ ---8<---------------------------------------------------------------------------
+
+

Now, let's send that diff to ports@ for some OKs. +

+ +

Once the diff has been committed to CVS the same change will eventually show +up on github as well. Fetch incoming changes to the master branch +with:

+ +
+$ cd /var/git/ports.git
+$ git fetch origin master:master
+
+ +

Next, rebase the mystuff branch onto the latest master:

+ +
+$ cd /var/git/ports
+$ got status
+(status should be clean; revert or commit local changes if needed)
+$ got update -b master
+$ got rebase mystuff
+
+ +

+Now we can shut up and hack again! +