BUILD fails with error: Bad exit status from /var/tmp/rpm-tmp

While buildservice seems to successfully build rpm:

[   38s] + _target=
[   38s] + continue
[   38s] + read _file
[   38s] + test xoxygen-ionized-4.6.2 == x%1
[   38s] + mkdir -p /home/abuild/rpmbuild/BUILDROOT/oxygen-ionized-4.6.2-18.1.i386/usr/share/icons/oxygen-ionized-4.6.2
[   38s] + touch /home/abuild/rpmbuild/BUILDROOT/oxygen-ionized-4.6.2-18.1.i386/usr/share/icons/oxygen-ionized-4.6.2/icon-theme.cache
[   38s] + _target=
[   38s] + _symlinks=0
[   38s] + fdupes -q -p -n -r /home/abuild/rpmbuild/BUILDROOT/oxygen-ionized-4.6.2-18.1.i386/usr/share/icons/

Wrote: /home/abuild/rpmbuild/SRPMS/oxygen-ionized-4.6.2-18.1.src.rpm

Then it fails with /var/tmp/rpm-tmp trying to cd to non-existent dir:

[   65s] Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.kVDMDT
[   65s] + umask 022
[   65s] + cd /home/abuild/rpmbuild/BUILD
[   65s] + cd oxygen-ionized-4.6.2
[   65s] /var/tmp/rpm-tmp.kVDMDT: line 27: cd: oxygen-ionized-4.6.2: No such file or directory
[   65s] error: Bad exit status from /var/tmp/rpm-tmp.kVDMDT (%clean)

Any insights on how to fix?

Fixed spec file… it needs cleaning up…
https://paste.opensuse.org/pastes/3a8b600abbd7

I wouldn’t use the version just oxygen-ionized…

Thanks a lot!

I wouldn’t use the version just oxygen-ionize

Nor do I. But I was forced to by buildservice. Without version it breaked much earlier.

@D_E change to;

install -d 0755  %{buildroot}%{_datadir}/icons/%{name}
cp -ar oxygen-ionized-4.6.2/* %{buildroot}%{_datadir}/icons/%{name}/

Ok, will try!
Can you suggest something like “OBS getting started guide”?

@D_E these two should help;

https://en.opensuse.org/openSUSE:Build_Service_Tutorial

https://en.opensuse.org/Portal:Packaging

1 Like
install -d 0755  %{buildroot}%{_datadir}/icons/%{name}
cp -ar oxygen-ionized-4.6.2/* %{buildroot}%{_datadir}/icons/%{name}/

It doesn’t work this way:

[   40s] Provides: oxygen-ionized = 4.6.2-lp154.23.1
[   40s] Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PartialHardlinkSets) <= 4.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
[   40s] Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/abuild/rpmbuild/BUILDROOT/oxygen-ionized-4.6.2-lp154.23.1.x86_64
[   40s] error: Installed (but unpackaged) file(s) found:
[   40s]    /usr/share/icons/oxygen-ionized-4.6.2/icon-theme.cache

Add them to the Files list or delete them…

@Sauerland the spec file needs a rebuild :wink:

In fact I’ve just reuploaded project (.spec + .tar) that have been successfully built some years ago. Than on some OBS “cleanup” it was deleted. Now I’ve found it on my backup drive and thought "to revive the project I just need to reupload the files. It will take 5 min at most ". Now I’ve spent a day bashing with “now-it-doesn’t-work-anymore-the-way-it-used-to” errors.

@D_E give me a couple of hours and can have another look at it for you.

@D_E Here you go: Request 1074041: Submit oxygen-ionized - openSUSE Build Service

Thank you for all your time and efforts!
But now index.theme not included in RPM. I think I should revert to first fix made by you (BUILD fails with error: Bad exit status from /var/tmp/rpm-tmp - #2 by malcolmlewis) at least until I get some clear understanding on how things in .spec supposed to be to produce working results.
For now I have many questions unanswered. Just a few to name: if we just changed name of destination folder, where did " Installed (but unpackaged) file icon-theme.cache " came from?
Why is %{_datadir} expanded to /usr/share across .spec file, except %files section where it seems to be expanded to full build path and thus in %files section%{_datadir}==%{buildroot}%{_datadir}?

From

[   11s] + touch /home/abuild/rpmbuild/BUILDROOT/oxygen-ionized-4.6.2-27.1.x86_64/usr/share/icons/oxygen-ionized-4.6.2/icon-theme.cache

What makes you think so?

If I put %{buildroot}%{_datadir} in %files it will get expanded to

/home/abuild/rpmbuild/BUILDROOT/oxygen-ionized-4.6.2-27.1.x86_64/home/abuild/rpmbuild/BUILDROOT/oxygen-ionized-4.6.2-27.1.x86_64/usr/share/

I see it. But I don’t see any ‘touch’ command in .spec file, where it came from? And how to get rid of it?

The best guess that it comes from

#%icon_theme_cache_create_ghost oxygen-ionized-4.6.2

Macros are expanded even in comments and depending on the macro expansion only the first line is commented out. The macro definition is

%icon_theme_cache_create_ghost()                                                                   \
if test "x%1" == "x%%1"; then                                                                      \
  echo "Missing argument in call to %%icon_theme_cache_create_ghost."                              \
  false                                                                                            \
fi                                                                                                 \
mkdir -p "%{buildroot}%{_datadir}/icons/%1"                                                        \
touch "%{buildroot}%{_datadir}/icons/%1/icon-theme.cache"

so I suspect the expansion has empty first line which gets commented out. If you look at build log

[   11s] + test xoxygen-ionized-4.6.2 == x%1
[   11s] + mkdir -p /home/abuild/rpmbuild/BUILDROOT/oxygen-ionized-4.6.2-27.1.x86_64/usr/share/icons/oxygen-ionized-4.6.2
[   11s] + touch /home/abuild/rpmbuild/BUILDROOT/oxygen-ionized-4.6.2-27.1.x86_64/usr/share/icons/oxygen-ionized-4.6.2/icon-theme.cache

I still do not understand what “gets expanded to” means here. Paths in %files section are always paths on destination. During build those paths are expected to be under %(buildroot} - it is where rpmbuild looks for them.

It is the way I “debug” it: my observations of what was changed in .spec and what changed in build log )) If I change macro in %files it will “get expanded to path” in build log.

Without seeing the actual build log lines (or better the context where these lines appear), it is impossible to know what you mean.

Many thanks to all who participated! With all your help it is finally building successfully!