pkgmgr-kunrunic 0.1.1.dev5__tar.gz → 0.1.1.dev7__tar.gz
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.
- {pkgmgr_kunrunic-0.1.1.dev5/pkgmgr_kunrunic.egg-info → pkgmgr_kunrunic-0.1.1.dev7}/PKG-INFO +1 -1
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr/__init__.py +1 -1
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr/config.py +8 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr/release.py +18 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7/pkgmgr_kunrunic.egg-info}/PKG-INFO +1 -1
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/plugin/export_pkgstore.py +87 -4
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/LICENSE +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/README.md +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr/__main__.py +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr/cli.py +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr/collectors/__init__.py +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr/collectors/base.py +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr/collectors/checksums.py +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr/points.py +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr/shell_integration.py +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr/snapshot.py +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr/templates/pkg.yaml.sample +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr/templates/pkgmgr.yaml.sample +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr/watch.py +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr_kunrunic.egg-info/SOURCES.txt +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr_kunrunic.egg-info/dependency_links.txt +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr_kunrunic.egg-info/entry_points.txt +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr_kunrunic.egg-info/not-zip-safe +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr_kunrunic.egg-info/requires.txt +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr_kunrunic.egg-info/top_level.txt +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/plugin/export_cksum.py +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/plugin/export_source_review.py +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pyproject.toml +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/setup.cfg +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/tests/test_cli_install.py +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/tests/test_config.py +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/tests/test_progress.py +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/tests/test_release.py +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/tests/test_snapshot.py +0 -0
- {pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/tools/echo_args.py +0 -0
|
@@ -26,6 +26,8 @@ except Exception:
|
|
|
26
26
|
|
|
27
27
|
MAIN_TEMPLATE = """\
|
|
28
28
|
pkg_release_root: ~/PKG/RELEASE
|
|
29
|
+
git:
|
|
30
|
+
repo_url: "https://github.com/org/repo"
|
|
29
31
|
sources:
|
|
30
32
|
- /path/to/source-A
|
|
31
33
|
- /path/to/source-B
|
|
@@ -104,6 +106,7 @@ collectors:
|
|
|
104
106
|
|
|
105
107
|
MAIN_DEFAULTS = {
|
|
106
108
|
"pkg_release_root": None,
|
|
109
|
+
"git": {"repo_url": None},
|
|
107
110
|
"sources": [],
|
|
108
111
|
"source": {"exclude": []},
|
|
109
112
|
"artifacts": {"root": None, "targets": [], "exclude": []},
|
|
@@ -199,6 +202,10 @@ def _validate_main_config(data):
|
|
|
199
202
|
raise RuntimeError("pkg_release_root is required (path string)")
|
|
200
203
|
cfg["pkg_release_root"] = str(pkg_root)
|
|
201
204
|
|
|
205
|
+
git_cfg = cfg.get("git") if isinstance(cfg.get("git"), dict) else {}
|
|
206
|
+
repo_url = git_cfg.get("repo_url")
|
|
207
|
+
cfg["git"] = {"repo_url": str(repo_url) if repo_url else None}
|
|
208
|
+
|
|
202
209
|
cfg["sources"] = _ensure_list_of_strings(cfg.get("sources"), "sources")
|
|
203
210
|
src = cfg.get("source") if isinstance(cfg.get("source"), dict) else {}
|
|
204
211
|
cfg["source"] = {"exclude": _ensure_list_of_strings(src.get("exclude"), "source.exclude")}
|
|
@@ -404,5 +411,6 @@ def describe_expected_fields():
|
|
|
404
411
|
- cwd: working directory (optional)
|
|
405
412
|
- env: key/value env overrides for that command only (optional)
|
|
406
413
|
auto_actions: mapping of lifecycle events to action names (create_pkg/update_pkg/update_pkg_release/close_pkg)
|
|
414
|
+
git.repo_url: base repository URL for commit links (per system)
|
|
407
415
|
"""
|
|
408
416
|
).strip()
|
|
@@ -602,6 +602,18 @@ _PKG_NOTE_NAME = "PKG_NOTE"
|
|
|
602
602
|
_PKG_LIST_NAME = "PKG_LIST"
|
|
603
603
|
|
|
604
604
|
|
|
605
|
+
def _read_note_text(path):
|
|
606
|
+
try:
|
|
607
|
+
with open(path, "r", encoding="utf-8") as f:
|
|
608
|
+
return f.read()
|
|
609
|
+
except Exception:
|
|
610
|
+
try:
|
|
611
|
+
with open(path, "r", encoding="euc-kr", errors="replace") as f:
|
|
612
|
+
return f.read()
|
|
613
|
+
except Exception:
|
|
614
|
+
return ""
|
|
615
|
+
|
|
616
|
+
|
|
605
617
|
def _list_release_versions(base_dir, include_history=False):
|
|
606
618
|
"""Return list of (major, minor, patch, path) under base_dir (optional HISTORY)."""
|
|
607
619
|
versions = []
|
|
@@ -836,6 +848,8 @@ def _prepare_release(pkg_dir, pkg_cfg):
|
|
|
836
848
|
)
|
|
837
849
|
)
|
|
838
850
|
|
|
851
|
+
note_text = _read_note_text(note_path)
|
|
852
|
+
|
|
839
853
|
all_files = []
|
|
840
854
|
for base, _, names in os.walk(release_dir):
|
|
841
855
|
for name in names:
|
|
@@ -891,6 +905,7 @@ def _prepare_release(pkg_dir, pkg_cfg):
|
|
|
891
905
|
"updated": updated,
|
|
892
906
|
"removed": sorted(removed),
|
|
893
907
|
"prev_release": prev_dir,
|
|
908
|
+
"note": note_text,
|
|
894
909
|
}
|
|
895
910
|
)
|
|
896
911
|
|
|
@@ -1029,6 +1044,9 @@ def update_pkg(cfg, pkg_id):
|
|
|
1029
1044
|
os.makedirs(updates_dir)
|
|
1030
1045
|
|
|
1031
1046
|
git_info, git_files = _collect_git_hits(pkg_cfg, pkg_dir)
|
|
1047
|
+
repo_url = (cfg.get("git") or {}).get("repo_url")
|
|
1048
|
+
if repo_url:
|
|
1049
|
+
git_info["repo_url"] = repo_url
|
|
1032
1050
|
release_files = _collect_release_files(pkg_dir, pkg_cfg)
|
|
1033
1051
|
|
|
1034
1052
|
release_bundle = _prepare_release(pkg_dir, pkg_cfg)
|
|
@@ -35,7 +35,14 @@ def _default_release_root():
|
|
|
35
35
|
return os.path.join(home, "PKG", "RELEASE")
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
def
|
|
38
|
+
def _list_pkg_ids(src_state_root):
|
|
39
|
+
pkg_dir = os.path.join(src_state_root, "pkg")
|
|
40
|
+
if not os.path.isdir(pkg_dir):
|
|
41
|
+
return []
|
|
42
|
+
return sorted([name for name in os.listdir(pkg_dir) if os.path.isdir(os.path.join(pkg_dir, name))])
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _copy_export_dirs(release_root, dest_state_root, allowed_pkg_ids=None):
|
|
39
46
|
if not os.path.isdir(release_root):
|
|
40
47
|
return
|
|
41
48
|
pkg_root = os.path.join(dest_state_root, "pkg")
|
|
@@ -45,6 +52,8 @@ def _copy_export_dirs(release_root, dest_state_root):
|
|
|
45
52
|
pkg_dir = os.path.join(release_root, name)
|
|
46
53
|
if not os.path.isdir(pkg_dir):
|
|
47
54
|
continue
|
|
55
|
+
if allowed_pkg_ids is not None and name not in allowed_pkg_ids:
|
|
56
|
+
continue
|
|
48
57
|
export_dir = os.path.join(pkg_dir, "export")
|
|
49
58
|
if not os.path.isdir(export_dir):
|
|
50
59
|
continue
|
|
@@ -52,7 +61,65 @@ def _copy_export_dirs(release_root, dest_state_root):
|
|
|
52
61
|
_copy_tree(export_dir, dest_export)
|
|
53
62
|
|
|
54
63
|
|
|
55
|
-
def
|
|
64
|
+
def _copy_release_tars(release_root, dest_state_root, allowed_pkg_ids=None):
|
|
65
|
+
if not os.path.isdir(release_root):
|
|
66
|
+
return
|
|
67
|
+
pkg_root = os.path.join(dest_state_root, "pkg")
|
|
68
|
+
if not os.path.exists(pkg_root):
|
|
69
|
+
os.makedirs(pkg_root)
|
|
70
|
+
for name in os.listdir(release_root):
|
|
71
|
+
pkg_dir = os.path.join(release_root, name)
|
|
72
|
+
if not os.path.isdir(pkg_dir):
|
|
73
|
+
continue
|
|
74
|
+
if allowed_pkg_ids is not None and name not in allowed_pkg_ids:
|
|
75
|
+
continue
|
|
76
|
+
release_dir = os.path.join(pkg_dir, "release")
|
|
77
|
+
if not os.path.isdir(release_dir):
|
|
78
|
+
continue
|
|
79
|
+
for base, _, files in os.walk(release_dir):
|
|
80
|
+
for fname in files:
|
|
81
|
+
if not fname.endswith(".tar"):
|
|
82
|
+
continue
|
|
83
|
+
src = os.path.join(base, fname)
|
|
84
|
+
rel = os.path.relpath(src, release_dir)
|
|
85
|
+
dest_tar = os.path.join(pkg_root, name, "release_artifacts", rel)
|
|
86
|
+
dest_parent = os.path.dirname(dest_tar)
|
|
87
|
+
if not os.path.exists(dest_parent):
|
|
88
|
+
os.makedirs(dest_parent)
|
|
89
|
+
shutil.copy2(src, dest_tar)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def _find_readme(pkg_dir):
|
|
93
|
+
for base, _, files in os.walk(pkg_dir):
|
|
94
|
+
for fname in files:
|
|
95
|
+
if fname.lower() == "readme.txt":
|
|
96
|
+
return os.path.join(base, fname)
|
|
97
|
+
return None
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def _copy_readme_files(release_root, dest_state_root, system_name, allowed_pkg_ids=None):
|
|
101
|
+
if not os.path.isdir(release_root):
|
|
102
|
+
return
|
|
103
|
+
pkg_root = os.path.join(dest_state_root, "pkg")
|
|
104
|
+
if not os.path.exists(pkg_root):
|
|
105
|
+
os.makedirs(pkg_root)
|
|
106
|
+
for name in os.listdir(release_root):
|
|
107
|
+
pkg_dir = os.path.join(release_root, name)
|
|
108
|
+
if not os.path.isdir(pkg_dir):
|
|
109
|
+
continue
|
|
110
|
+
if allowed_pkg_ids is not None and name not in allowed_pkg_ids:
|
|
111
|
+
continue
|
|
112
|
+
candidate = _find_readme(pkg_dir)
|
|
113
|
+
if not candidate:
|
|
114
|
+
continue
|
|
115
|
+
dest_readme = os.path.join(pkg_root, name, "readme", "README.txt")
|
|
116
|
+
dest_parent = os.path.dirname(dest_readme)
|
|
117
|
+
if not os.path.exists(dest_parent):
|
|
118
|
+
os.makedirs(dest_parent)
|
|
119
|
+
shutil.copy2(candidate, dest_readme)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def export_pkgstore(src, dest, clean=False, release_root=None, system_name=None):
|
|
56
123
|
if not os.path.isdir(src):
|
|
57
124
|
raise RuntimeError("source not found: %s" % src)
|
|
58
125
|
if clean and os.path.exists(dest):
|
|
@@ -61,7 +128,10 @@ def export_pkgstore(src, dest, clean=False, release_root=None):
|
|
|
61
128
|
os.makedirs(dest)
|
|
62
129
|
_copy_tree(src, dest)
|
|
63
130
|
if release_root:
|
|
64
|
-
|
|
131
|
+
allowed_pkg_ids = _list_pkg_ids(src)
|
|
132
|
+
_copy_export_dirs(release_root, dest, allowed_pkg_ids=allowed_pkg_ids)
|
|
133
|
+
_copy_release_tars(release_root, dest, allowed_pkg_ids=allowed_pkg_ids)
|
|
134
|
+
_copy_readme_files(release_root, dest, system_name, allowed_pkg_ids=allowed_pkg_ids)
|
|
65
135
|
|
|
66
136
|
|
|
67
137
|
def main(argv=None):
|
|
@@ -74,6 +144,7 @@ def main(argv=None):
|
|
|
74
144
|
parser.add_argument("--push", help="rsync target like user@host (pushes to remote)")
|
|
75
145
|
parser.add_argument("--remote-dest", default="~/data/pkgstore", help="remote pkgstore root (default: ~/data/pkgstore)")
|
|
76
146
|
parser.add_argument("--identity", help="ssh private key path for rsync (optional)")
|
|
147
|
+
parser.add_argument("--debug", action="store_true", help="print debug info about source contents")
|
|
77
148
|
args = parser.parse_args(argv)
|
|
78
149
|
if not args.dest and not args.push:
|
|
79
150
|
parser.error("--dest is required when --push is not set")
|
|
@@ -92,7 +163,19 @@ def main(argv=None):
|
|
|
92
163
|
dest_state = os.path.join(dest_root, "state")
|
|
93
164
|
release_root = os.path.abspath(os.path.expanduser(args.release_root)) if args.release_root else None
|
|
94
165
|
|
|
95
|
-
|
|
166
|
+
if args.debug:
|
|
167
|
+
try:
|
|
168
|
+
items = _list_pkg_ids(src)
|
|
169
|
+
except Exception:
|
|
170
|
+
items = []
|
|
171
|
+
print("[export_pkgstore] src=%s pkg=%s" % (src, ", ".join(items) or "-"))
|
|
172
|
+
export_pkgstore(
|
|
173
|
+
src,
|
|
174
|
+
dest_state,
|
|
175
|
+
clean=args.clean,
|
|
176
|
+
release_root=release_root,
|
|
177
|
+
system_name=system_name,
|
|
178
|
+
)
|
|
96
179
|
print("[export_pkgstore] synced %s -> %s" % (src, dest_state))
|
|
97
180
|
|
|
98
181
|
if args.push:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr/templates/pkgmgr.yaml.sample
RENAMED
|
File without changes
|
|
File without changes
|
{pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr_kunrunic.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr_kunrunic.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr_kunrunic.egg-info/not-zip-safe
RENAMED
|
File without changes
|
{pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr_kunrunic.egg-info/requires.txt
RENAMED
|
File without changes
|
{pkgmgr_kunrunic-0.1.1.dev5 → pkgmgr_kunrunic-0.1.1.dev7}/pkgmgr_kunrunic.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|