Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 569918 - general: stronger ebuild QA when sed usage with s/ syntax
Summary: general: stronger ebuild QA when sed usage with s/ syntax
Status: UNCONFIRMED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: PkgCore (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: PkgCore project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-27 16:18 UTC by and
Modified: 2022-10-20 02:02 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description and 2015-12-27 16:18:43 UTC
Hi,
several ebuild using sed syntax like

sed -e "s/gcc/$(tc-getCC)/"

which can lead into an error if tc-getCC function return string containing slash.

1) ban sed using slash syntax in ebuild
2) inform ebuild maintainer in QA check


Reproducible: Always

Steps to Reproduce:
one example
build www-client/w3m with AR=/usr/bin/ar env

Actual Results:  
will result into an error at
sed -i -e "/^AR=/s/ar/$(tc-getAR)/" {.,w3mimg,libwc}/Makefile.in || die

because sed syntax get broken


Expected Results:  
no ebuild public commit with weak sed s/ usage


# find /usr/portage/ -type f -name '*.ebuild' -exec grep -H 'sed .*s/.*$(tc' {} \;

/usr/portage/app-admin/paxtest/paxtest-0.9.14.ebuild:   sed -i "s/^CC := gcc/CC := $(tc-getCC)/" Makefile
/usr/portage/app-admin/paxtest/paxtest-0.9.14.ebuild:   sed -i "s/^LD := ld/LD := $(tc-getLD)/" Makefile
/usr/portage/app-benchmarks/contest/contest-0.61.ebuild:        sed -i -e "/^CC/s/gcc/$(tc-getCC)/" Makefile
/usr/portage/app-crypt/mit-krb5-appl/mit-krb5-appl-1.0.3.ebuild:        sed -i -e "s/-lncurses/$($(tc-getPKG_CONFIG) --libs ncurses)/" configure.ac
/usr/portage/app-crypt/pkcrack/pkcrack-1.2.2-r1.ebuild: sed -i -e "s/^CC=.*/CC=$(tc-getCC)/" \
/usr/portage/app-crypt/pkcrack/pkcrack-1.2.2.ebuild:    sed -i -e "s/^CC=.*/CC=$(tc-getCC)/" \
/usr/portage/app-i18n/mozc/mozc-2.16.2037.102.ebuild:   sed -i -e "s/<!(which clang)/$(tc-getCC)/" \
/usr/portage/app-misc/worker/worker-2.19.6.ebuild:      sed -i -e "/AR/s/ar/$(tc-getAR)/" src/aguix/Makefile.in || die 'sed on Makefile.in failed'
/usr/portage/app-text/rnv/rnv-1.7.11-r1.ebuild: sed -i -e "/^AR/s/ar/$(tc-getAR)/" Makefile.in || die 'sed on Makefile.in failed'
/usr/portage/app-text/rnv/rnv-1.7.11.ebuild:    sed -i -e "/^AR/s/ar/$(tc-getAR)/" Makefile.in || die 'sed on Makefile.in failed'
/usr/portage/app-text/yodl/yodl-3.04.00.ebuild: sed -e "s/ar ru/$(tc-getAR) ru/" \
/usr/portage/app-text/yodl/yodl-3.05.00.ebuild: sed -e "s/ar ru/$(tc-getAR) ru/" \
/usr/portage/app-text/yodl/yodl-3.05.01.ebuild: sed -e "s/ar ru/$(tc-getAR) ru/" \
/usr/portage/dev-db/lmdb/lmdb-0.9.14.ebuild:    sed -i -e "s/^CC.*/CC = $(tc-getCC)/" \
/usr/portage/dev-db/lmdb/lmdb-0.9.15.ebuild:    sed -i -e "s/^CC.*/CC = $(tc-getCC)/" \
/usr/portage/dev-db/lmdb/lmdb-0.9.16.ebuild:    sed -i -e "s/^CC.*/CC = $(tc-getCC)/" \
/usr/portage/dev-db/lmdb/lmdb-0.9.17.ebuild:    sed -i -e "s/^CC.*/CC = $(tc-getCC)/" \
/usr/portage/dev-embedded/scratchbox2/scratchbox2-2.0-r1.ebuild:        sed -e "s/^\(CC = \).*/\1$(tc-getCC)/" \
/usr/portage/dev-libs/cyrus-imap-dev/cyrus-imap-dev-2.4.17-r1.ebuild:   sed -i -e "s/ar cr/$(tc-getAR) cr/" \
/usr/portage/dev-libs/cyrus-imap-dev/cyrus-imap-dev-2.4.17.ebuild:      sed -i -e "s/ar cr/$(tc-getAR) cr/" \
/usr/portage/dev-libs/libf2c/libf2c-20110801-r4.ebuild: sed -i -e "s/ld /$(tc-getLD) /" makefile.u || die
/usr/portage/dev-libs/libf2c/libf2c-20130927.ebuild:    sed -i -e "s/ld /$(tc-getLD) /" makefile.u || die
/usr/portage/mail-filter/policyd/policyd-1.82-r1.ebuild:        sed -i -e "s/gcc/$(tc-getCC)/" Makefile
/usr/portage/mail-filter/policyd/policyd-1.82-r2.ebuild:        sed -i -e "s/gcc/$(tc-getCC)/" Makefile
/usr/portage/mail-mta/postfix/postfix-2.10.9.ebuild:    sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
/usr/portage/mail-mta/postfix/postfix-2.10.9.ebuild:    sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
/usr/portage/mail-mta/postfix/postfix-2.11.7.ebuild:    sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
/usr/portage/mail-mta/postfix/postfix-2.11.7.ebuild:    sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
/usr/portage/mail-mta/postfix/postfix-3.0.2-r1.ebuild:  sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
/usr/portage/mail-mta/postfix/postfix-3.0.2-r1.ebuild:  sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
/usr/portage/mail-mta/postfix/postfix-3.0.2-r2.ebuild:  sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
/usr/portage/mail-mta/postfix/postfix-3.0.2-r2.ebuild:  sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
/usr/portage/mail-mta/postfix/postfix-3.0.2.ebuild:     sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
/usr/portage/mail-mta/postfix/postfix-3.0.2.ebuild:     sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
/usr/portage/mail-mta/postfix/postfix-3.0.3-r1.ebuild:  sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
/usr/portage/mail-mta/postfix/postfix-3.0.3-r1.ebuild:  sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
/usr/portage/mail-mta/postfix/postfix-3.0.3.ebuild:     sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
/usr/portage/mail-mta/postfix/postfix-3.0.3.ebuild:     sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
/usr/portage/mail-mta/postfix/postfix-3.1_pre20151218.ebuild:   sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
/usr/portage/mail-mta/postfix/postfix-3.1_pre20151218.ebuild:   sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
/usr/portage/media-radio/qrq/qrq-0.3.1.ebuild:  sed -i -e "s/CC=gcc/CC=$(tc-getCC)/" Makefile || die
/usr/portage/media-sound/aeolus/aeolus-0.8.1.ebuild:    sed -i -e "s/g++/$(tc-getCXX)/" Makefile || die "Failed to set correct compiler"
/usr/portage/media-sound/aeolus/aeolus-0.8.4.ebuild:    sed -i -e "s/g++/$(tc-getCXX)/" Makefile || die "Failed to set correct compiler"
/usr/portage/media-sound/aeolus/aeolus-0.9.0.ebuild:    sed -i -e "s/g++/$(tc-getCXX)/" Makefile || die "Failed to set correct compiler"
/usr/portage/media-sound/aeolus/aeolus-0.9.0.ebuild:    sed -i -e "s/-lXft/`$(tc-getPKG_CONFIG) --libs xft`/" Makefile || die
/usr/portage/media-sound/lilypond/lilypond-2.18.2-r1.ebuild:    sed -i "s/^AR=ar/AR=$(tc-getAR)/" stepmake/stepmake/library-vars.make || die
/usr/portage/media-sound/lilypond/lilypond-2.18.2.ebuild:       sed -i "s/^AR=ar/AR=$(tc-getAR)/" stepmake/stepmake/library-vars.make || die
/usr/portage/media-sound/lilypond/lilypond-2.19.15.ebuild:      sed -i "s/^AR=ar/AR=$(tc-getAR)/" stepmake/stepmake/library-vars.make || die
/usr/portage/media-sound/lilypond/lilypond-9999.ebuild: sed -i "s/^AR=ar/AR=$(tc-getAR)/" stepmake/stepmake/library-vars.make || die
/usr/portage/net-libs/c-client/c-client-2007f-r4.ebuild:        sed -e "s/CC=cc/CC=$(tc-getCC)/" \
/usr/portage/net-mail/cyrus-imap-admin/cyrus-imap-admin-2.4.17-r1.ebuild:       sed -i -e "s/ar cr/$(tc-getAR) cr/" \
/usr/portage/net-mail/cyrus-imap-admin/cyrus-imap-admin-2.4.18.ebuild:  sed -i -e "s/ar cr/$(tc-getAR) cr/" \
/usr/portage/net-mail/cyrus-imapd/cyrus-imapd-2.4.17-r1.ebuild: sed -i -e "s/ar cr/$(tc-getAR) cr/" \
/usr/portage/net-mail/cyrus-imapd/cyrus-imapd-2.4.17.ebuild:    sed -i -e "s/ar cr/$(tc-getAR) cr/" \
/usr/portage/net-mail/cyrus-imapd/cyrus-imapd-2.4.18.ebuild:    sed -i -e "s/ar cr/$(tc-getAR) cr/" \
/usr/portage/net-mail/metamail/metamail-2.7.53.3-r1.ebuild:     sed -i -e "s/-lncurses/$($(tc-getPKG_CONFIG) --libs ncurses)/" \
/usr/portage/net-p2p/mktorrent-borg/mktorrent-borg-0.9.9.ebuild:        sed -i -e "s/CC=gcc/CC=$(tc-getCC)/g" \
/usr/portage/sci-biology/ariadne/ariadne-1.3-r1.ebuild: sed -e "s/CC = gcc/CC = $(tc-getCC)/" \
/usr/portage/sci-biology/elph/elph-0.1.5.ebuild:        sed -i -e "s/CC      := g++/CC      := $(tc-getCXX)/" \
/usr/portage/sci-biology/rnaview/rnaview-20040713.ebuild:       sed -e "s/CC        = cc/CC        = $(tc-getCC)/" \
/usr/portage/sci-biology/wgs-assembler/wgs-assembler-5.4.ebuild:        sed -i -e "s/CC *= *gcc/CC = $(tc-getCC)/" \
/usr/portage/sci-biology/wgs-assembler/wgs-assembler-5.4.ebuild:        sed -i -e "s/CC *:=.*/CC := $(tc-getCC)/" \
/usr/portage/sci-biology/wgs-assembler/wgs-assembler-6.1.ebuild:        sed -i -e "s/CC *= *gcc/CC = $(tc-getCC)/" \
/usr/portage/sci-biology/wgs-assembler/wgs-assembler-6.1.ebuild:        sed -i -e "s/CC *:=.*/CC := $(tc-getCC)/" \
/usr/portage/sci-biology/wgs-assembler/wgs-assembler-7.0.ebuild:        sed -i -e "s/CC *= *gcc/CC = $(tc-getCC)/" \
/usr/portage/sci-biology/wgs-assembler/wgs-assembler-7.0.ebuild:        sed -i -e "s/CC *:=.*/CC := $(tc-getCC)/" \
/usr/portage/sci-chemistry/gamess/gamess-20110811.1.ebuild:     sed -e "s/gentoo-CC = 'gcc'/CC = '$(tc-getCC)'/" \
/usr/portage/sci-libs/lrslib/lrslib-042c-r1.ebuild:     sed -i "s/gcc/$(tc-getCC)/g" makefile || die
/usr/portage/sci-libs/lrslib/lrslib-042c-r2.ebuild:     sed -i "s/gcc/$(tc-getCC)/g" makefile || die
/usr/portage/sci-libs/lrslib/lrslib-051.ebuild: sed -i "s/gcc/$(tc-getCC)/g" makefile || die
/usr/portage/sci-libs/scotch/scotch-5.1.12b.ebuild:     sed -e "s/gcc/$(tc-getCC)/" \
/usr/portage/sci-libs/scotch/scotch-6.0.0.ebuild:       sed -e "s/gcc/$(tc-getCC)/" \
/usr/portage/sci-libs/scotch/scotch-6.0.4.ebuild:       sed -e "s/gcc/$(tc-getCC)/" \
/usr/portage/sci-libs/spooles/spooles-2.2.ebuild:       sed -e "s/@CC@/$(tc-getCC)/" \
/usr/portage/sci-mathematics/bertini/bertini-1.4.ebuild:        sed -i -e "s/gcc/$(tc-getCC)/" Makefile
/usr/portage/www-apache/passenger/passenger-4.0.60.ebuild:      sed -i -e "s/gcc/$(tc-getCC)/" \
/usr/portage/www-apache/passenger/passenger-4.0.60.ebuild:      sed -i -e "s/ar cru/"$(tc-getAR)" cru/" build/cplusplus_support.rb || die
/usr/portage/www-apache/passenger/passenger-5.0.22.ebuild:      sed -i -e "/^CC/ s/=.*$/= '$(tc-getCC)'/" \
/usr/portage/www-apache/passenger/passenger-5.0.22.ebuild:      sed -i -e "s/ar cru/"$(tc-getAR)" cru/" build/cplusplus_support.rb || die
/usr/portage/www-apache/passenger/passenger-5.0.23.ebuild:      sed -i -e "/^CC/ s/=.*$/= '$(tc-getCC)'/" \
/usr/portage/www-apache/passenger/passenger-5.0.23.ebuild:      sed -i -e "s/ar cru/"$(tc-getAR)" cru/" build/cplusplus_support.rb || die
/usr/portage/www-client/w3m/w3m-0.5.3-r5.ebuild:        sed -i -e "/^AR=/s/ar/$(tc-getAR)/" {.,w3mimg,libwc}/Makefile.in || die
Comment 1 and 2015-12-27 16:46:24 UTC
reduced list of examples
# grep 'sed .*s/.*$(tc' */*/*.ebuild | sed -e 's|[0-9\.abcr\-]*(\.ebuild\)|*\1|' | sort -u 

