如何修复“警告:文件列出两次”通知?
How to fix the `warning: File listed twice` notice?
刚刚按照 https://tecadmin.net/create-rpm-of-your-own-script-in-centosredhat 上的步骤构建了我的第一个 RPM 包。一切都按照以下输出所述进行:
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.vxrO2S
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd /root/rpmbuild/BUILD
+ rm -rf mydumpadmin-1
+ /usr/bin/gzip -dc /root/rpmbuild/SOURCES/mydumpadmin-1.tgz
+ /usr/bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd mydumpadmin-1
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.B4VPI0
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd mydumpadmin-1
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.HOCtq8
+ umask 022
+ cd /root/rpmbuild/BUILD
+ '[' /root/rpmbuild/BUILDROOT/mydumpadmin-1-0.x86_64 '!=' / ']'
+ rm -rf /root/rpmbuild/BUILDROOT/mydumpadmin-1-0.x86_64
++ dirname /root/rpmbuild/BUILDROOT/mydumpadmin-1-0.x86_64
+ mkdir -p /root/rpmbuild/BUILDROOT
+ mkdir /root/rpmbuild/BUILDROOT/mydumpadmin-1-0.x86_64
+ cd mydumpadmin-1
+ install -m 0755 -d /root/rpmbuild/BUILDROOT/mydumpadmin-1-0.x86_64/etc/mydumpadmin
+ install -m 0600 credentials.txt /root/rpmbuild/BUILDROOT/mydumpadmin-1-0.x86_64/etc/mydumpadmin/credentials.txt
+ install -m 0755 mysql-dump.sh /root/rpmbuild/BUILDROOT/mydumpadmin-1-0.x86_64/etc/mydumpadmin/mysql-dump.sh
+ install -m 0644 README.md /root/rpmbuild/BUILDROOT/mydumpadmin-1-0.x86_64/etc/mydumpadmin/README.md
+ install -m 0644 settings.conf /root/rpmbuild/BUILDROOT/mydumpadmin-1-0.x86_64/etc/mydumpadmin/settings.conf
+ /usr/lib/rpm/find-debuginfo.sh --strict-build-id -m --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 /root/rpmbuild/BUILD/mydumpadmin-1
/usr/lib/rpm/sepdebugcrcfix: Updated 0 CRC32s, 0 CRC32s did match.
+ '[' noarch = noarch ']'
+ case "${QA_CHECK_RPATHS:-}" in
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1
+ /usr/lib/rpm/redhat/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-java-repack-jars
Processing files: mydumpadmin-1-0.noarch
warning: File listed twice: /etc/mydumpadmin/README.md
warning: File listed twice: /etc/mydumpadmin/credentials.txt
warning: File listed twice: /etc/mydumpadmin/mysql-dump.sh
warning: File listed twice: /etc/mydumpadmin/settings.conf
Provides: mydumpadmin = 1-0
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: /bin/bash
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/mydumpadmin-1-0.x86_64
Wrote: /root/rpmbuild/SRPMS/mydumpadmin-1-0.src.rpm
Wrote: /root/rpmbuild/RPMS/noarch/mydumpadmin-1-0.noarch.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.AhzeJw
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd mydumpadmin-1
+ /usr/bin/rm -rf /root/rpmbuild/BUILDROOT/mydumpadmin-1-0.x86_64
+ exit 0
我想去掉这部分:
warning: File listed twice: /etc/mydumpadmin/README.md
warning: File listed twice: /etc/mydumpadmin/credentials.txt
warning: File listed twice: /etc/mydumpadmin/mysql-dump.sh
warning: File listed twice: /etc/mydumpadmin/settings.conf
我想我必须更改规范文件中的某些内容,如下所示:
Name: mydumpadmin
Version: 1
Release: 0
Summary: An Advance Bash Script for MySQL Database Backup
Group: TecAdmin
BuildArch: noarch
License: GPL
URL: https://github.com/tecrahul/mydumpadmin.git
Source0: mydumpadmin-1.tgz
%description
Write some description about your package here
%prep
%setup -q
%build
%install
install -m 0755 -d $RPM_BUILD_ROOT/etc/mydumpadmin
install -m 0600 credentials.txt $RPM_BUILD_ROOT/etc/mydumpadmin/credentials.txt
install -m 0755 mysql-dump.sh $RPM_BUILD_ROOT/etc/mydumpadmin/mysql-dump.sh
install -m 0644 README.md $RPM_BUILD_ROOT/etc/mydumpadmin/README.md
install -m 0644 settings.conf $RPM_BUILD_ROOT/etc/mydumpadmin/settings.conf
%files
/etc/mydumpadmin
/etc/mydumpadmin/credentials.txt
/etc/mydumpadmin/mysql-dump.sh
/etc/mydumpadmin/README.md
/etc/mydumpadmin/settings.conf
%changelog
* Tue Oct 24 2017 Rahul Kumar 1.0.0
- Initial rpm release
但我不确定到底应该更改哪一部分,更改什么以及为什么?请耐心等待,因为这是我的第一个 RPM 包。现在阅读文档,但有时在 Whosebug 上提问比深入研究文档得到更清晰和更好的答案。
在%files
部分写下:
%files
/etc/mydumpadmin
这已经递归地打包了 /etc/mydumpadmin 文件夹。
刚刚按照 https://tecadmin.net/create-rpm-of-your-own-script-in-centosredhat 上的步骤构建了我的第一个 RPM 包。一切都按照以下输出所述进行:
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.vxrO2S
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd /root/rpmbuild/BUILD
+ rm -rf mydumpadmin-1
+ /usr/bin/gzip -dc /root/rpmbuild/SOURCES/mydumpadmin-1.tgz
+ /usr/bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd mydumpadmin-1
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.B4VPI0
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd mydumpadmin-1
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.HOCtq8
+ umask 022
+ cd /root/rpmbuild/BUILD
+ '[' /root/rpmbuild/BUILDROOT/mydumpadmin-1-0.x86_64 '!=' / ']'
+ rm -rf /root/rpmbuild/BUILDROOT/mydumpadmin-1-0.x86_64
++ dirname /root/rpmbuild/BUILDROOT/mydumpadmin-1-0.x86_64
+ mkdir -p /root/rpmbuild/BUILDROOT
+ mkdir /root/rpmbuild/BUILDROOT/mydumpadmin-1-0.x86_64
+ cd mydumpadmin-1
+ install -m 0755 -d /root/rpmbuild/BUILDROOT/mydumpadmin-1-0.x86_64/etc/mydumpadmin
+ install -m 0600 credentials.txt /root/rpmbuild/BUILDROOT/mydumpadmin-1-0.x86_64/etc/mydumpadmin/credentials.txt
+ install -m 0755 mysql-dump.sh /root/rpmbuild/BUILDROOT/mydumpadmin-1-0.x86_64/etc/mydumpadmin/mysql-dump.sh
+ install -m 0644 README.md /root/rpmbuild/BUILDROOT/mydumpadmin-1-0.x86_64/etc/mydumpadmin/README.md
+ install -m 0644 settings.conf /root/rpmbuild/BUILDROOT/mydumpadmin-1-0.x86_64/etc/mydumpadmin/settings.conf
+ /usr/lib/rpm/find-debuginfo.sh --strict-build-id -m --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 /root/rpmbuild/BUILD/mydumpadmin-1
/usr/lib/rpm/sepdebugcrcfix: Updated 0 CRC32s, 0 CRC32s did match.
+ '[' noarch = noarch ']'
+ case "${QA_CHECK_RPATHS:-}" in
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/brp-python-bytecompile /usr/bin/python 1
+ /usr/lib/rpm/redhat/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-java-repack-jars
Processing files: mydumpadmin-1-0.noarch
warning: File listed twice: /etc/mydumpadmin/README.md
warning: File listed twice: /etc/mydumpadmin/credentials.txt
warning: File listed twice: /etc/mydumpadmin/mysql-dump.sh
warning: File listed twice: /etc/mydumpadmin/settings.conf
Provides: mydumpadmin = 1-0
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: /bin/bash
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/mydumpadmin-1-0.x86_64
Wrote: /root/rpmbuild/SRPMS/mydumpadmin-1-0.src.rpm
Wrote: /root/rpmbuild/RPMS/noarch/mydumpadmin-1-0.noarch.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.AhzeJw
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd mydumpadmin-1
+ /usr/bin/rm -rf /root/rpmbuild/BUILDROOT/mydumpadmin-1-0.x86_64
+ exit 0
我想去掉这部分:
warning: File listed twice: /etc/mydumpadmin/README.md
warning: File listed twice: /etc/mydumpadmin/credentials.txt
warning: File listed twice: /etc/mydumpadmin/mysql-dump.sh
warning: File listed twice: /etc/mydumpadmin/settings.conf
我想我必须更改规范文件中的某些内容,如下所示:
Name: mydumpadmin
Version: 1
Release: 0
Summary: An Advance Bash Script for MySQL Database Backup
Group: TecAdmin
BuildArch: noarch
License: GPL
URL: https://github.com/tecrahul/mydumpadmin.git
Source0: mydumpadmin-1.tgz
%description
Write some description about your package here
%prep
%setup -q
%build
%install
install -m 0755 -d $RPM_BUILD_ROOT/etc/mydumpadmin
install -m 0600 credentials.txt $RPM_BUILD_ROOT/etc/mydumpadmin/credentials.txt
install -m 0755 mysql-dump.sh $RPM_BUILD_ROOT/etc/mydumpadmin/mysql-dump.sh
install -m 0644 README.md $RPM_BUILD_ROOT/etc/mydumpadmin/README.md
install -m 0644 settings.conf $RPM_BUILD_ROOT/etc/mydumpadmin/settings.conf
%files
/etc/mydumpadmin
/etc/mydumpadmin/credentials.txt
/etc/mydumpadmin/mysql-dump.sh
/etc/mydumpadmin/README.md
/etc/mydumpadmin/settings.conf
%changelog
* Tue Oct 24 2017 Rahul Kumar 1.0.0
- Initial rpm release
但我不确定到底应该更改哪一部分,更改什么以及为什么?请耐心等待,因为这是我的第一个 RPM 包。现在阅读文档,但有时在 Whosebug 上提问比深入研究文档得到更清晰和更好的答案。
在%files
部分写下:
%files
/etc/mydumpadmin
这已经递归地打包了 /etc/mydumpadmin 文件夹。