Opened 10 years ago

Closed 10 years ago

#5508 closed enhancement (fixed)

[patch] AddExpanderRuleToHaikuImage

Reported by: mmadia Owned by: bonefish
Priority: normal Milestone: R1
Component: Build System Version: R1/Development
Keywords: Cc: scottmc
Blocked By: Blocking: #5155
Has a Patch: no Platform: All

Description (last modified by mmadia)

This patch creates a new rule AddExpanerRule, which allows optional packages to add one or more rules to common/etc/expander.rules

It is functional for the P7zip package and an upcoming XZ-Utils package. Tested in Haiku and FreeBSD.

common/etc/expander.rules:

"application/x-7z-compressed"	.7z	"7za l %s"	"7za x -y %s"
"application/x-xz"	.tar.xz	"xz -dc %s | tar tvf -"	"xz -dc %s | tar xvf -"
"application/x-xz"	.txz	"echo %s | sed 's/.xz$//g'"	"xz -df %s"

Attachments (2)

AddExpanderRules.patch (2.1 KB ) - added by mmadia 10 years ago.
updated per comment 6
wip-OP-XZ-Utils.patch (1.3 KB ) - added by mmadia 10 years ago.
updated to use AddExpanderRuleToHaikuImage

Download all attachments as: .zip

Change History (11)

comment:1 by mmadia, 10 years ago

Blocking: 5155 added

comment:2 by PieterPanman, 10 years ago

Is it AddExpanerRule on purpose? Or should it be AddExpanderRule? Just noticed, though I'd ask.

in reply to:  2 comment:3 by mmadia, 10 years ago

Replying to PieterPanman:

Is it AddExpanerRule on purpose? Or should it be AddExpanderRule? Just noticed, though I'd ask.

Heh... chalk that up to post-midnight coding. Luckily the typo is consistent throughout the patch.

comment:4 by PieterPanman, 10 years ago

That's why I wondered, as you were so consistent, it must have been intentional ;)

comment:5 by scottmc, 10 years ago

Cc: scottmc added

comment:6 by bonefish, 10 years ago

For sake of consistency the rule should be named AddExpanderRuleToHaikuImage. Other than that, why not simply use another delimiter character instead of '|'? E.g. '#' comes to mind, or '!'.

by mmadia, 10 years ago

Attachment: AddExpanderRules.patch added

updated per comment 6

comment:7 by mmadia, 10 years ago

Description: modified (diff)
Summary: [WIP-patch] AddExpanerRule[patch] AddExpanderRuleToHaikuImage

The patch is updated. One thing that puzzles me, in hrev34942 echo -e ... was removed as the '-e' option isn't supported on FreeBSD. Despite this, action BuildHaikuImageExpanderRules seems to work without issue.

by mmadia, 10 years ago

Attachment: wip-OP-XZ-Utils.patch added

updated to use AddExpanderRuleToHaikuImage

in reply to:  7 comment:8 by bonefish, 10 years ago

Replying to mmadia:

The patch is updated.

Looks good. Feel free to commit.

One thing that puzzles me, in hrev34942 echo -e ... was removed as the '-e' option isn't supported on FreeBSD. Despite this, action BuildHaikuImageExpanderRules seems to work without issue.

No idea what FreeBSD version or shell mmu_man was using. "-e" is indeed not POSIX, so it might not be universally available. With #5507 fixed, it should also be superfluous for this rule.

comment:9 by mmadia, 10 years ago

Resolution: fixed
Status: newclosed

Applied in hrev35720. Thanks for the help Ingo!

Note: See TracTickets for help on using tickets.