Summary: | virtualx.eclass: add support for xf86-video-dummy | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Chí-Thanh Christopher Nguyễn <chithanh> |
Component: | Eclasses | Assignee: | Gentoo X packagers <x11> |
Status: | RESOLVED WONTFIX | ||
Severity: | enhancement | CC: | floppym, nikoli, vivo75 |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
URL: | http://lists.x.org/archives/xorg-devel/2012-March/030059.html | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 425322 | ||
Bug Blocks: | 476942 | ||
Attachments: |
xdummy.eclass
x11vnc-0.9.13.ebuild needed by xdummy.eclass |
Description
Chí-Thanh Christopher Nguyễn
2012-03-27 21:23:07 UTC
Created attachment 348514 [details]
xdummy.eclass
xdummy.eclass to use xf86-video-dummy
Created attachment 348516 [details]
x11vnc-0.9.13.ebuild needed by xdummy.eclass
Nice work, Rick. One minor point, there are a couple of excess subshells in the eclass, no doubt historical: if [[ -n ${XDUMMY} && -n ${XHOST} ]] && \ ( [[ -z ${DISPLAY} ]] || ! (${XHOST} &>/dev/null) ); then => { [[ -z ${DISPLAY} ]] || ! (${XHOST} &>/dev/null); }; then You don't need a semi-colon after ) there, but you would for any other command unless it were terminated with already with '&', eg if the two were swapped around, or it were: v=$(cmd ..); }; then.. In general, when using } to terminate on the same line, use ; before it, unless the command was backgrounded, since the & is a terminator. (Sorry if this is old news.) XDISPLAY=$(i=0; while [[ -f /tmp/.X${i}-lock ]] ; do ((i++));done; echo ${i}) => XDISPLAY=0 while [[ -f /tmp/.X${XDISPLAY}-lock ]]; do let ++XDISPLAY done More seriously: xdummyargs="-tmpdir "${WORKDIR}"" is borked; it actually stops quoting for the expansion of $WORKDIR, and then tacks on an empty string. This is what bash arrays were designed for: local xdummyargs=(-tmpdir "$WORKDIR") .. ${XDUMMY} :${XDISPLAY} "${xdummyargs[@]}" or: cmd=("$XDUMMY" ":$XDISPLAY" "${xdummyargs[@]}") and run: "${cmd[@]}" ..since it happens in 3 places. Use "${cmd[*]}" not @ when printing. The end of the function would be quicker as: ((retval == 0)) && return die "${FUNCNAME}: the ${XDUMMY_COMMAND} failed." I'd also be tempted to change that to: die "${FUNCNAME}: failed: ${XDUMMY_COMMAND} $*" ..if it's permitted. I think a better solution might be to install the Xdummy script in a separate package; I don't think you need to pull in all of x11vnc just for one script. Actually, upon further review, that Xdummy script is really ugly. There has to be a better way. (In reply to Chí-Thanh Christopher Nguyễn from comment #0) > Xvfb seemst to be on its way out per ${URL}. That plan seems to have died. See https://lists.x.org/archives/xorg-devel/2016-June/050266.html |