diff --git a/bugfix-reset-defattr-when-users-want-to-keep-files-permissi.patch b/bugfix-reset-defattr-when-users-want-to-keep-files-permissi.patch deleted file mode 100644 index 861e388..0000000 --- a/bugfix-reset-defattr-when-users-want-to-keep-files-permissi.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 10ef16bc38f4b3480a60fff829df09cb6b02761b Mon Sep 17 00:00:00 2001 -From: licunlong1 -Date: Wed, 9 Mar 2022 16:40:49 +0800 -Subject: [PATCH] reset %defattr when users want to keep files permission, uid - and gid - ---- - rpmrebuild_files.sh | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/rpmrebuild_files.sh b/rpmrebuild_files.sh -index 6d0db46..fd1c75a 100755 ---- a/rpmrebuild_files.sh -+++ b/rpmrebuild_files.sh -@@ -69,6 +69,10 @@ if [ "$RPMREBUILD_CAP_FROM_FS" = "yes" ]; then - fi - fi - -+if [ "$RPMREBUILD_PUG_FROM_FS" = "yes" ]; then -+ echo "%defattr(-,-,-,-)" -+fi -+ - while :; do - read file_type - [ -z "$file_type" ] && break --- -2.33.0 - diff --git a/fix-k-may-not-keep-uid-or-gid.patch b/fix-k-may-not-keep-uid-or-gid.patch deleted file mode 100644 index 517f4de..0000000 --- a/fix-k-may-not-keep-uid-or-gid.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 7f15e07b7a94765459d51dfa315562187cc14161 Mon Sep 17 00:00:00 2001 -From: xujing -Date: Fri, 30 Sep 2022 09:19:10 +0800 -Subject: [PATCH] fix -k may not keep uid or gid - -when rpmrebuild run with -k and --change-files, some files may not keep uid or -gid. when use --change-files, remrebuild will mkdir a tmp dir and copy files to -tmp dir, and when use -k, files will be installed by %attr(-,-,-), which will -inherit permissions of tmp dir. However, --change-files only set permission. ---- - rpmrebuild_buildroot.sh | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/rpmrebuild_buildroot.sh b/rpmrebuild_buildroot.sh -index 4996e2e..00393eb 100755 ---- a/rpmrebuild_buildroot.sh -+++ b/rpmrebuild_buildroot.sh -@@ -75,6 +75,8 @@ while :; do - file_perm="${file_perm#${not_perm}}" - Mkdir_p "$BuildRoot/$file" || Critical "$MY_BASENAME Mkdir_p $BuildRoot/$file" - chmod "$file_perm" "$BuildRoot/$file" || Critical "$MY_BASENAME chmod $file_perm $BuildRoot/$file" -+ chown "$file_user" "$BuildRoot/$file" || Critical "$MY_BASENAME chown $file_user $BuildRoot/$file" -+ chgrp "$file_group" "$BuildRoot/$file" || Critical "$MY_BASENAME chgrp $file_group $BuildRoot/$file" - ;; - - *) --- -2.33.0 - diff --git a/rpmrebuild.spec b/rpmrebuild.spec index 89245d0..8ce1b71 100644 --- a/rpmrebuild.spec +++ b/rpmrebuild.spec @@ -1,11 +1,12 @@ Name: rpmrebuild Version: 2.18 -Release: 1 +Release: 2 Summary: A tool to build a rpm file from the rpm database License: GPLv2+ URL: http://rpmrebuild.sourceforge.net Source0: https://downloads.sourceforge.net/rpmrebuild/%{name}-%{version}.tar.gz +Patch9000: set-the-directory-mode-to-instead-of-omit.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -57,6 +58,9 @@ rm -rf $RPM_BUILD_ROOT%{_mandir}/fr_FR.UTF-8/man1/ %{_mandir}/fr/man1/*.gz %changelog +* Fri Feb 10 2023 dongyuzhen - 2.18-2 +- set the directory mode to '-' instead of omit + * Mon Feb 6 2023 dillon chen - 2.18-1 - upgrade version to 2.18 diff --git a/set-the-directory-mode-to-instead-of-omit.patch b/set-the-directory-mode-to-instead-of-omit.patch new file mode 100644 index 0000000..f42baa4 --- /dev/null +++ b/set-the-directory-mode-to-instead-of-omit.patch @@ -0,0 +1,27 @@ +From 8ae69fc903e45cf692fa57cf48d8b31f222c0a2c Mon Sep 17 00:00:00 2001 +From: xujing +Date: Wed, 8 Feb 2023 10:54:46 +0800 +Subject: [PATCH] Set the directory mode to '-' instead of omit + +The directory mode is not explicitly set. It should be explicitly +set to '-' ensure the accuracy of the "-k" option. +--- + rpmrebuild_files.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rpmrebuild_files.sh b/rpmrebuild_files.sh +index cf2d6be..30955c0 100755 +--- a/rpmrebuild_files.sh ++++ b/rpmrebuild_files.sh +@@ -70,7 +70,7 @@ if [ "$RPMREBUILD_CAP_FROM_FS" = "yes" ]; then + fi + + if [ "$RPMREBUILD_PUG_FROM_FS" = "yes" ]; then +- echo "%defattr(-,-,-)" ++ echo "%defattr(-,-,-,-)" + fi + + while :; do +-- +2.33.0 +