Mailinglist Archive: opensuse-packaging (205 mails)
| < Previous | Next > |
Re: [opensuse-packaging] Specfile Guidelines sweep over Factory
- From: Ruediger Oertel <ro@xxxxxxx>
- Date: Wed, 21 Sep 2011 14:03:33 +0200
- Message-id: <1633007.RoU8U6ejjI@fatou>
On Tuesday 20 September 2011 22:51:16 Jan Engelhardt wrote:
well, this way you would make probably 80+ % of the specfiles in factory fail
to pass the normal checks. Wouln'd it make more sense for at least the
one-liner things below to fix it automatically in the spec-file formatter ?
I'm simply afraid if we make all packages fail this way, developers will
simply be annoyed and start ignoring/workarounding these checks
instead of just fixing the specfile (which we could do automatically
anyway).
I'm completely fine with such a script for the more questionable places
like the "Authors" or "jobs" tasks, but on the other hand if we don't plan
to fail these, I guess this could just as well live inside rpmlint, AFAIR it has
some tests that run on the specfile anyway.
with kind regards (mit freundlichem Grinsen),
Ruediger Oertel (ro@xxxxxxxx,ro@xxxxxxx,bugfinder@xxxxxxxxxxx)
GPG Key fingerprint = 17DC 6553 86A7 384B 53C5 CA5C 3CE4 F2E7 23F2 B417
--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-packaging+help@xxxxxxxxxxxx
On Tuesday 2011-09-20 13:37, Stephan Kulow wrote:
Well, the simple things should be integrated into the format_spec thingy -
either based on the current perl script or a stripped down spec-cleaner.
That should work..
well, this way you would make probably 80+ % of the specfiles in factory fail
to pass the normal checks. Wouln'd it make more sense for at least the
one-liner things below to fix it automatically in the spec-file formatter ?
I'm simply afraid if we make all packages fail this way, developers will
simply be annoyed and start ignoring/workarounding these checks
instead of just fixing the specfile (which we could do automatically
anyway).
I'm completely fine with such a script for the more questionable places
like the "Authors" or "jobs" tasks, but on the other hand if we don't plan
to fail these, I guess this could just as well live inside rpmlint, AFAIR it has
some tests that run on the specfile anyway.
--
## /usr/lib/osc/source_validators/10-the-way-of-the-dodo
#!/bin/bash
DIR_TO_CHECK="$1"
if [[ -z "$DIR_TO_CHECK" ]]; then
DIR_TO_CHECK="$PWD";
fi;
for i in "$DIR_TO_CHECK"/*.spec; do
if [[ ! -f "$i" ]]; then
continue;
fi;
if pcregrep -iq '^autoreqprov\s*:\s*(?!off)(?!no)' "$i"; then
echo "*** $i: Undesired AutoReqProv tag";
fail=1;
fi;
if pcregrep -iq '^#\*snorootforbuild' "$i"; then
echo "*** $i: Undesired norootforbuild tag";
fail=1;
fi;
if pcregrep -iq '^#\*suseforbuild' "$i"; then
echo "*** $i: Undesired useforbuild tag";
fail=1;
fi;
if pcregrep -iq '^Author(\(?s\))?:?' "$i"; then
echo "*** $i: Author list no longer desired";
# don't fail, could be false positive
fi;
if pcregrep -q '^%clean\b' "$i"; then
echo "*** $i: %clean section no longer required";
fail=1;
fi;
if pcregrep -q '%{\?jobs:\s*-j\s*%{?jobs}?}' "$i"; then
echo "*** $i: Consider replacing %{?jobs:-j%jobs} by
%{?_smp_mflags} if possible.";
# Don't fail; things like scons can also be told the number of
# jobs, but naturally, scons does not know make's other options.
fi;
done;
if [[ "$fail" -ne "" ]]; then
echo "*** Please see
http://en.opensuse.org/openSUSE:Specfile_guidelines for details.";
exit 1;
fi;
with kind regards (mit freundlichem Grinsen),
Ruediger Oertel (ro@xxxxxxxx,ro@xxxxxxx,bugfinder@xxxxxxxxxxx)
GPG Key fingerprint = 17DC 6553 86A7 384B 53C5 CA5C 3CE4 F2E7 23F2 B417
--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-packaging+help@xxxxxxxxxxxx
| < Previous | Next > |