Skip to content

Commit 7607bde

Browse files
committed
add arch to modules.yaml
1 parent 6d4a55b commit 7607bde

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

bin/createrepo_static

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ def detect_platform():
1616
return p
1717
return None
1818

19+
def detect_arch():
20+
cwd = os.getcwd()
21+
for a in ['x86_64', 'aarch64', 'noarch']:
22+
if a in cwd:
23+
return a
24+
return None
25+
1926
def parse_rpm_info(filename):
2027
basename = os.path.basename(filename)
2128

@@ -88,7 +95,7 @@ def parse_rpm_info(filename):
8895

8996
return None
9097

91-
def build_module_structure(rpm_map, platform):
98+
def build_module_structure(rpm_map, platform, arch):
9299
documents = []
93100
timestamp = int(datetime.now(timezone.utc).strftime('%Y%m%d'))
94101

@@ -122,6 +129,7 @@ def build_module_structure(rpm_map, platform):
122129
'stream': f'static-{stream}',
123130
'version': timestamp,
124131
'context': 'local',
132+
'arch': arch,
125133
'summary': f'PHP {stream} (ZTS) packages',
126134
'description': f'PHP {stream} (ZTS) built statically - no further dependencies',
127135
'license': {
@@ -155,6 +163,7 @@ def build_defaults_document(default_stream):
155163

156164
# Detect platform
157165
platform = detect_platform() or "el10"
166+
arch = detect_arch() or "x86_64"
158167

159168
# Collect RPMs
160169
rpm_files = glob.glob("*.rpm")
@@ -168,7 +177,7 @@ for rpm in rpm_files:
168177
rpm_map[stream].append(rpm)
169178

170179
# Build modules.yaml
171-
modules_yaml = build_module_structure(rpm_map, platform)
180+
modules_yaml = build_module_structure(rpm_map, platform, arch)
172181

173182
# Determine highest stream for default (exclude "common")
174183
if rpm_map:

0 commit comments

Comments
 (0)