Github user edespino commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1251#discussion_r120542744
  
    --- Diff: tools/sbin/packcore ---
    @@ -0,0 +1,262 @@
    +#!/bin/env python
    +# Licensed to the Apache Software Foundation (ASF) under one
    +# or more contributor license agreements.  See the NOTICE file
    +# distributed with this work for additional information
    +# regarding copyright ownership.  The ASF licenses this file
    +# to you under the Apache License, Version 2.0 (the
    +# "License"); you may not use this file except in compliance
    +# with the License.  You may obtain a copy of the License at
    +# 
    +#   http://www.apache.org/licenses/LICENSE-2.0
    +# 
    +# Unless required by applicable law or agreed to in writing,
    +# software distributed under the License is distributed on an
    +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    +# KIND, either express or implied.  See the License for the
    +# specific language governing permissions and limitations
    +# under the License.
    +
    +# Copyright Pivotal 2014
    +# Merged from 
https://github.com/greenplum-db/gpdb/blob/master/gpMgmt/sbin/packcore
    +
    +'''
    +USAGE:  ./packcore -b|--binary BINARY COREFILE
    +        where BINARY is the path to postgres binary
    +        where COREFILE is the core file
    +'''
    +
    +import glob
    +import os
    +import re
    +import string
    +import shutil
    +import stat
    +import sys
    +from optparse import OptionParser
    +from subprocess import Popen, PIPE
    +
    +
    +def _getPlatformInfo():
    +    if which('lsb_release') is None:
    +        for file in glob.glob('/etc/*release'):
    +            shutil.copy(file, '.')
    +    else:
    +        Popen('/usr/bin/lsb_release -a > ./lsb_release.out', shell=True)
    +
    +    Popen('uname -r > uname.out', shell=True)
    +
    +
    +def _getFileInfo(coreFile):
    +    cmd = Popen('/usr/bin/file ' + coreFile, shell=True, stdout=PIPE)
    +    return cmd.communicate()[0]
    +
    +
    +def _isCore(fileCmdOutput):
    +    if fileCmdOutput.find('LSB core file') is -1:
    +        return False
    +    return True
    +
    +
    +def _findBinary(fileCmdOutput):
    +    start = string.find(fileCmdOutput, "'") + 1
    +    end = string.find(fileCmdOutput, "'", start)
    +    cmd = fileCmdOutput[start:end].split()[0].translate(None, 
string.punctuation)
    +    if os.path.isabs(cmd):
    +        return cmd
    +    return which(cmd)
    +
    +
    +def _getLibraryListWithLDD(binary):
    +    # We manually seed this with a few libraries that are missed
    +    # This may not be needed for all proces, but will round out the
    --- End diff --
    
    "proces" is misspelled.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to