public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/adb-enhanced] rawhide: move the classpath manipulation logic from spec to cleaner patch and sh files
@ 2026-07-27 16:21 Filipe Rosset
0 siblings, 0 replies; only message in thread
From: Filipe Rosset @ 2026-07-27 16:21 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/adb-enhanced
Branch : rawhide
Commit : 2cad5f6b91bf3305b585d616975f797197937fe1
Author : Filipe Rosset <rosset.filipe@gmail.com>
Date : 2026-07-27T13:16:07-03:00
Stats : +42/-16 in 3 file(s)
URL : https://src.fedoraproject.org/rpms/adb-enhanced/c/2cad5f6b91bf3305b585d616975f797197937fe1?branch=rawhide
Log:
move the classpath manipulation logic from spec to cleaner patch and sh files
---
diff --git a/adb-enhanced.spec b/adb-enhanced.spec
index 6f08e9e..5d62268 100644
--- a/adb-enhanced.spec
+++ b/adb-enhanced.spec
@@ -6,7 +6,9 @@ Release: %autorelease
Summary: Tool for Android testing and development
License: Apache-2.0
URL: https://github.com/ashishb/adb-enhanced
-Source: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
+Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
+Source1: remove-classpath.sh
+Patch0: remove-classpath-manifest.patch
BuildArch: noarch
BuildRequires: python3-devel
@@ -20,7 +22,7 @@ command-line interface to trigger various scenarios like screen rotation,
battery saver mode, data saver mode, doze mode, permission grant/revocation.
%prep
-%autosetup
+%autosetup -N
# Relax strict dependency pins (==) to >= to avoid build failures with newer system libraries
sed -i 's/==/>=/g' pyproject.toml
@@ -35,20 +37,8 @@ EOF
# Remove shebang from python libraries that are not directly executed
sed -i -e '1{\@^#!/usr/bin/env python@d}' adbe/adb_enhanced.py adbe/main.py
-# Remove Class-Path entry from the prebuilt jar manifest to silence rpmlint warning
-python3 -c "
-import zipfile, os
-jar_path = 'adbe/abe.jar'
-with zipfile.ZipFile(jar_path, 'r') as z_in:
- with zipfile.ZipFile(jar_path + '.new', 'w') as z_out:
- for item in z_in.infolist():
- data = z_in.read(item.filename)
- if item.filename == 'META-INF/MANIFEST.MF':
- lines = [line for line in data.decode('utf-8').splitlines() if not line.startswith('Class-Path:')]
- data = '\n'.join(lines).encode('utf-8') + b'\n'
- z_out.writestr(item, data)
-os.replace(jar_path + '.new', jar_path)
-"
+# Remove Class-Path entry from the prebuilt jar manifest
+bash %{SOURCE1} %{PATCH0}
diff --git a/remove-classpath-manifest.patch b/remove-classpath-manifest.patch
new file mode 100644
index 0000000..55b3e9c
--- /dev/null
+++ b/remove-classpath-manifest.patch
@@ -0,0 +1,8 @@
+--- a/adbe/META-INF/MANIFEST.MF
++++ b/adbe/META-INF/MANIFEST.MF
+@@ -1,5 +1,4 @@
+ Manifest-Version: 1.0
+ Rsrc-Class-Path: ./ junit.jar
+-Class-Path: .
+ Rsrc-Main-Class: org.nick.abe.Main
+ Main-Class: org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader
diff --git a/remove-classpath.sh b/remove-classpath.sh
new file mode 100755
index 0000000..d28fedf
--- /dev/null
+++ b/remove-classpath.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+set -euo pipefail
+
+ACTION="${1:-}"
+
+if [ "$ACTION" = "--extract" ]; then
+ python3 -c "
+import zipfile, os
+with zipfile.ZipFile('adbe/abe.jar') as z:
+ content = z.read('META-INF/MANIFEST.MF').replace(b'\r\n', b'\n')
+os.makedirs('adbe/META-INF', exist_ok=True)
+open('adbe/META-INF/MANIFEST.MF', 'wb').write(content)
+"
+elif [ "$ACTION" = "--repack" ]; then
+ python3 -c "
+import zipfile, os
+jar_path = 'adbe/abe.jar'
+manifest_path = 'adbe/META-INF/MANIFEST.MF'
+with zipfile.ZipFile(jar_path, 'r') as z_in, zipfile.ZipFile(jar_path + '.new', 'w') as z_out:
+ for item in z_in.infolist():
+ if item.filename == 'META-INF/MANIFEST.MF':
+ z_out.write(manifest_path, item.filename)
+ else:
+ z_out.writestr(item, z_in.read(item.filename))
+os.replace(jar_path + '.new', jar_path)
+"
+ rm -rf adbe/META-INF
+fi
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-07-27 16:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-27 16:21 [rpms/adb-enhanced] rawhide: move the classpath manipulation logic from spec to cleaner patch and sh files Filipe Rosset
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox