backuppc

Ryan Schmidt ryandesign at macports.org
Tue Aug 4 17:10:19 PDT 2009


A few comments on backuppc:


On Aug 3, 2009, at 14:28, jameskyle at macports.org wrote:

> Revision: 54884
>           http://trac.macports.org/changeset/54884
> Author:   jameskyle at macports.org
> Date:     2009-08-03 12:28:16 -0700 (Mon, 03 Aug 2009)
> Log Message:
> -----------
> Initial commit.
> backuppc user creation completed.


> +master_sites					sourceforge:${name}

Note that you can simplify this to just "master_sites sourceforge"


> +configure {
> +  if {[existsgroup "backuppc"]} {
> +    ui_debug "Found backuppc group."
> +  } else {
> +    ui_debug "Could not find backuppc group."
> +    ui_debug "Creating backuppc group."
> +    set gid [nextgid]
> +    ui_debug "gid: $gid"
> +    if {[catch {addgroup "backuppc" gid=${gid}}]} {
> +      return -code error "Failed to create backuppc group"
> +    }
> +  }
> +
> +  ui_debug "Checking for backuppc user"
> +  if { [existsuser "backuppc"] } {
> +    ui_debug "Found backuppc user."
> +  } else {
> +    ui_debug "Could not find backuppc user."
> +    ui_debug "Creating backuppc user."
> +    set uid [nextuid]
> +    ui_debug "uid: $uid"
> +    if {[catch {adduser "backuppc" uid=${uid} gid=[existsgroup  
> backuppc]}]} {
> +      return -code error "Failed to create backuppc user"
> +    }
> +  }
> +}


I imagine this can be greatly simplified. Taking an example from the  
mysql5-server port, I think all you need is:

configure {
     addgroup backuppc
     set gid [existsgroup backuppc]
     adduser backuppc gid=${gid} realname=BackupPC
}

I would be surprised if the adduser and addgroup functions in  
MacPorts base did not already have adequate error handling, and if  
they don't, then that's where it would need to be fixed, not in  
individual ports.


On Aug 3, 2009, at 14:28, jameskyle at macports.org wrote:

> Revision: 54885
>           http://trac.macports.org/changeset/54885
> Author:   jameskyle at macports.org
> Date:     2009-08-03 12:28:18 -0700 (Mon, 03 Aug 2009)
> Log Message:
> -----------
> Added the BackupPC launchd script.
> First working full install.


>  distfiles							BackupPC-${version}.tar.gz
[snip]
> +worksrcdir            BackupPC-${version}

Note that these two lines can be simplified to "distname BackupPC-$ 
{version}"


> +destroot.violate_mtree yes

What violates the mtree? Is there a way to make it comply with the  
mtree? Ports should not violate the mtree unless they absolutely have  
to.


> +destroot {
> +    system "cd ${worksrcpath} && ${prefix}/bin/perl5.8  
> configure.pl ${configure.args}"

Is there a reason why you're running the configure script in the  
destroot phase instead of in the configure phase?


Finally, note that "port lint" shows that the port is missing the  
required "homepage" variable.




More information about the macports-dev mailing list