Published : 2011-06-15

Contribute to ports

Following a recent need (on owncloud port), i want to update the FreeBSD port in the tree. Here we take owncloud example

When we look on google, that seems not to be simple but, it’s weak !

Diff creation for updating port

The first need is to create an update diff. Move to port direction and copy Makefile and distinfo files.

cd /usr/ports/www/owncloud
cp Makefile Makefile.old
cp distinfo distinfo.old

Next, edit Makefile and change port version (PORTVERSION) and download folder (if it changed, MASTER_SITES)

PORTNAME=       owncloud
PORTVERSION=    5.0.5
CATEGORIES=     www
MASTER_SITES=   http://download.owncloud.org/community/

Download port archive and check its size and its SHA256 hash

fetch http://download.owncloud.org/community/owncloud-5.0.5.tar.bz2
ls -l owncloud-5.0.5.tar.bz2 | awk '{print $5}'
sha256 owncloud-5.0.5.tar.bz2

Change archive name and corresponding values in the distinfo file.

SHA256 (owncloud-5.0.5.tar.bz2) = d1538f598f7b06a2d0494a9675a461e4bcd976e7e4ddf3
72efc1a2ec50007a31
SIZE (owncloud-5.0.5.tar.bz2) = 13865933

To finish, create the diff

diff -u Makefile.old Makefile > port.diff
diff -u distinfo.old distinfo >> port.diff

Vous may have a similar content:

--- Makefile.old    2013-04-19 18:13:07.000000000 +0200
 +++ Makefile    2013-04-19 18:21:13.000000000 +0200
 @@ -1,7 +1,7 @@
 # $FreeBSD: www/owncloud/Makefile 315922 2013-04-17 01:57:56Z kevlo $
 PORTNAME=    owncloud
 -PORTVERSION=    5.0.4
 +PORTVERSION=    5.0.5
 CATEGORIES=    www
 MASTER_SITES=    http://download.owncloud.org/community/
 --- distinfo.old    2013-04-19 18:13:11.000000000 +0200
 +++ distinfo    2013-04-19 18:24:25.000000000 +0200
 @@ -1,2 +1,2 @@
 -SHA256 (owncloud-5.0.4.tar.bz2) = fa6c93631368afe5b475e3173130b60be5f4f1166cd5d6f7993d242ac448f0d4
 -SIZE (owncloud-5.0.4.tar.bz2) = 13878837
 +SHA256 (owncloud-5.0.5.tar.bz2) = d1538f598f7b06a2d0494a9675a461e4bcd976e7e4ddf372efc1a2ec50007a31
 +SIZE (owncloud-5.0.5.tar.bz2) = 13865933

Send port update demand

To finish our contribution, we must send the update demand. We use the FreeBSD dedicated command

send-pr -a port.diff

This command open vi and you must have a similar content:

SEND-PR: -*- send-pr -*-
SEND-PR: vim: syntax=sendpr
SEND-PR:
SEND-PR: Lines starting with `SEND-PR' will be removed automatically, as
SEND-PR: will all comments (text enclosed in `<' and `>').
SEND-PR:
SEND-PR: Please consult the following URL if you are not sure how to
SEND-PR: fill out a problem report:
SEND-PR: http://www.freebsd.org/doc/en/articles/problem-reports/
SEND-PR:
SEND-PR: Note that the Synopsis field is mandatory.
SEND-PR:
SEND-PR: Please note that (unless you state otherwise) if your report
SEND-PR: includes a patch then it will be taken under the same license as
SEND-PR: the one on the file(s) you want to change.
SEND-PR:
SEND-PR: BE ADVISED THAT FREEBSD PROBLEM REPORTS ARE PUBLIC INFORMATION AND
SEND-PR: WILL BE PUBLISHED AS-IS ON THE PROJECT'S MAILING LISTS AND WEB SITES.
SEND-PR: DO NOT SUBMIT ANY INFORMATION YOU DO NOT WANT MADE PUBLIC.
SEND-PR:
SEND-PR: If you wish to submit a problem report confidentially, then contact
SEND-PR: the FreeBSD bugmaster (bugmaster@FreeBSD.org) to arrange for a
SEND-PR: relevant developer to be contacted.
SEND-PR:
SEND-PR: For sensitive security issues, consider contacting the FreeBSD
SEND-PR: security officer team (security-officer@freebsd.org) directly.
SEND-PR:
SEND-PR: Choose from the following categories:
SEND-PR:
SEND-PR: advocacy  alpha     amd64     arm       bin       conf
SEND-PR: docs      gnu       i386      ia64      java      kern
SEND-PR: misc      ports     powerpc   sparc64   standards threads
SEND-PR: usb       www
SEND-PR:
To: FreeBSD-gnats-submit@freebsd.org
From: Loic Blot <root>
Reply-To: Loic Blot <root>
Cc:
X-send-pr-version: 3.113
X-GNATS-Notify:

