Bug 434850 - Filter out OSX resources in %setup for OSX zip files
Summary: Filter out OSX resources in %setup for OSX zip files
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Panu Matilainen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 434856
Blocks: F9Target
TreeView+ depends on / blocked
 
Reported: 2008-02-25 20:41 UTC by Nicolas Mailhot
Modified: 2008-02-27 11:22 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-02-27 11:22:06 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Nicolas Mailhot 2008-02-25 20:41:21 UTC
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):

rpm-4.4.2.3-0.2.rc1.x86_64

Comment 1 Nicolas Mailhot 2008-02-25 20:59:12 UTC
See also bug #434856

Comment 2 Panu Matilainen 2008-02-26 08:44:16 UTC
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
worth...

Comment 3 Panu Matilainen 2008-02-27 11:22:06 UTC
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 @@
 
 
 %prep
-%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.