Bug 434850 - Filter out OSX resources in %setup for OSX zip files
Filter out OSX resources in %setup for OSX zip files
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Panu Matilainen
Fedora Extras Quality Assurance
Depends On: 434856
Blocks: F9Target
  Show dependency treegraph
Reported: 2008-02-25 15:41 EST by Nicolas Mailhot
Modified: 2008-02-27 06:22 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-02-27 06:22:06 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Nicolas Mailhot 2008-02-25 15:41:21 EST
Description of problem:

OS X created zip files
(for example http://www.greekfontsociety.gr/GFS_NEOHELLENIC_OT.zip) include
Apple-specific metadata in an __MACOSX/ directory. Thus if such an archive is
released by a project and then packaged %setup -q will leave a stray __MACOSX/
in the rpm build dir.

This causes failures in automated rpm checker scripts Fedora people (most
notably Dave Jones) use

Please make the %setup macro filter-out these OSX-specific metadata files, as
they're totally useless in an rpm context

The gfs-neohellenic-fonts Fedora package is available as test point

Version-Release number of selected component (if applicable):

Comment 1 Nicolas Mailhot 2008-02-25 15:59:12 EST
See also bug #434856
Comment 2 Panu Matilainen 2008-02-26 03:44:16 EST
Let's see the outcome of bug 434856 first. I'm not terribly keen on adding
special handling for such a marginal case (which could easily be worked around
by just re-zipping without the OSX stuff) into rpm: just adding -x __MACOSX/* to
unzip parameters would cause needless complaining from unzip on vast majority of
archives that don't have such data, and looking at contents of a zip and
filtering some arbitrary path out if present seems far more trouble than it's
Comment 3 Panu Matilainen 2008-02-27 06:22:06 EST
Ookay... since the files are just regular files in unzip (as ingeniously created
by OSX archiver program) there's nothing here to fix: like unzip, rpm has no
business censoring the contents of archives.

It's not like rpm is holding anybody hostage to using %setup, it's there just
for convenience in the common case. When there are special needs, like the
packager knows some contents of the archive are bogus, just do it manually:

--- gfs-neohellenic-fonts.spec	17 Feb 2008 10:01:03 -0000	1.2
+++ gfs-neohellenic-fonts.spec	27 Feb 2008 11:18:48 -0000
@@ -45,7 +45,9 @@
-%setup -q -n %{archivename}
+unzip -q %{SOURCE0} -x __MACOSX/*
+cd %{archivename}
 for txt in *.txt ; do
    fold -s $txt > $txt.new
    sed -i 's/\r//' $txt.new

Note You need to log in before you can comment on or make changes to this bug.