Ticket #18794: conflicts.diff
File conflicts.diff, 3.5 KB (added by blb@…, 16 years ago) |
---|
-
src/port1.0/portmain.tcl
42 42 43 43 # define options 44 44 options prefix macportsuser name version revision epoch categories maintainers 45 options long_description description homepage 45 options long_description description homepage conflicts 46 46 options worksrcdir filesdir distname portdbpath libpath distpath sources_conf os.platform os.version os.major os.arch os.endian platforms default_variants install.user install.group macosx_deployment_target 47 47 options universal_variant os.universal_supported 48 48 … … 70 70 default worksrcdir {$distname} 71 71 default filespath {[file join $portpath $filesdir]} 72 72 default worksrcpath {[file join $workpath $worksrcdir]} 73 default conflicts {} 73 74 74 75 # Configure settings 75 76 default macportsuser {${portutil::autoconf::macportsuser}} -
src/macports1.0/macports.tcl
1331 1331 } 1332 1332 } 1333 1333 1334 ### _mportconflictsinstalled is private; may change without notice 1335 1336 # Determine if the port, per the conflicts option, has any conflicts with 1337 # what is installed. 1338 # 1339 # mport the port to check for conflicts 1340 # Returns a list of which installed ports conflict, or an empty list if none 1341 proc _mportconflictsinstalled {mport} { 1342 set conflictlist {} 1343 set conflictinfo [_mportkey $mport conflicts] 1344 if {[llength $conflictinfo] > 0} { 1345 ui_debug "Checking for conflicts against [_mportkey $mport name]" 1346 foreach conflictspec ${conflictinfo} { 1347 switch -regex $conflictspec { 1348 ^port:([-._A-Za-z0-9]+)$ { 1349 set conflict_portname [lindex [split $conflictspec :] end] 1350 set conflict_portinfo [mportlookup $conflict_portname] 1351 array set portinfo [lindex $conflict_portinfo 1] 1352 set conflict_port [mportopen $portinfo(porturl)] 1353 if {[string equal ${macports::registry.installtype} "image"]} { 1354 if {[_mportactive $conflict_port]} { 1355 lappend conflictlist $conflict_portname 1356 } 1357 } else { 1358 if {[_mportinstalled $conflict_port]} { 1359 lappend conflictlist $conflict_portname 1360 } 1361 } 1362 } 1363 default { 1364 return -code error [format [msgcat::mc "invalid conflictspec: %s"] $conflictspec] 1365 } 1366 } 1367 } 1368 } else { 1369 ui_debug "[_mportkey $mport name] has no conflicts" 1370 } 1371 1372 return $conflictlist 1373 } 1374 1375 1334 1376 ### _mportexec is private; may change without notice 1335 1377 1336 1378 proc _mportexec {target mport} { … … 1388 1430 || $target == "rpm" || $target == "dpkg" 1389 1431 || $target == "srpm"|| $target == "portpkg" } { 1390 1432 1433 set conflictports [_mportconflictsinstalled $mport] 1434 if {[llength ${conflictports}] != 0} { 1435 return -code error "Can't install [_mportkey $mport name] because conflicting ports are installed: ${conflictports}" 1436 } 1437 1391 1438 ui_msg -nonewline "---> Computing dependencies for [_mportkey $mport name]" 1392 1439 if {[macports::ui_isset ports_debug]} { 1393 1440 # play nice with debug messages