From 8559f43fe16789fd23e620fdf4c5c0ee9584cefa Mon Sep 17 00:00:00 2001 From: Eric Gerbier Date: Sun, 13 Oct 2024 11:07:26 +0200 Subject: [PATCH] bugfix : the comment-missing option can only apply on installed packages --- man/en/rpmrebuild.1.in | 1 + man/fr_FR.UTF-8/rpmrebuild.1.in | 1 + man/fr_FR/rpmrebuild.1.in | 1 + rpmrebuild_files.sh | 9 ++------- rpmrebuild_parser.src | 12 ++++++++++++ 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/man/en/rpmrebuild.1.in b/man/en/rpmrebuild.1.in index 3a590e6..8729d0e 100644 --- a/man/en/rpmrebuild.1.in +++ b/man/en/rpmrebuild.1.in @@ -31,6 +31,7 @@ set files posix capabilities as installed files .TP \fB\-c, \-\-comment\-missing\fP=<\fIyes\fP|\fIno\fP> comment out in the specfile missing files. Default: \fBno\fP. +only applies on installed rpm, not on package files .TP \fB\-D, \-\-define\fP=<\fIdefines\fP> defines to be passed to rpmbuild. diff --git a/man/fr_FR.UTF-8/rpmrebuild.1.in b/man/fr_FR.UTF-8/rpmrebuild.1.in index aeae281..a36585f 100644 --- a/man/fr_FR.UTF-8/rpmrebuild.1.in +++ b/man/fr_FR.UTF-8/rpmrebuild.1.in @@ -29,6 +29,7 @@ utiliser les capacités posix des fichiers installés .TP \fB\-c, \-\-comment\-missing\fP=<\fIyes\fP|\fIno\fP> commente les fichiers manquants dans le fichier specfile. Defaut: \fBno\fP (non). +ne s'applique qu'aux packages installés, pas aux fichiers .TP \fB\-D, \-\-define\fP=<\fIdefines\fP> définition(s) à passer au programme \fBrpmbuild\fP. diff --git a/man/fr_FR/rpmrebuild.1.in b/man/fr_FR/rpmrebuild.1.in index f8157ca..0d30327 100644 --- a/man/fr_FR/rpmrebuild.1.in +++ b/man/fr_FR/rpmrebuild.1.in @@ -29,6 +29,7 @@ utiliser les capacit .TP \fB\-c, \-\-comment\-missing\fP=<\fIyes\fP|\fIno\fP> commente les fichiers manquants dans le fichier specfile. Defaut: \fBno\fP (non). +ne s'applique qu'aux packages installÚs, pas aux fichiers .TP \fB\-D, \-\-define\fP=<\fIdefines\fP> définition(s) à passer au programme \fBrpmbuild\fP. diff --git a/rpmrebuild_files.sh b/rpmrebuild_files.sh index 4f42b44..f62a545 100755 --- a/rpmrebuild_files.sh +++ b/rpmrebuild_files.sh @@ -107,6 +107,8 @@ while :; do x*\\*) file=${file//\\/\\\\} ;; x*) ;; esac + + # COMMENT_MISSING only applies on installed rpm miss_str="" if [ "X$RPMREBUILD_COMMENT_MISSING" = "Xyes" ]; then if [ -e "$file" ]; then @@ -122,13 +124,6 @@ while :; do lang_str="" else lang_str="%lang($file_lang) " - if [ -e "$file" ]; then - miss_str="" - else - if [ ! -h "$file" ]; then - miss_str='# MISSING: ' - fi - fi fi # %dir handling diff --git a/rpmrebuild_parser.src b/rpmrebuild_parser.src index b03fa14..8b06f61 100755 --- a/rpmrebuild_parser.src +++ b/rpmrebuild_parser.src @@ -1456,6 +1456,7 @@ function CommandLineParsing ############################################################################## function CheckOptions { + # NOTESTINSTALL if [ -n "$package_install" ] then # force package test @@ -1465,6 +1466,17 @@ function CheckOptions # no test if work on files (not installed) NOTESTINSTALL="1" fi + + # RPMREBUILD_COMMENT_MISSING can not apply on rpm files + if [ -n "$package_flag" ] + then + if [ "X$RPMREBUILD_COMMENT_MISSING" = 'Xyes' ] + then + RPMREBUILD_COMMENT_MISSING='no' + Warning '(CheckOptions) COMMENT_MISSING can not be used on rpm file' + fi + fi + return 0 } ############################################################################### -- 2.46.0