From patchwork Wed Apr 10 15:16:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Guo, Yejun" X-Patchwork-Id: 12683 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 9496844869D for ; Wed, 10 Apr 2019 10:26:53 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 60EEF68AC3E; Wed, 10 Apr 2019 10:26:53 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0781E68AAD0 for ; Wed, 10 Apr 2019 10:26:46 +0300 (EEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Apr 2019 00:26:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,332,1549958400"; d="scan'208";a="134486285" Received: from yguo18-skl-u1604.sh.intel.com ([10.239.13.25]) by orsmga006.jf.intel.com with ESMTP; 10 Apr 2019 00:26:43 -0700 From: "Guo, Yejun" To: ffmpeg-devel@ffmpeg.org Date: Wed, 10 Apr 2019 23:16:06 +0800 Message-Id: <1554909366-15448-1-git-send-email-yejun.guo@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [FFmpeg-devel] [PATCH] configure: sort decoder/encoder/filter/... names in alphabet order in one page X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: yejun.guo@intel.com MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" takes decoder names an example, with the default page length, shell command 'pr' needs two pages for all the decoder names. The names are firstly printed in the first page, then in the second page. So, as a whole, the names are sorted neither in column order nor in row order. It's a little confused. This patch calculates the proper page length, so all the names are printed in one page, and so strictly in alphabet order, column by column. Signed-off-by: Guo, Yejun --- configure | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/configure b/configure index f6123f5..2eace26 100755 --- a/configure +++ b/configure @@ -3829,7 +3829,12 @@ die_unknown(){ print_in_columns() { cols=$(expr $ncols / 24) - cat | tr ' ' '\n' | sort | pr -r "-$cols" -w $ncols -t + if [ -n "$1" ]; then + page_length=$(expr \( $1 + $cols - 1 \) / $cols) + cat | tr ' ' '\n' | sort | pr -r "-$cols" -w $ncols -t -l $page_length + else + cat | tr ' ' '\n' | sort | pr -r "-$cols" -w $ncols -t + fi } show_list() { @@ -7134,7 +7139,8 @@ echo for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do echo "Enabled ${type}s:" eval list=\$$(toupper $type)_LIST - print_enabled '_*' $list | print_in_columns + eanbled_list=`print_enabled '_*' $list` + echo $eanbled_list | print_in_columns `echo $eanbled_list | wc -w` echo done