Use GIO's shared-mime-info backend for native package acceptance while retaining headless xdg-mime output as a diagnostic; xdg-mime falls back to file(1) when no desktop session exists.
- commit
- 87db9b59f7074e198130dfed00ef221937140e2e
- parent
- 20ef01830e47b4bf915ed97e6d8959424b3acb27
- author
- Dami <dami.etoile@gmail.com>
| M | scripts/ | 10 | ++++++++-- |
| M | tests/ | 2 | +- |
@@ -35,8 +35,14 @@ go run "$root/cmd/atlas" build -cache "$stage/cache" -bundles "$stage/source" \
3535 "$root/examples/sample-region.atlas-project"3636 artifact=$(find "$stage/source" -maxdepth 1 -type f -name 'sample-region-*.atlas' -print -quit)3737 test -n "$artifact"38-file_type=$(xdg-mime query filetype "$artifact")39-echo "installed Atlas MIME type: $file_type"38+xdg_type=$(xdg-mime query filetype "$artifact" || true)39+echo "headless xdg-mime diagnostic: $xdg_type"40+# xdg-mime selects its backend from the desktop session and falls back to the41+# file(1) database on a headless runner, which cannot see a package's42+# shared-mime-info additions. GIO is the desktop stack this package registers.43+file_type=$(gio info --attributes=standard::content-type "$artifact" \44+ | sed -n 's/^ standard::content-type: //p')45+echo "installed Atlas GIO MIME type: $file_type"4046 [[ "$file_type" == application/vnd.felinestatemachine.atlas ]] || {4147 echo "unexpected Atlas MIME type: $file_type" >&24248 exit 1@@ -95,7 +95,7 @@ class NativePackagingTest(unittest.TestCase):
9595 self.assertIn("application/vnd.felinestatemachine.atlas", windows_smoke)9696 linux_smoke = (ROOT / "scripts/release/smoke-linux.sh").read_text()9797 self.assertIn("dpkg-query", linux_smoke)98- self.assertIn("xdg-mime query filetype", linux_smoke)98+ self.assertIn("gio info --attributes=standard::content-type", linux_smoke)9999 self.assertIn("ATLAS_BUNDLES_DIR", linux_smoke)100100 mac_smoke = (ROOT / "scripts/release/smoke-macos.sh").read_text()101101 self.assertIn("codesign --verify --deep --strict", mac_smoke)