Changeset 664 for CMT/v1r25-branch/mgr


Ignore:
Timestamp:
Jan 13, 2014, 4:09:37 PM (10 years ago)
Author:
rybkin
Message:

merge -r 646:663 HEAD

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'">
    22<!ATTLIST setup     %cmtns;>
    33<!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  
    1515      --with_version_directory create version directory upon PATH checkout (default)
    1616      --url=URL                checkout PATH from repository URL
     17      --debug                  print lots of debugging information
    1718  -h, --help                   display this help and exit
    1819      --version                output version information and exit
    1920
    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.
     21The 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.
    2122
    2223Report bugs to <CMT-L@IN2P3.FR>.
    2324"""
    2425
    25 __version__ = '0.6.0'
    26 __date__ = 'Fri Mar 09 2012'
     26__version__ = '0.8.0'
     27__date__ = 'Wed Jul 31 2013'
    2728__author__ = 'Grigory Rybkin'
    2829
     
    4041import tempfile
    4142import re
     43
     44import logging
    4245
    4346self = 'cmt_svn_checkout.py'
     
    298301                 tags = None,
    299302                 branches = None,
     303                 devbranches = None,
    300304                 version = None,
    301305                 version_dir = None,
     
    307311        self.tags = tags
    308312        self.branches = branches
     313        self.devbranches = devbranches
    309314        self.version = version
    310315        self.version_dir = version_dir
     
    327332        if self.branches is None:
    328333            self.branches = os.getenv('SVNBRANCHES', 'branches')
     334        if self.devbranches is None:
     335            self.devbranches = os.getenv('SVNDEVBRANCHES', 'devbranches')
    329336
    330337    def cmtRepos(self):
     
    333340        self.tags= '.'
    334341        self.branches = '.'
     342        self.devbranches = '.'
    335343
    336344    def add(self, module):
     
    378386        """Attempt to determine the tag of the module's trunk.
    379387       
    380         Return the tag if its contents are the same as those of the trunk, and
    381         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.
    382390        """
    383391        trunk = posixpath.join(module.url, self.trunk)
    384392#        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
    385447        cmd = 'svn info %s' % trunk
    386448        sc, out = Utils.getstatusoutput(cmd)
     449        logger.debug('%s\n%s' % (cmd, out))
    387450        if sc != 0:
    388451            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)) + ')')
    390454        m = re.search(p, out, re.I)
     455        logger.debug('pattern: %r' % (p))
    391456        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')
    399458        else:
    400459            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
    405472        sc, out = Utils.getstatusoutput(cmd)
     473        logger.debug('%s\n%s' % (cmd, out))
    406474        if sc != 0:
    407475            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
    422516
    423517        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
    424536
    425537#         try:
     
    496608            else:
    497609                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)]
    499611            m.URL = [client_context.svn_path_canonicalize(url) for url in m.URL]
    500612#            m.URL = [core.svn_path_canonicalize(url) for url in m.URL]
     
    572684                                    "offset=", "no_config",
    573685                                    "with_version_directory",
    574                                     "without_version_directory", "url="])
     686                                    "without_version_directory", "url=", "debug"])
    575687    except getopt.error, e:
    576688        print >>sys.stderr, '%s: %s' % (self, str(e))
    577689        print >>sys.stderr, "Try '%s --help' for more information." % self
    578690        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)
    579698
    580699    cmt_context = CmtContext()
     
    605724        elif o in ("--url",):
    606725            checkout.url = v
     726        elif o in ("--debug",):
     727            logger.setLevel(logging.DEBUG)
    607728
    608729    if not args:
  • CMT/v1r25-branch/mgr/fragments/application

    r646 r664  
    55        $(link_silent) ${LINKMACRO} -o $(@).new ${OBJS} $(cmt_installarea_linkopts) $(${CONSTITUENT}_use_linkopts) $(${CONSTITUENT}linkopts) && mv -f $(@).new $(@)
    66
    7 ifdef use_stamps
     7ifneq ($(strip $(use_stamps)),)
    88# Work around Make errors if stamps files do not exist
    99$(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  
    11
     2cmt_${PACKAGE}_${ISINCLUDED} = 1
    23cmt_${PACKAGE}_${ISLOCAL} = 1
    34
     
    67
    78!if "$(LOG_LOCATION)" != ""
     9!if "$(cmt_${PACKAGE}_is_included)" != ""
    810!if "$(cmt_${PACKAGE}_is_local)" != ""
    911${PACKAGE}OutErr = >>$(LOG_LOCATION)\$(${PACKAGE}FullName)$(LOG_SUFFIX) 2>&1
     
    1113!if "$(BCAST_GLOBAL)" != ""
    1214${PACKAGE}OutErr = >>$(LOG_LOCATION)\$(${PACKAGE}FullName)$(LOG_SUFFIX) 2>&1
     15!endif
    1316!endif
    1417!endif
     
    2023${PACKAGE} : $(${PACKAGE}MgrPath)\NMake
    2124!endif
     25!if "$(cmt_${PACKAGE}_is_included)" != ""
    2226!if "$(cmt_${PACKAGE}_is_local)" != ""
    2327        @echo "#--------------------------------------------------------------" \
     
    7377!endif
    7478!endif
     79!else
     80       
     81!endif
    7582
    7683$(${PACKAGE}MgrPath)\NMake :
     84!if "$(cmt_${PACKAGE}_is_included)" != ""
    7785!if "$(cmt_${PACKAGE}_is_local)" != ""
    7886        $(echo) configuring ${PACKAGE}
     
    8593       
    8694!endif
     95!endif
     96!else
     97       
    8798!endif
    8899
     
    96107
    97108${PACKAGE}clean : $(${PACKAGE}MgrPath)\NMake
     109!if "$(cmt_${PACKAGE}_is_included)" != ""
    98110!if "$(cmt_${PACKAGE}_is_local)" != ""
    99111        @echo "#--------------------------------------------------------------" \
     
    125137!endif
    126138!endif
     139!else
     140       
     141!endif
    127142
    128143${PACKAGE}binclean : $(${PACKAGE}MgrPath)\NMake
     144!if "$(cmt_${PACKAGE}_is_included)" != ""
    129145!if "$(cmt_${PACKAGE}_is_local)" != ""
    130146        @echo "#--------------------------------------------------------------" \
     
    156172!endif
    157173!endif
     174!else
     175       
     176!endif
    158177
    159178${PACKAGE}uninstall : $(${PACKAGE}MgrPath)\NMake
     179!if "$(cmt_${PACKAGE}_is_included)" != ""
    160180!if "$(cmt_${PACKAGE}_is_local)" != ""
    161181        @echo "#--------------------------------------------------------------" \
     
    187207!endif
    188208!endif
     209!else
     210       
     211!endif
    189212
    190213${PACKAGE}check : $(${PACKAGE}MgrPath)\NMake
     214!if "$(cmt_${PACKAGE}_is_included)" != ""
    191215!if "$(cmt_${PACKAGE}_is_local)" != ""
    192216        @echo "#--------------------------------------------------------------" \
     
    218242!endif
    219243!endif
     244!else
     245       
     246!endif
    220247
    221248${PACKAGE} ${PACKAGE}clean ${PACKAGE}binclean ${PACKAGE}uninstall ${PACKAGE}check : FORCE
  • CMT/v1r25-branch/mgr/fragments/nmake/packages_header

    r600 r664  
    2727#    ignore: try all the groups even if one fails before going to the next package
    2828#            (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)
    3030Package_failure_handler = || exit
    3131!if "$(PACKAGE_FAILURE_POLICY)" != ""
  • CMT/v1r25-branch/mgr/fragments/package

    r600 r664  
    11
     2cmt_${PACKAGE}_${ISINCLUDED} = 1
    23cmt_${PACKAGE}_${ISLOCAL} = 1
    34
     
    67
    78ifdef LOG_LOCATION
     9ifdef cmt_${PACKAGE}_is_included
    810ifdef cmt_${PACKAGE}_is_local
    911${PACKAGE}OutErr = >>$(LOG_LOCATION)/$(${PACKAGE}FullName)$(LOG_SUFFIX) 2>&1
     
    1113ifdef BCAST_GLOBAL
    1214${PACKAGE}OutErr = >>$(LOG_LOCATION)/$(${PACKAGE}FullName)$(LOG_SUFFIX) 2>&1
     15endif
    1316endif
    1417endif
     
    2023${PACKAGE} : $(${PACKAGE}MgrPath)/Makefile
    2124endif
     25ifdef cmt_${PACKAGE}_is_included
    2226ifdef cmt_${PACKAGE}_is_local
    2327        @echo "#--------------------------------------------------------------" \
     
    6771endif
    6872endif
     73else
     74       
     75endif
    6976
    7077$(${PACKAGE}MgrPath)/Makefile :
     78ifdef cmt_${PACKAGE}_is_included
    7179ifdef cmt_${PACKAGE}_is_local
    7280        $(echo) configuring ${PACKAGE}
     
    8088endif
    8189endif
     90else
     91       
     92endif
    8293
    8394ifndef BCAST_ONLY
     
    90101
    91102${PACKAGE}clean ${PACKAGE}binclean ${PACKAGE}uninstall ${PACKAGE}check : $(${PACKAGE}MgrPath)/Makefile
     103ifdef cmt_${PACKAGE}_is_included
    92104ifdef cmt_${PACKAGE}_is_local
    93105        @echo "#--------------------------------------------------------------" \
     
    119131endif
    120132endif
     133else
     134       
     135endif
    121136
    122137${PACKAGE} ${PACKAGE}clean ${PACKAGE}binclean ${PACKAGE}uninstall ${PACKAGE}check : FORCE
  • CMT/v1r25-branch/mgr/fragments/packages_header

    r600 r664  
    4242#    ignore: try all the groups even if one fails before going to the next package
    4343#            (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)
    4545Package_failure_handler = || exit
    4646ifdef PACKAGE_FAILURE_POLICY
  • CMT/v1r25-branch/mgr/requirements

    r618 r664  
    66tag CMTr16 CMTr14
    77tag CMTr18 CMTr16
    8 tag CMTr0  CMTr18
    9 
     8tag CMTr0  CMTr25
     9
     10tag CMTv0  CMTv1
    1011#
    1112#  Automatic detection of some system features.
     
    125126             WIN32     "CMT\v"
    126127
    127 path_prepend PATH      "${CMTROOT}/${CMTBIN}" \
     128path_append PATH      "${CMTROOT}/${CMTBIN}" \
    128129             WIN32     "%CMTROOT%\%CMTBIN%"
    129130
Note: See TracChangeset for help on using the changeset viewer.