[Bug 747943] New: osc source validator breaks on %{nil}
https://bugzilla.novell.com/show_bug.cgi?id=747943 https://bugzilla.novell.com/show_bug.cgi?id=747943#c0 Summary: osc source validator breaks on %{nil} Classification: openSUSE Product: openSUSE 12.1 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Development AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: giecrilj@stegny.2a.pl QAContact: qa@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 When a line in a spec file starts with %{nil}, osc source validator apparently drops the rest of the file. Reproducible: Always Steps to Reproduce: 1. Run the validator on the following file: %{nil} Name: Name Version: 0.0.1 Release: 0 Summary: Summary License: GPL Actual Results: 1. error: Name field must be present in package: (main package) Expected Results: 1. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=747943 https://bugzilla.novell.com/show_bug.cgi?id=747943#c1 --- Comment #1 from Christopher Yeleighton <giecrilj@stegny.2a.pl> 2012-02-21 02:06:09 UTC --- The error is caused by /usr/lib/osc/source_validators/20-files-present-and-referenced + test '' = --verbose + test '' = --batchmode + DIR_TO_CHECK= + DESTINATIONDIR= + OSC_MODE= + test -n '' ++ pwd + DIR_TO_CHECK=/home/krzysztof/proj/home:yecril71pl/bad-nil + test -z '' -a -d /home/krzysztof/proj/home:yecril71pl/bad-nil/.osc + DESTINATIONDIR=/home/krzysztof/proj/home:yecril71pl/bad-nil/.osc + OSC_MODE=true + RETURN=0 + RPMBUILD=rpm + test -x /usr/bin/rpmbuild + RPMBUILD=rpmbuild + test '' = true ++ mktemp -d -t check_if_valid_source_dir-XXXXXX + export TMPDIR=/tmp/check_if_valid_source_dir-DsvDo9 + TMPDIR=/tmp/check_if_valid_source_dir-DsvDo9 ++ sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e 's/arm.*/arm/' -e s/sa110/arm/ ++ uname -m + MY_ARCH=x86_64 + case $MY_ARCH in + for i in '$DIR_TO_CHECK/*.spec' + test -f /home/krzysztof/proj/home:yecril71pl/bad-nil/bad-nil.spec + sed '/^#%([^)]*$/,/^[^(]*)/d /^#[^%]/d /^#%(.*)/d /^%.*%(echo.*)/{;p;d;} /^%.*%([^)]*)/{ s@%([^)]*)@1@ } /^%define/{ s@%(rpm -q.*)@1@ } /^%define/{;p;d;} /^%nil/{;p;d;} /^%global.*%(.*)/d /^%global/{;p;d;} /^%include/d /^%[a-z]*_requires/d /^%{[a-z]*_requires}/d /^%gconf_schemas_prereq/d /^%requires_eq/{;p;d;} /^%requires_ge/{;p;d;} /^%ifarch/{ s@.*@%ifarch x86_64@ } /^ExcludeArch:/d /^%error/d /^ExclusiveArch:/{ s@.*@ExclusiveArch: x86_64@ } /^BuildArch.*:/{ s@.*@BuildArch: x86_64@ } /^%if.*%{name}/{;p;d;} /^%if[^a]/{ s@.*@%if 1@ } /^%if/{;p;d;} /^%{\!/{;p;d;} /^%{?/{;p;d;} /^%{expand/d /^%error/{;p;d;} /^%else/{ s@.*@%endif\n%if 1@ } /^%nil/{;p;d;} /^%(.*)/{;d;} /^%end/{;p;d;} /^%bcond/{;p;d;} /^%{py/{;p;d;} /^%py_r/{;p;d;} /^%/{;s/.*//;q;} /^Requires:/d /^No[Ss]ource/d /^NoPatch/d /^BuildPrereq/d /^Build[Rr]equires/d /^Pre[Rr]eq/d /^Icon/d /^Recommends/d /^Supplements/d /^Suggests/d /^Enhances/d /^\([Ss]ource\|[Pp]atch\)[0-9]*:[ ]*/{ s/^\(\([Ss]ource\|[Pp]atch\)[0-9]*:[ ]*\)\(.*\)/##seen \1\3\n%{echo:\3 }/ } s/^Release:.*<RELEASE.*>/Release: 0/' /home/krzysztof/proj/home:yecril71pl/bad-nil/bad-nil.spec + sed -n 's/^Icon:[ ]*/%{echo:/ /^%{echo:/s/$/ }/p' + grep -a '^Icon:' /home/krzysztof/proj/home:yecril71pl/bad-nil/bad-nil.spec + grep -a -q '^Release' /home/krzysztof/proj/home:yecril71pl/bad-nil/bad-nil.spec ++ wc -l ++ grep -a '^%if' /tmp/check_if_valid_source_dir-DsvDo9/tmp.spec ++ wc -l ++ grep -a '^%endif' /tmp/check_if_valid_source_dir-DsvDo9/tmp.spec + test 0 -gt 0 + read line ++ grep -E '^Source:|^Source[0-9]*:|^Patch:|^Patch[0-9]*:' /home/krzysztof/proj/home:yecril71pl/bad-nil/bad-nil.spec + echo %description + for nodup in Name Version Release + sed -e 's@^Name:@XName:@' -e '0,/^XName:/{s@^XName:@Name:@}' -e 's@^XName:.*@@' /tmp/check_if_valid_source_dir-DsvDo9/tmp.spec + mv /tmp/check_if_valid_source_dir-DsvDo9/tmp.spec.2 /tmp/check_if_valid_source_dir-DsvDo9/tmp.spec + for nodup in Name Version Release + sed -e 's@^Version:@XVersion:@' -e '0,/^XVersion:/{s@^XVersion:@Version:@}' -e 's@^XVersion:.*@@' /tmp/check_if_valid_source_dir-DsvDo9/tmp.spec + mv /tmp/check_if_valid_source_dir-DsvDo9/tmp.spec.2 /tmp/check_if_valid_source_dir-DsvDo9/tmp.spec + for nodup in Name Version Release + sed -e 's@^Release:@XRelease:@' -e '0,/^XRelease:/{s@^XRelease:@Release:@}' -e 's@^XRelease:.*@@' /tmp/check_if_valid_source_dir-DsvDo9/tmp.spec + mv /tmp/check_if_valid_source_dir-DsvDo9/tmp.spec.2 /tmp/check_if_valid_source_dir-DsvDo9/tmp.spec + rpmbuild -bp /tmp/check_if_valid_source_dir-DsvDo9/tmp.spec + rpmbuild -bp /tmp/check_if_valid_source_dir-DsvDo9/tmp.spec error: Name field must be present in package: (main package) error: Version field must be present in package: (main package) error: Release field must be present in package: (main package) error: Summary field must be present in package: (main package) error: License field must be present in package: (main package) + cleanup_and_exit 1 + rm -rf /tmp/check_if_valid_source_dir-DsvDo9 + exit 1 This pattern is probably the culprit: /^%/{;s/.*//;q;} It means: upon seeing an opening macro not processed earier, delete the current line and quit. Author: what did you have in mind? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=747943 https://bugzilla.novell.com/show_bug.cgi?id=747943#c2 --- Comment #2 from Christopher Yeleighton <giecrilj@stegny.2a.pl> 2012-02-21 02:12:44 UTC --- Oh, you probably wanted to quit on %description? But then you should allow /^%{/, would you? The same thing happens if you replace %{nil} with %{echo:nil}. The only workaround is to say { osc build --noservice; } at present. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=747943 https://bugzilla.novell.com/show_bug.cgi?id=747943#c3 Marcus Meissner <meissner@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|Final |osc Component|Development |osc AssignedTo|bnc-team-screening@forge.pr |adrian@suse.com |ovo.novell.com | QAContact|qa@suse.de |adrian@suse.com Target Milestone|--- |master Product|openSUSE 12.1 |openSUSE Build Service --- Comment #3 from Marcus Meissner <meissner@suse.com> 2012-02-22 10:57:20 UTC --- move to better product ... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=747943 https://bugzilla.novell.com/show_bug.cgi?id=747943#c Adrian Schröter <adrian@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|adrian@suse.com |ro@suse.com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=747943 https://bugzilla.novell.com/show_bug.cgi?id=747943#c4 Ruediger Oertel <ro@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #4 from Ruediger Oertel <ro@suse.com> 2012-06-13 13:02:53 UTC --- no, the idea was really to abort parsing on anything unknown and just use what was seen up to that point (hoping we've seen all the Source: and Patch: lines up to that point and have enough of the other mandatory fields so rpm can process what we got until then). allowing %{nil}, just as we're doing with %nil -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com