kkpyutil 1.49.1__py3-none-any.whl → 1.49.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kkpyutil
3
- Version: 1.49.1
3
+ Version: 1.49.3
4
4
  Summary: Building blocks for sysadmin and DevOps
5
5
  Home-page: https://github.com/kakyoism/kkpyutil/
6
6
  License: MIT
@@ -0,0 +1,7 @@
1
+ kkpyutil.py,sha256=fb_l_-BM7p6jqbRu3xjsIrH9GEPGLZnVsPcth2NOR54,122166
2
+ kkpyutil_helper/windows/kkttssave.ps1,sha256=xa3-WzqNh2rGYlOx_I4ewOuCE94gkTO5cEwYH0M67_0,446
3
+ kkpyutil_helper/windows/kkttsspeak.ps1,sha256=7WUUHMmjTQroUWA2Mvdt4JtSt475nZUHQx-qP-7rS6o,305
4
+ kkpyutil-1.49.3.dist-info/LICENSE,sha256=uISevGnCxB5QOU0ftbofN75_yUtd6E2h_MWE1zqagC8,1065
5
+ kkpyutil-1.49.3.dist-info/METADATA,sha256=kP4vxShQcdW4Am6qeCTMt_ZfVEJkSG5tRP2zHLrM1z4,1136
6
+ kkpyutil-1.49.3.dist-info/WHEEL,sha256=kLuE8m1WYU0Ig0_YEGrXyTtiJvKPpLpDEiChiNyei5Y,88
7
+ kkpyutil-1.49.3.dist-info/RECORD,,
kkpyutil.py CHANGED
@@ -2140,7 +2140,6 @@ def sync_dirs(src_root, dst_root, logger=glogger, sudo=False):
2140
2140
  # Note: 'staff' is the default group for users on macOS
2141
2141
  cmd = [
2142
2142
  'rsync', '-av', '--inplace',
2143
- f'--chown={user}:staff',
2144
2143
  osp.join(src_root, ''), # Trailing slash copies contents
2145
2144
  dst_root
2146
2145
  ]
@@ -2148,6 +2147,13 @@ def sync_dirs(src_root, dst_root, logger=glogger, sudo=False):
2148
2147
  if not _run_sudo_command(cmd, pwd, logger):
2149
2148
  logger.error(f'Sync failed with command: {cmd}; you may have entered wrong password')
2150
2149
  return False
2150
+ # 3. Step Two: Fix Ownership
2151
+ # -R is recursive. We set it to the user and the 'staff' group.
2152
+ chown_cmd = ['chown', '-R', f'{user}:staff', dst_root]
2153
+ logger.info(f"Setting ownership of {dst_root} to {user}...")
2154
+ if not _run_sudo_command(chown_cmd, pwd, logger):
2155
+ logger.error("Failed to set ownership.")
2156
+ return False
2151
2157
  return True
2152
2158
 
2153
2159
 
@@ -1,7 +0,0 @@
1
- kkpyutil.py,sha256=UUHMDWsRPPFUbwv9lv8pF2j0Hbq5bMDFrL2aWYBCKSA,121850
2
- kkpyutil_helper/windows/kkttssave.ps1,sha256=xa3-WzqNh2rGYlOx_I4ewOuCE94gkTO5cEwYH0M67_0,446
3
- kkpyutil_helper/windows/kkttsspeak.ps1,sha256=7WUUHMmjTQroUWA2Mvdt4JtSt475nZUHQx-qP-7rS6o,305
4
- kkpyutil-1.49.1.dist-info/LICENSE,sha256=uISevGnCxB5QOU0ftbofN75_yUtd6E2h_MWE1zqagC8,1065
5
- kkpyutil-1.49.1.dist-info/METADATA,sha256=LKmnog3BRiOGBJmYcT_FQIHTJUBPdUEsLvk1XTlu-6Q,1136
6
- kkpyutil-1.49.1.dist-info/WHEEL,sha256=kLuE8m1WYU0Ig0_YEGrXyTtiJvKPpLpDEiChiNyei5Y,88
7
- kkpyutil-1.49.1.dist-info/RECORD,,