>Submitter-Id:  current-users
>Originator:    Loic Blot
>Organization:  <organization of PR author (multiple lines)>
>Confidential:  no <FreeBSD PRs are public data>
>Synopsis:      <synopsis of the problem (one line)>
>Severity:      <[ non-critical | serious | critical ] (one line)>
>Priority:      <[ low | medium | high ] (one line)>
>Category:      <choose from the list of categories above (one line)>
>Class:         <[ sw-bug | doc-bug | change-request | update | maintainer-update ] (one line)>
>Release:       FreeBSD 9.1-RELEASE amd64
>Environment:
System: FreeBSD www.unix-experience.fr 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec 4 09:23:10 UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64

        <machine, os, target, libraries (multiple lines)>
>Description:
        <precise description of the problem (multiple lines)>
>How-To-Repeat:
        <code/input/activities to reproduce the problem (multiple lines)>
>Fix:

        <how to correct or work around the problem, if known (multiple lines)>
--- port.diff begins here ---
--- Makefile.old        2013-04-19 18:13:07.000000000 +0200
+++ Makefile    2013-04-19 18:21:13.000000000 +0200
@@ -1,7 +1,7 @@
 # $FreeBSD: www/owncloud/Makefile 315922 2013-04-17 01:57:56Z kevlo $

 PORTNAME=      owncloud
-PORTVERSION=   5.0.4
+PORTVERSION=   5.0.5
 CATEGORIES=    www
 MASTER_SITES=  http://download.owncloud.org/community/

--- distinfo.old        2013-04-19 18:13:11.000000000 +0200
+++ distinfo    2013-04-19 18:24:25.000000000 +0200
@@ -1,2 +1,2 @@
-SHA256 (owncloud-5.0.4.tar.bz2) = fa6c93631368afe5b475e3173130b60be5f4f1166cd5d6f7993d242ac448f0d4
-SIZE (owncloud-5.0.4.tar.bz2) = 13878837
+SHA256 (owncloud-5.0.5.tar.bz2) = d1538f598f7b06a2d0494a9675a461e4bcd976e7e4ddf372efc1a2ec50007a31
+SIZE (owncloud-5.0.5.tar.bz2) = 13865933
--- port.diff ends here ---

Edit the following fields

  • From: a valid mail address
  • Reply-to: a valid mail address, if the maintainer wants to contact you
  • Organization: your enterprise or association
  • Synopsis: a quick title to explain the problem
  • Severity: if port is very damageable now
  • Priority: update urgency
  • Category: here it’s ports
  • Class: here it’s update
  • Environment: your system
  • Description: a better description of the problem
  • How-To-Repeat: how to reproduce the problem
  • Fix: generally your diff

When you are sure all is right, you can save and close vi.

To finish you must open the created file and send the problem

send-pr -f /tmp/pr.Gdhq2vNb -a port.diff
s)end, e)dit or a)bort? s
send-pr: problem report sent

All right !

Check update status

For viewing if your update has been accepted and updated, go to this page (warn, problem doesn’t appear immediately)