help on livecheck ...

petr 976F at ingv.it
Tue May 5 10:49:29 PDT 2015


On 30 Apr 2015, at 14:38, Rainer Müller <raimue at macports.org> wrote:

> On 2015-04-30 13:16, petr wrote:
>> I am not very familiar with base so far. Am I correct in the
>> assumption, that this "inconsistency" could be fixed by replacing
>> getdefaultportresourcepath with getportresourcepath in
>> portlivecheck.tcl. Should I turn this into a ticket? Just commit?
> 
> You are absolutely right. Please just go ahead and commit the change.
> 
> getportresourcepath will fall back to getdefaultportresourcepath if it
> does not exist in the ports tree of the current Portfile.



Hi Rainer and others,

I tried to implement the modification described above but I still do not get the expected behaviour. What am I missing?

Below the change I applied to the file `portlivecheck.tcl`:

{{{
[radegast-wifi:macports/lib/port1.0] petr% diff -u portlivecheck.orig.tcl portlivecheck.tcl
--- portlivecheck.orig.tcl	2014-11-22 12:12:09.000000000 +0100
+++ portlivecheck.tcl	2015-04-30 19:15:23.000000000 +0200
@@ -60,7 +60,7 @@
 default livecheck.ignore_sslcert yes
 
 proc portlivecheck::livecheck_main {args} {
-    global livecheck.url livecheck.type livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version \
+    global livecheck.url livecheck.type livecheck.md5 livecheck.regex livecheck.name livecheck.distname livecheck.version porturl \
            livecheck.ignore_sslcert \
            homepage portpath workpath \
            master_sites name subport distfiles
@@ -82,7 +82,7 @@
     }
 
     # Check _resources/port1.0/livecheck for available types.
-    set types_dir [getdefaultportresourcepath "port1.0/livecheck"]
+    set types_dir [getportresourcepath $porturl "port1.0/livecheck"]
     if {[catch {set available_types [glob -directory $types_dir -tails -types f *.tcl]} result]} {
         return -code 1 "No available types were found. Check '$types_dir'."
     }
@@ -92,6 +92,11 @@
     # "freecode|gnu|...").
     set available_types [regsub -all {\.tcl} [join $available_types |] {}]
 
+    ui_debug "porturl: $porturl"
+    ui_debug "resourcepath: [getportresourcepath $porturl  "port1.0/livecheck"]"
+    ui_debug "livecheck type directory '$types_dir'"
+    ui_debug "available livecheck.types '$available_types'"
+
     if {${livecheck.type} eq "default"} {
         # Determine the default type from the mirror.
         if {$has_master_sites} {
}}}

However, when I try to use `port livecheck` from a development repository, the new livecheck.type, the file `<type>.tcl` placed in _resources/port1.0/livecheck of the same ports directory is still not found. Any hints why this would not work? 

{{{
petr% pwd
/Users/petr/sandbox/SVN-repos/macports/dports/python/py-obspy

petr% ls -la ../../_resources/port1.0/livecheck/pypi.tcl
-rw-r--r--  1 petr  staff  949 29 Apr 19:05 ../../_resources/port1.0/livecheck/pypi.tcl

petr% sudo port -d livecheck
[…]
DEBUG: Starting logging for py-obspy
DEBUG: Executing org.macports.main (py-obspy)
DEBUG: livecheck phase started at Tue May  5 19:43:06 CEST 2015
DEBUG: Executing org.macports.livecheck (py-obspy)
DEBUG: Portfile modification date is Wed Apr 29 19:05:54 CEST 2015
DEBUG: Port (livecheck) version is 0.10.1
DEBUG: porturl: file://.
DEBUG: resourcepath: /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/_resources/port1.0/livecheck
DEBUG: livecheck type directory '/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/_resources/port1.0/livecheck'
DEBUG: available livecheck.types 'fallback|freecode|freshmeat|gnome-only-unstable|gnome-with-unstable|gnome|gnu|googlecode|master-sites|sourceforge'
Error: unknown livecheck.type pypi

}}}

Thanks for your help!
~petr




More information about the macports-dev mailing list