Summary: | find-lang uses hardcoded path patterns | ||
---|---|---|---|
Product: | Sisyphus | Reporter: | Sir Raorn <raorn> |
Component: | rpm-build | Assignee: | placeholder <placeholder> |
Status: | CLOSED FIXED | QA Contact: | qa-sisyphus |
Severity: | enhancement | ||
Priority: | P2 | CC: | arseny, glebfm, imz, ldv, placeholder, vt |
Version: | unstable | ||
Hardware: | all | ||
OS: | Linux |
Description
Sir Raorn
2003-11-06 19:00:23 MSK
Please suggest some syntax. I think simplest way is to allow packager provide his own sed rules: FindLang(){ ... if [ -n "$FIND_CUSTOM" ]; then find "$TOPDIR" -type f |sed ' s:'"$TOPDIR"':: <user-defined rules goes here> ' |grep -v '^$' >> "$OUTFILE" ||: fi ... } Maybe, different ruless for different file types (d, f, l). Example: %add_custom_find_lang 's:\(.*/share/vim/lang/\)\([^/_]\+\)\(.*vim\.mo$\):%%lang(\2) \1\2\3:' %add_custom_find_lang 's:^\([^%%].*\)::' ... %find_lang --custom %name Or maybe this way: --custom-dir-script=FILE look for directories using specified sed script; --custom-file-script=FILE look for files using specified sed script; --custom-link-script=FILE look for symlinks using specified sed script; ? Sounds reasonable. What about $NAME substitution? Oops. According to /usr/lib/rpm/find-lang from rpm-4.0.4-alt40: s/FILE/CODE/ Argument is a sed script, not file. To allow $NAME expansion following changes could be applied to FindLang(): local script ... if [ -n "$CUSTOM_XXX_SCRIPT" ]; then eval "script=\"$CUSTOM_XXX_SCRIPT\"" find "$TOPDIR" -type XXX | sed -e "s:$TOPDIR::" -e "$script" | grep -v '^$' >> "$OUTFILE" ||: Я имел в виду -f, а написал -e и не проверил... Ну так что, sed -e "s:$TOPDIR::" -f "$CUSTOM_XXX_SCRIPT" пойдёт? В принципе - да. Огорчает неиспользование $NAME, но думаю это можно решить другим способом, на уровне спекфайла. Добавлено в 4.0.4-alt40, исправлено в 4.0.4-alt42. |