backuppc

James Kyle jameskyle at macports.org
Thu Aug 6 18:47:55 PDT 2009


On Aug 4, 2009, at 5:10 PM, Ryan Schmidt wrote:

> 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"

Done.
>
>
>> +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.
>
Done
>
> 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}"

Done.

>
>> +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.
It installs files into /Library/LaunchDaemons. At first it also  
installed files into ${prefix}/apach2..but I believe I've taken care  
of this.

>
>
>> +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?

The configure.pl also installs into the destroot.
>
>
> Finally, note that "port lint" shows that the port is missing the  
> required "homepage" variable.
fixed

Link checks out now.


More information about the macports-dev mailing list