Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "rda_python_common"
version = "1.0.44"
version = "1.0.45"
authors = [
{ name="Zaihua Ji", email="[email protected]" },
]
Expand Down
20 changes: 11 additions & 9 deletions src/rda_python_common/PgFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1664,7 +1664,7 @@ def local_file_stat(file, fstat, opt, logact):
if opt&8:
info['gid'] = fstat.st_gid
info['group'] = grp.getgrgid(info['gid']).gr_name
if opt&32: info['checksum'] = get_md5sum(file, 0, logact)
if opt&32 and info['isfile']: info['checksum'] = get_md5sum(file, 0, logact)

return info

Expand Down Expand Up @@ -2305,16 +2305,18 @@ def get_md5sum(file, count = 0, logact = 0):
if count > 0:
checksum = [None]*count
for i in range(count):
chksm = PgLOG.pgsystem(cmd + file[i], logact, 20)
if chksm:
ms = re.search(r'(\w{32})', chksm)
if ms: checksum[i] = ms.group(1)
if op.isfile(file[i]):
chksm = PgLOG.pgsystem(cmd + file[i], logact, 20)
if chksm:
ms = re.search(r'(\w{32})', chksm)
if ms: checksum[i] = ms.group(1)
else:
chksm = PgLOG.pgsystem(cmd + file, logact, 20)
checksum = None
if chksm:
ms = re.search(r'(\w{32})', chksm)
if ms: checksum = ms.group(1)
if op.isfile(file):
chksm = PgLOG.pgsystem(cmd + file, logact, 20)
if chksm:
ms = re.search(r'(\w{32})', chksm)
if ms: checksum = ms.group(1)

return checksum

Expand Down
2 changes: 1 addition & 1 deletion src/rda_python_common/PgLOG.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ def write_message(msg, file, logact):
if logact&BRKLIN: OUT.write("\n")
if logact&SEPLIN: OUT.write(PGLOG['SEPLINE'])
OUT.write(msg)
if errlog and not logact&(EMLALL|SKPTRC): OUT.write(get_call_trace())
if errlog and file and not logact&(EMLALL|SKPTRC): OUT.write(get_call_trace())
if doclose: OUT.close()

#
Expand Down