app-admin/paxtest/paxtest*.ebuild:      sed -i "s/^CC := gcc/CC := $(tc-getCC)/" Makefile
app-admin/paxtest/paxtest*.ebuild:      sed -i "s/^LD := ld/LD := $(tc-getLD)/" Makefile
app-benchmarks/contest/contest*.ebuild: sed -i -e "/^CC/s/gcc/$(tc-getCC)/" Makefile
app-crypt/mit-krb5-appl/mit-krb5-appl*.ebuild:  sed -i -e "s/-lncurses/$($(tc-getPKG_CONFIG) --libs ncurses)/" configure.ac
app-crypt/pkcrack/pkcrack*.ebuild:      sed -i -e "s/^CC=.*/CC=$(tc-getCC)/" \
app-i18n/mozc/moz*.ebuild:      sed -i -e "s/<!(which clang)/$(tc-getCC)/" \
app-misc/worker/worke*.ebuild:  sed -i -e "/AR/s/ar/$(tc-getAR)/" src/aguix/Makefile.in || die 'sed on Makefile.in failed'
app-text/rnv/rnv*.ebuild:       sed -i -e "/^AR/s/ar/$(tc-getAR)/" Makefile.in || die 'sed on Makefile.in failed'
app-text/yodl/yodl*.ebuild:     sed -e "s/ar ru/$(tc-getAR) ru/" \
dev-db/lmdb/lmd*.ebuild:        sed -i -e "s/^CC.*/CC = $(tc-getCC)/" \
dev-embedded/scratchbox2/scratchbox*.ebuild:    sed -e "s/^\(CC = \).*/\1$(tc-getCC)/" \
dev-libs/cyrus-imap-dev/cyrus-imap-dev*.ebuild: sed -i -e "s/ar cr/$(tc-getAR) cr/" \
dev-libs/libf2c/libf*.ebuild:   sed -i -e "s/ld /$(tc-getLD) /" makefile.u || die
mail-filter/policyd/policyd*.ebuild:    sed -i -e "s/gcc/$(tc-getCC)/" Makefile
mail-mta/postfix/postfix-3.1_pre*.ebuild:       sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
mail-mta/postfix/postfix-3.1_pre*.ebuild:       sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
mail-mta/postfix/postfix*.ebuild:       sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
mail-mta/postfix/postfix*.ebuild:       sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
media-radio/qrq/qrq*.ebuild:    sed -i -e "s/CC=gcc/CC=$(tc-getCC)/" Makefile || die
media-sound/aeolus/aeolus*.ebuild:      sed -i -e "s/g++/$(tc-getCXX)/" Makefile || die "Failed to set correct compiler"
media-sound/aeolus/aeolus*.ebuild:      sed -i -e "s/-lXft/`$(tc-getPKG_CONFIG) --libs xft`/" Makefile || die
media-sound/lilypond/lilypond*.ebuild:  sed -i "s/^AR=ar/AR=$(tc-getAR)/" stepmake/stepmake/library-vars.make || die
net-libs/c-client/c-client-2007f*.ebuild:       sed -e "s/CC=cc/CC=$(tc-getCC)/" \
net-mail/cyrus-imap-admin/cyrus-imap-admin*.ebuild:     sed -i -e "s/ar cr/$(tc-getAR) cr/" \
net-mail/cyrus-imapd/cyrus-imapd*.ebuild:       sed -i -e "s/ar cr/$(tc-getAR) cr/" \
net-mail/metamail/metamail*.ebuild:     sed -i -e "s/-lncurses/$($(tc-getPKG_CONFIG) --libs ncurses)/" \
net-p2p/mktorrent-borg/mktorrent-borg*.ebuild:  sed -i -e "s/CC=gcc/CC=$(tc-getCC)/g" \
sci-biology/ariadne/ariadne*.ebuild:    sed -e "s/CC = gcc/CC = $(tc-getCC)/" \
sci-biology/elph/elph*.ebuild:  sed -i -e "s/CC      := g++/CC      := $(tc-getCXX)/" \
sci-biology/rnaview/rnaview*.ebuild:    sed -e "s/CC        = cc/CC        = $(tc-getCC)/" \
sci-biology/wgs-assembler/wgs-assemble*.ebuild: sed -i -e "s/CC *:=.*/CC := $(tc-getCC)/" \
sci-biology/wgs-assembler/wgs-assemble*.ebuild: sed -i -e "s/CC *= *gcc/CC = $(tc-getCC)/" \
sci-chemistry/gamess/gamess*.ebuild:    sed -e "s/gentoo-CC = 'gcc'/CC = '$(tc-getCC)'/" \
sci-libs/lrslib/lrsli*.ebuild:  sed -i "s/gcc/$(tc-getCC)/g" makefile || die
sci-libs/scotch/scotch*.ebuild: sed -e "s/gcc/$(tc-getCC)/" \
sci-libs/spooles/spooles*.ebuild:       sed -e "s/@CC@/$(tc-getCC)/" \
sci-mathematics/bertini/bertini*.ebuild:        sed -i -e "s/gcc/$(tc-getCC)/" Makefile
www-apache/passenger/passenge*.ebuild:  sed -i -e "/^CC/ s/=.*$/= '$(tc-getCC)'/" \
www-apache/passenger/passenge*.ebuild:  sed -i -e "s/ar cru/"$(tc-getAR)" cru/" build/cplusplus_support.rb || die
www-apache/passenger/passenge*.ebuild:  sed -i -e "s/gcc/$(tc-getCC)/" \
www-client/w3m/w3m*.ebuild:     sed -i -e "/^AR=/s/ar/$(tc-getAR)/" {.,w3mimg,libwc}/Makefile.in || die