public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Filipe Rosset <rosset.filipe@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/adb-enhanced] rawhide: move the classpath manipulation logic from spec to cleaner patch and sh files
Date: Mon, 27 Jul 2026 16:21:51 GMT	[thread overview]
Message-ID: <178516931159.1.189692798638025435.rpms-adb-enhanced-2cad5f6b91bf@fedoraproject.org> (raw)

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

                 reply	other threads:[~2026-07-27 16:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178516931159.1.189692798638025435.rpms-adb-enhanced-2cad5f6b91bf@fedoraproject.org \
    --to=rosset.filipe@gmail.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox