Changeset 664 for CMT/v1r25-branch/mgr
- Timestamp:
- Jan 13, 2014, 4:09:37 PM (10 years ago)
- Location:
- CMT/v1r25-branch
- Files:
-
- 21 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
CMT/v1r25-branch
-
CMT/v1r25-branch/mgr/CMT.dtd
r550 r664 1 <!ENTITY % cmtns "xmlns CDATA #FIXED 'http://www.cmtsite. org/cmt'">1 <!ENTITY % cmtns "xmlns CDATA #FIXED 'http://www.cmtsite.net/cmt'"> 2 2 <!ATTLIST setup %cmtns;> 3 3 <!ATTLIST projects %cmtns;> -
CMT/v1r25-branch/mgr/cmt_dcc_version.sh
- Property svn:mergeinfo changed (with no actual effect on merging)
-
CMT/v1r25-branch/mgr/cmt_svn_checkout.py
r605 r664 15 15 --with_version_directory create version directory upon PATH checkout (default) 16 16 --url=URL checkout PATH from repository URL 17 --debug print lots of debugging information 17 18 -h, --help display this help and exit 18 19 --version output version information and exit 19 20 20 The SVNROOT, SVNTRUNK, SVNTAGS, and SVNBRANCHES environment variables specify repository URL of PATH, location of PATH trunk, tags, and branches(relatively to PATH) respectively.21 The SVNROOT, SVNTRUNK, SVNTAGS, and SVNBRANCHES (also SVNDEVBRANCHES) environment variables specify repository URL of PATH, location of PATH trunk, tags, and branches (also devbranches) (relatively to PATH) respectively. 21 22 22 23 Report bugs to <CMT-L@IN2P3.FR>. 23 24 """ 24 25 25 __version__ = '0. 6.0'26 __date__ = ' Fri Mar 09 2012'26 __version__ = '0.8.0' 27 __date__ = 'Wed Jul 31 2013' 27 28 __author__ = 'Grigory Rybkin' 28 29 … … 40 41 import tempfile 41 42 import re 43 44 import logging 42 45 43 46 self = 'cmt_svn_checkout.py' … … 298 301 tags = None, 299 302 branches = None, 303 devbranches = None, 300 304 version = None, 301 305 version_dir = None, … … 307 311 self.tags = tags 308 312 self.branches = branches 313 self.devbranches = devbranches 309 314 self.version = version 310 315 self.version_dir = version_dir … … 327 332 if self.branches is None: 328 333 self.branches = os.getenv('SVNBRANCHES', 'branches') 334 if self.devbranches is None: 335 self.devbranches = os.getenv('SVNDEVBRANCHES', 'devbranches') 329 336 330 337 def cmtRepos(self): … … 333 340 self.tags= '.' 334 341 self.branches = '.' 342 self.devbranches = '.' 335 343 336 344 def add(self, module): … … 378 386 """Attempt to determine the tag of the module's trunk. 379 387 380 Return the tag if its contents are the same as those of the trunk,and381 its last_changed_rev is greater than the trunk created_rev, None otherwise.388 Return the tag if its files are copied from the trunk and 389 their last_changed_rev numbers are the same as those of the trunk files. 382 390 """ 383 391 trunk = posixpath.join(module.url, self.trunk) 384 392 # trunk = posixpath.normpath(posixpath.join(module.url, self.trunk)) 393 cmd = 'svn ls -vR %s' % trunk 394 sc, out = Utils.getstatusoutput(cmd) 395 logger.debug('%s\n%s' % (cmd, out)) 396 if sc != 0: 397 return None 398 trunk_dirent = [line.split() for line in out.splitlines()] 399 trunk_revs = dict([(line[-1], int(line[0])) for line in trunk_dirent if not line[-1].endswith(posixpath.sep)]) 400 logger.debug('%s' % trunk_revs) 401 402 curdir = posixpath.curdir + posixpath.sep 403 for line in trunk_dirent: 404 if line[-1] == curdir: 405 class info(object): pass 406 info.last_changed_rev = int(line[0]) 407 self.info_receiver(trunk, info, module) 408 logger.debug('last_changed_rev: %d' % info.last_changed_rev) 409 break 410 411 # cmd = 'svn info %s' % trunk 412 # p = r'last\s+changed\s+rev:\s+(?P<rev>\d+)' 413 # m = re.search(p, out, re.I) 414 # if m: 415 # class info(object): pass 416 # info.last_changed_rev = int(m.group('rev')) 417 # self.info_receiver(trunk, info, module) 418 # # self.info_receiver(trunk, info, None) 419 # # print >>sys.stderr, '%s: last_changed_rev %i' % \ 420 # # (trunk, self.info.last_changed_rev) 421 # # last_changed_rev = int(m.group('rev')) 422 # else: 423 # return None 424 425 tags = posixpath.join(module.url, self.tags) 426 # tags = posixpath.normpath(posixpath.join(module.url, self.tags)) 427 cmd = 'svn ls -vR %s' % tags 428 # cmd = 'svn ls -v %s' % tags 429 sc, out = Utils.getstatusoutput(cmd) 430 logger.debug('%s\n%s' % (cmd, out)) 431 if sc != 0: 432 return None 433 tags_dirent = [line.split() for line in out.splitlines()] 434 tags_revs = dict() 435 for ent in tags_dirent: 436 try: 437 tag, path = ent[-1].split(posixpath.sep, 1) 438 except ValueError: 439 continue 440 if tag not in tags_revs: 441 tags_revs[tag] = dict() 442 if path and not path.endswith(posixpath.sep): 443 # assume there are no empty directories in the tag 444 tags_revs[tag][path] = int(ent[0]) 445 logger.debug('%s' % tags_revs) 446 385 447 cmd = 'svn info %s' % trunk 386 448 sc, out = Utils.getstatusoutput(cmd) 449 logger.debug('%s\n%s' % (cmd, out)) 387 450 if sc != 0: 388 451 return None 389 p = r'last\s+changed\s+rev:\s+(?P<rev>\d+)' 452 p = r'repository\s+root:\s+(?P<root>%s://\S+)' % \ 453 ('(?:' + '|'.join(map(re.escape, client_context.schemes)) + ')') 390 454 m = re.search(p, out, re.I) 455 logger.debug('pattern: %r' % (p)) 391 456 if m: 392 class info(object): pass 393 info.last_changed_rev = int(m.group('rev')) 394 self.info_receiver(trunk, info, module) 395 # self.info_receiver(trunk, info, None) 396 # print >>sys.stderr, '%s: last_changed_rev %i' % \ 397 # (trunk, self.info.last_changed_rev) 398 # last_changed_rev = int(m.group('rev')) 457 root = m.group('root') 399 458 else: 400 459 return None 401 402 tags = posixpath.join(module.url, self.tags) 403 # tags = posixpath.normpath(posixpath.join(module.url, self.tags)) 404 cmd = 'svn ls -v %s' % tags 460 logger.debug('root: %s' % root) 461 trunk_path = trunk[len(root):] 462 tags_path = tags[len(root):] 463 logger.debug('trunk_path: %s' % trunk_path) 464 logger.debug('tags_path: %s' % tags_path) 465 offset = len(trunk) - len(root) + len(posixpath.sep) 466 467 # Usually, a tag is created as a server-side copy. 468 # Sometimes, a tag is created as a copy of WC (working copy) 469 # after commit. 470 # Below, we try to take into account the latter case. 471 cmd = 'svn log -v -q %s' % tags 405 472 sc, out = Utils.getstatusoutput(cmd) 473 logger.debug('%s\n%s' % (cmd, out)) 406 474 if sc != 0: 407 475 return None 408 409 tags_dirent = [line.split() for line in out.splitlines()] 410 rev_tag = dict([(int(line[0]), line[-1].rstrip(posixpath.sep)) for line in tags_dirent if line[-1].endswith(posixpath.sep)]) 411 revs = rev_tag.keys() 412 revs.sort() 413 revs.reverse() 414 415 for rev in revs: 416 if rev < self.info.last_changed_rev: break 417 # if rev < last_changed_rev: break 418 tag = posixpath.join(tags, rev_tag[rev]) 419 # tag = posixpath.normpath(posixpath.join(tags, rev_tag[rev])) 420 if 0 == self.cmp(trunk, tag, client_context): 421 return rev_tag[rev] 476 p = re.compile( 477 r'^-{5,}$\s^r\d+.+$\s^Changed paths:$\s^\s+A\s+%s%s(?P<tag>[^%s]+)\s+\(from %s:\d+\)$(?P<replaced>(?:\s^\s+(?:R|A|D)\s+%s%s(?P=tag)%s(?P<path>.+)(?:\s+\(from %s%s(?P=path):\d+\))?$)*)' % (re.escape(tags_path), posixpath.sep, posixpath.sep, re.escape(trunk_path), re.escape(tags_path), posixpath.sep, posixpath.sep, re.escape(trunk_path), posixpath.sep) 478 , re.M 479 ) 480 tags_copied = list() 481 tags_replaced_revs = dict() 482 for m in p.finditer(out): 483 logger.debug('tag: %s replaced: %r' % (m.group('tag'), m.group('replaced'))) 484 tags_copied.append(m.group('tag')) 485 for line in m.group('replaced').strip().splitlines(): 486 l = line.split() 487 if len(l) == 2: continue # action code D - deleted paths 488 repl = l[3].rstrip(')') 489 i = repl.rindex(':') 490 path = repl[offset:i] 491 rev = int(repl[i + 1:]) 492 logger.debug('path: %s rev: %d' % (path, rev)) 493 494 if m.group('tag') not in tags_replaced_revs: 495 tags_replaced_revs[m.group('tag')] = dict() 496 if path and not path.endswith(posixpath.sep): 497 # assume there are no empty directories in the tag 498 tags_replaced_revs[m.group('tag')][path] = rev 499 500 logger.debug('copied: %s' % tags_copied) 501 logger.debug('replaced: %s' % tags_replaced_revs) 502 503 for t in tags_revs.keys(): 504 if t not in tags_copied: 505 del tags_revs[t] 506 logger.debug('%s: Not a trunk copy' % t) 507 508 for t in tags_replaced_revs: 509 if t in tags_revs: 510 tags_revs[t].update(tags_replaced_revs[t]) 511 512 for tag in tags_revs: 513 logger.debug('Compare: %s -> %s' % (tag, tags_revs[tag])) 514 if trunk_revs == tags_revs[tag]: 515 return tag 422 516 423 517 return None 518 519 # tags_dirent = [line.split() for line in out.splitlines()] 520 # rev_tag = dict([(int(line[0]), line[-1].rstrip(posixpath.sep)) for line in tags_dirent if line[-1].endswith(posixpath.sep)]) 521 # revs = rev_tag.keys() 522 # revs.sort() 523 # revs.reverse() 524 525 # for rev in revs: 526 # logger.debug('rev: %s' % rev) 527 # if rev < self.info.last_changed_rev: break 528 # # if rev < last_changed_rev: break 529 # tag = posixpath.join(tags, rev_tag[rev]) 530 # # tag = posixpath.normpath(posixpath.join(tags, rev_tag[rev])) 531 # logger.debug('comparing: %s %s(%d)' % (trunk, tag, rev)) 532 # if 0 == self.cmp(trunk, tag, client_context): 533 # return rev_tag[rev] 534 535 # return None 424 536 425 537 # try: … … 496 608 else: 497 609 m.URL = [posixpath.join(m.url, p, m.version) 498 for p in (self.tags, self.branches )]610 for p in (self.tags, self.branches, self.devbranches)] 499 611 m.URL = [client_context.svn_path_canonicalize(url) for url in m.URL] 500 612 # m.URL = [core.svn_path_canonicalize(url) for url in m.URL] … … 572 684 "offset=", "no_config", 573 685 "with_version_directory", 574 "without_version_directory", "url=" ])686 "without_version_directory", "url=", "debug"]) 575 687 except getopt.error, e: 576 688 print >>sys.stderr, '%s: %s' % (self, str(e)) 577 689 print >>sys.stderr, "Try '%s --help' for more information." % self 578 690 return 1 691 692 global logger 693 logging.basicConfig() 694 logger = logging.getLogger(self) 695 logger.setLevel(logging.INFO) 696 if os.getenv('SVNDEBUG'): 697 logger.setLevel(logging.DEBUG) 579 698 580 699 cmt_context = CmtContext() … … 605 724 elif o in ("--url",): 606 725 checkout.url = v 726 elif o in ("--debug",): 727 logger.setLevel(logging.DEBUG) 607 728 608 729 if not args: -
CMT/v1r25-branch/mgr/fragments/application
r646 r664 5 5 $(link_silent) ${LINKMACRO} -o $(@).new ${OBJS} $(cmt_installarea_linkopts) $(${CONSTITUENT}_use_linkopts) $(${CONSTITUENT}linkopts) && mv -f $(@).new $(@) 6 6 7 if def use_stamps7 ifneq ($(strip $(use_stamps)),) 8 8 # Work around Make errors if stamps files do not exist 9 9 $(use_stamps) : -
CMT/v1r25-branch/mgr/fragments/constituent
- Property svn:mergeinfo changed (with no actual effect on merging)
-
CMT/v1r25-branch/mgr/fragments/constituent_lock
- Property svn:mergeinfo changed (with no actual effect on merging)
-
CMT/v1r25-branch/mgr/fragments/jar
- Property svn:mergeinfo changed (with no actual effect on merging)
-
CMT/v1r25-branch/mgr/fragments/java
- Property svn:mergeinfo changed (with no actual effect on merging)
-
CMT/v1r25-branch/mgr/fragments/nmake/check_application
- Property svn:mergeinfo changed (with no actual effect on merging)
-
CMT/v1r25-branch/mgr/fragments/nmake/constituent
- Property svn:mergeinfo changed (with no actual effect on merging)
-
CMT/v1r25-branch/mgr/fragments/nmake/constituent_lock
- Property svn:mergeinfo changed (with no actual effect on merging)
-
CMT/v1r25-branch/mgr/fragments/nmake/jar
- Property svn:mergeinfo changed (with no actual effect on merging)
-
CMT/v1r25-branch/mgr/fragments/nmake/java
- Property svn:mergeinfo changed (with no actual effect on merging)
-
CMT/v1r25-branch/mgr/fragments/nmake/library
- Property svn:mergeinfo changed (with no actual effect on merging)
-
CMT/v1r25-branch/mgr/fragments/nmake/library_no_static
- Property svn:mergeinfo changed (with no actual effect on merging)
-
CMT/v1r25-branch/mgr/fragments/nmake/package
r600 r664 1 1 2 cmt_${PACKAGE}_${ISINCLUDED} = 1 2 3 cmt_${PACKAGE}_${ISLOCAL} = 1 3 4 … … 6 7 7 8 !if "$(LOG_LOCATION)" != "" 9 !if "$(cmt_${PACKAGE}_is_included)" != "" 8 10 !if "$(cmt_${PACKAGE}_is_local)" != "" 9 11 ${PACKAGE}OutErr = >>$(LOG_LOCATION)\$(${PACKAGE}FullName)$(LOG_SUFFIX) 2>&1 … … 11 13 !if "$(BCAST_GLOBAL)" != "" 12 14 ${PACKAGE}OutErr = >>$(LOG_LOCATION)\$(${PACKAGE}FullName)$(LOG_SUFFIX) 2>&1 15 !endif 13 16 !endif 14 17 !endif … … 20 23 ${PACKAGE} : $(${PACKAGE}MgrPath)\NMake 21 24 !endif 25 !if "$(cmt_${PACKAGE}_is_included)" != "" 22 26 !if "$(cmt_${PACKAGE}_is_local)" != "" 23 27 @echo "#--------------------------------------------------------------" \ … … 73 77 !endif 74 78 !endif 79 !else 80 81 !endif 75 82 76 83 $(${PACKAGE}MgrPath)\NMake : 84 !if "$(cmt_${PACKAGE}_is_included)" != "" 77 85 !if "$(cmt_${PACKAGE}_is_local)" != "" 78 86 $(echo) configuring ${PACKAGE} … … 85 93 86 94 !endif 95 !endif 96 !else 97 87 98 !endif 88 99 … … 96 107 97 108 ${PACKAGE}clean : $(${PACKAGE}MgrPath)\NMake 109 !if "$(cmt_${PACKAGE}_is_included)" != "" 98 110 !if "$(cmt_${PACKAGE}_is_local)" != "" 99 111 @echo "#--------------------------------------------------------------" \ … … 125 137 !endif 126 138 !endif 139 !else 140 141 !endif 127 142 128 143 ${PACKAGE}binclean : $(${PACKAGE}MgrPath)\NMake 144 !if "$(cmt_${PACKAGE}_is_included)" != "" 129 145 !if "$(cmt_${PACKAGE}_is_local)" != "" 130 146 @echo "#--------------------------------------------------------------" \ … … 156 172 !endif 157 173 !endif 174 !else 175 176 !endif 158 177 159 178 ${PACKAGE}uninstall : $(${PACKAGE}MgrPath)\NMake 179 !if "$(cmt_${PACKAGE}_is_included)" != "" 160 180 !if "$(cmt_${PACKAGE}_is_local)" != "" 161 181 @echo "#--------------------------------------------------------------" \ … … 187 207 !endif 188 208 !endif 209 !else 210 211 !endif 189 212 190 213 ${PACKAGE}check : $(${PACKAGE}MgrPath)\NMake 214 !if "$(cmt_${PACKAGE}_is_included)" != "" 191 215 !if "$(cmt_${PACKAGE}_is_local)" != "" 192 216 @echo "#--------------------------------------------------------------" \ … … 218 242 !endif 219 243 !endif 244 !else 245 246 !endif 220 247 221 248 ${PACKAGE} ${PACKAGE}clean ${PACKAGE}binclean ${PACKAGE}uninstall ${PACKAGE}check : FORCE -
CMT/v1r25-branch/mgr/fragments/nmake/packages_header
r600 r664 27 27 # ignore: try all the groups even if one fails before going to the next package 28 28 # (may result in duplicated errors within a package) 29 # Unix version taken from https://svnweb.cern.ch/trac/gaudi/browser/Gaudi/trunk/Makefile.cmt (Modified )29 # Unix version taken from https://svnweb.cern.ch/trac/gaudi/browser/Gaudi/trunk/Makefile.cmt (Modified by Grigory Rybkin) 30 30 Package_failure_handler = || exit 31 31 !if "$(PACKAGE_FAILURE_POLICY)" != "" -
CMT/v1r25-branch/mgr/fragments/package
r600 r664 1 1 2 cmt_${PACKAGE}_${ISINCLUDED} = 1 2 3 cmt_${PACKAGE}_${ISLOCAL} = 1 3 4 … … 6 7 7 8 ifdef LOG_LOCATION 9 ifdef cmt_${PACKAGE}_is_included 8 10 ifdef cmt_${PACKAGE}_is_local 9 11 ${PACKAGE}OutErr = >>$(LOG_LOCATION)/$(${PACKAGE}FullName)$(LOG_SUFFIX) 2>&1 … … 11 13 ifdef BCAST_GLOBAL 12 14 ${PACKAGE}OutErr = >>$(LOG_LOCATION)/$(${PACKAGE}FullName)$(LOG_SUFFIX) 2>&1 15 endif 13 16 endif 14 17 endif … … 20 23 ${PACKAGE} : $(${PACKAGE}MgrPath)/Makefile 21 24 endif 25 ifdef cmt_${PACKAGE}_is_included 22 26 ifdef cmt_${PACKAGE}_is_local 23 27 @echo "#--------------------------------------------------------------" \ … … 67 71 endif 68 72 endif 73 else 74 75 endif 69 76 70 77 $(${PACKAGE}MgrPath)/Makefile : 78 ifdef cmt_${PACKAGE}_is_included 71 79 ifdef cmt_${PACKAGE}_is_local 72 80 $(echo) configuring ${PACKAGE} … … 80 88 endif 81 89 endif 90 else 91 92 endif 82 93 83 94 ifndef BCAST_ONLY … … 90 101 91 102 ${PACKAGE}clean ${PACKAGE}binclean ${PACKAGE}uninstall ${PACKAGE}check : $(${PACKAGE}MgrPath)/Makefile 103 ifdef cmt_${PACKAGE}_is_included 92 104 ifdef cmt_${PACKAGE}_is_local 93 105 @echo "#--------------------------------------------------------------" \ … … 119 131 endif 120 132 endif 133 else 134 135 endif 121 136 122 137 ${PACKAGE} ${PACKAGE}clean ${PACKAGE}binclean ${PACKAGE}uninstall ${PACKAGE}check : FORCE -
CMT/v1r25-branch/mgr/fragments/packages_header
r600 r664 42 42 # ignore: try all the groups even if one fails before going to the next package 43 43 # (may result in duplicated errors within a package) 44 # Taken from https://svnweb.cern.ch/trac/gaudi/browser/Gaudi/trunk/Makefile.cmt (Modified )44 # Taken from https://svnweb.cern.ch/trac/gaudi/browser/Gaudi/trunk/Makefile.cmt (Modified by Grigory Rybkin) 45 45 Package_failure_handler = || exit 46 46 ifdef PACKAGE_FAILURE_POLICY -
CMT/v1r25-branch/mgr/requirements
r618 r664 6 6 tag CMTr16 CMTr14 7 7 tag CMTr18 CMTr16 8 tag CMTr0 CMTr18 9 8 tag CMTr0 CMTr25 9 10 tag CMTv0 CMTv1 10 11 # 11 12 # Automatic detection of some system features. … … 125 126 WIN32 "CMT\v" 126 127 127 path_ prependPATH "${CMTROOT}/${CMTBIN}" \128 path_append PATH "${CMTROOT}/${CMTBIN}" \ 128 129 WIN32 "%CMTROOT%\%CMTBIN%" 129 130
Note: See TracChangeset
for help on using the changeset viewer.