Skip to content
Snippets Groups Projects
Verified Commit ce8b7e8d authored by Michal Vasilek's avatar Michal Vasilek
Browse files

patches/openwrt: drop patch to fix removing dirs

This patch doesn't seem to work as it should and randomly includes
directories in the file list which makes some installations print a
warning:

    %: opkg install xinetd
    //usr/lib/opkg/info/xinetd.postinst: line 261: /etc/init.d/: Permission denied
parent 34e16471
Branches
Tags
1 merge request!555patches/openwrt: fix Permission denied warning
Pipeline #103977 passed with stage
in 5 minutes and 48 seconds
From 657d7dcdd695178bf5b38a7cc8032460975b983d Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal.vasilek@nic.cz>
Date: Thu, 19 May 2022 16:49:01 +0200
Subject: [PATCH] opkg: import a patch to fix removing directories
---
package/system/opkg/Makefile | 2 +-
package/system/opkg/patches/empty-dirs.patch | 37 ++++++++++++++++++++
2 files changed, 38 insertions(+), 1 deletion(-)
create mode 100644 package/system/opkg/patches/empty-dirs.patch
diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile
index ee402b0a2e..d8bb663499 100644
--- a/package/system/opkg/Makefile
+++ b/package/system/opkg/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=opkg
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_FLAGS:=essential
PKG_SOURCE_PROTO:=git
diff --git a/package/system/opkg/patches/empty-dirs.patch b/package/system/opkg/patches/empty-dirs.patch
new file mode 100644
index 0000000000..ef1d1fb68b
--- /dev/null
+++ b/package/system/opkg/patches/empty-dirs.patch
@@ -0,0 +1,37 @@
+From 28efcf36b5c3e5a04473dce0834d7bada584bf49 Mon Sep 17 00:00:00 2001
+From: Michal Vasilek <michal.vasilek@nic.cz>
+Date: Fri, 6 May 2022 14:39:43 +0200
+Subject: [PATCH] Don't filter out directories when claiming ownership of a file.
+
+Directories are now owned by a particular package, which ensures their
+deletion in the event that a package leaves an empty directory during package
+removal.
+
+From Roman Khimov <khimov@altell.ru>.
+
+git-svn-id: http://opkg.googlecode.com/svn/trunk@624 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
+
+Backported from: https://git.yoctoproject.org/opkg/commit/?h=opkg-0.2.x&id=3d697f6303f381a507f37f8d63129151d745dc6c
+Fixes: https://github.com/openwrt/openwrt/issues/7519
+
+[add link to an openwrt issue and to the original commit from
+yoctoproject]
+Signed-off-by: Michal Vasilek <michal.vasilek@nic.cz>
+
+---
+ libopkg/pkg_hash.c | 4 ----
+ 1 file changed, 4 deletions(-)
+
+--- a/libopkg/pkg_hash.c
++++ b/libopkg/pkg_hash.c
+@@ -755,10 +755,6 @@ pkg_t *file_hash_get_file_owner(const ch
+ void file_hash_set_file_owner(const char *file_name, pkg_t * owning_pkg)
+ {
+ pkg_t *old_owning_pkg;
+- int file_name_len = strlen(file_name);
+-
+- if (file_name[file_name_len - 1] == '/')
+- return;
+
+ file_name = strip_offline_root(file_name);
+
--
2.36.1
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment