Revision
89428
Author
raimue@macports.org
Date
2012-01-28 11:42:22 -0800 (Sat, 28 Jan 2012)

Log Message

port1.0/portlint.tcl:
Check for incorrect svn properties

Modified Paths

Diff

Modified: trunk/base/src/port1.0/portlint.tcl (89427 => 89428)


--- trunk/base/src/port1.0/portlint.tcl	2012-01-28 19:05:43 UTC (rev 89427)
+++ trunk/base/src/port1.0/portlint.tcl	2012-01-28 19:42:22 UTC (rev 89428)
@@ -606,8 +606,35 @@
     ui_debug "Version: $version"
     ui_debug "Revision: $revision"
     ui_debug "Archs: $portarch"
+
     ###################################################################
 
+    set svn_cmd ""
+    catch {set svn_cmd [findBinary svn]}
+    if {$svn_cmd != "" && ([file exists $portpath/.svn] || ![catch {exec $svn_cmd info $portpath > /dev/null 2>@1}])} {
+        ui_debug "Checking svn properties"
+        if [catch {exec $svn_cmd propget svn:keywords $portfile 2>@1} output] {
+            ui_warn "Unable to check for svn:keywords property: $output"
+        } else {
+            ui_debug "Property svn:keywords is \"$output\", should be \"Id\""
+            if {$output != "Id"} {
+                ui_error "Missing subversion property on Portfile, please execute: svn ps svn:keywords Id Portfile"
+                incr errors
+            }
+        }
+        if [catch {exec $svn_cmd propget svn:eol-style $portfile 2>@1} output] {
+            ui_warn "Unable to check for svn:eol-style property: $output"
+        } else {
+            ui_debug "Property svn:eol-style is \"$output\", should be \"native\""
+            if {$output != "native"} {
+                ui_error "Missing subversion property on Portfile, please execute: svn ps svn:eol-tyle native Portfile"
+                incr errors
+            }
+        }
+    }
+
+    ###################################################################
+
     ui_notice "$UI_PREFIX [format [msgcat::mc "%d errors and %d warnings found."] $errors $warnings]"
 
     return {$errors > 0}