From patchwork Wed Mar 30 08:22:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sedat Dilek X-Patchwork-Id: 8693631 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B1647C0553 for ; Wed, 30 Mar 2016 08:23:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 296122026F for ; Wed, 30 Mar 2016 08:23:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1975220122 for ; Wed, 30 Mar 2016 08:23:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932517AbcC3IXK (ORCPT ); Wed, 30 Mar 2016 04:23:10 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33276 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754472AbcC3IXI (ORCPT ); Wed, 30 Mar 2016 04:23:08 -0400 Received: by mail-wm0-f68.google.com with SMTP id i204so10633485wmd.0; Wed, 30 Mar 2016 01:23:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=gt3+U4ACQoXppdvIZPng3hHGjJwJ82Q0P2qlY8sD+K8=; b=Y65Vm6rWCnEIyHuG/syvT6fZHT9oS7DAAF3jal07t0srhN1d7DS5jC9wJaS7FSbfR4 Nywndr7KdCZrQivpAd10achlifd4TXdCwl1LxT/DS073L0Fow4A/44aH5SiaR8c1q1HF 2bqHv/GJN0BpzubAo5VQpJXuoT+CzJNgQ7ntNAul/mYq9Go0m3UpNFVi/XCyySI9QOaW ETc2vqhjI3gekWJSGuOA3Omt3ojdatmU+cwdPCCVTwKatVCM+0/2OfCcRT7mxg+Ama0A BTh6Qd5u9bucnPRElKW8nNW9YlGwZZsM+gXeSNLa66ZGHuwxrg+wVnnA88QSVNiYbbW2 wsOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=gt3+U4ACQoXppdvIZPng3hHGjJwJ82Q0P2qlY8sD+K8=; b=IVC8AeqnASBoufdqfIFS453p8ysA+cOUEVduDW4PfGx14kUNwQ0O41SDknhtNFQzkq /Tt8IfJep+jXewh6rHpHFLZsm0tk+0n0ADTzsuayx44CLEGIN9pswFmskReGqLSs2lO/ 3x1qZFjoU4l/89gTick6T9BqPsFVde3f9TWHXpbehZWq8QFIlftM5Bn3S4o9P10wO2+f GSyw3lQo+/0GGiDjtXIjrueb/w0o4UWJYH9cYZ1QmB8jf8DvsHlB6l+6UpgCfEnFK0oc vj8yFjhNUMhQbFmugROwTnc+9LgGtFRnp1mNDaaZTFMNcHwx8I37DukyhBkvwGGnUnVU 3zzw== X-Gm-Message-State: AD7BkJI9nA9Bixvm5G+8GDiFk3BiZsXr2PH7Fl1zjlWP+gRNYf29+4Q7Rsz4PVyG4Cp6Lg== X-Received: by 10.195.12.42 with SMTP id en10mr7745098wjd.13.1459326186245; Wed, 30 Mar 2016 01:23:06 -0700 (PDT) Received: from fambox.fambox-domain ([176.2.33.150]) by smtp.gmail.com with ESMTPSA id jo6sm2616330wjb.48.2016.03.30.01.23.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Mar 2016 01:23:05 -0700 (PDT) From: Sedat Dilek Cc: Sedat Dilek , Sasha Levin , Linus Torvalds , Ingo Molnar , Theodore Ts'o , Boqun Feng , LKML , linux-fsdevel Subject: [PATCH] liblockdep: Fix unsupported 'basename -s' in run_tests.sh Date: Wed, 30 Mar 2016 10:22:49 +0200 Message-Id: <1459326169-7009-1-git-send-email-sedat.dilek@gmail.com> X-Mailer: git-send-email 2.8.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Here on Ubuntu/precise I have GNU/coreutils v8.13 installed where 'basename -s' is not supported. The result is that run_tests.sh is not done properly. [ INSTRUCTIONS ] $ cd $BUILD_DIR $ LC_ALL=C make -C tools/ liblockdep $ cd tools/lib/lockdep/ $ LC_ALL=C ./run_tests.sh basename: invalid option -- 's' Try `basename --help' for more information. ... timeout: failed to run command `./tests/': Permission denied FAILED! rm: cannot remove `tests/': Is a directory Due to unsupported basename the tests programs are not generated and cannot be removed. Fix this by doing a compatible basename invocation and check for the existence of generated tests programs. For more details see the thread in [1] on LKML. This patch is on top of Linux v4.6-rc1. [1] http://marc.info/?t=145906667300001&r=1&w=2 Cc: Sasha Levin (maintainer:LIBLOCKDEP) Cc: Linus Torvalds Cc: Ingo Molnar Cc: Theodore Ts'o Cc: Boqun Feng Cc: LKML Cc: linux-fsdevel Signed-off-by: Sedat Dilek --- tools/lib/lockdep/run_tests.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/lib/lockdep/run_tests.sh b/tools/lib/lockdep/run_tests.sh index 5334ad9d39b7..1069d96248c1 100755 --- a/tools/lib/lockdep/run_tests.sh +++ b/tools/lib/lockdep/run_tests.sh @@ -3,7 +3,7 @@ make &> /dev/null for i in `ls tests/*.c`; do - testname=$(basename -s .c "$i") + testname=$(basename "$i" .c) gcc -o tests/$testname -pthread -lpthread $i liblockdep.a -Iinclude -D__USE_LIBLOCKDEP &> /dev/null echo -ne "$testname... " if [ $(timeout 1 ./tests/$testname | wc -l) -gt 0 ]; then @@ -11,11 +11,13 @@ for i in `ls tests/*.c`; do else echo "FAILED!" fi - rm tests/$testname + if [ -f "tests/$testname" ]; then + rm tests/$testname + fi done for i in `ls tests/*.c`; do - testname=$(basename -s .c "$i") + testname=$(basename "$i" .c) gcc -o tests/$testname -pthread -lpthread -Iinclude $i &> /dev/null echo -ne "(PRELOAD) $testname... " if [ $(timeout 1 ./lockdep ./tests/$testname | wc -l) -gt 0 ]; then @@ -23,5 +25,7 @@ for i in `ls tests/*.c`; do else echo "FAILED!" fi - rm tests/$testname + if [ -f "tests/$testname" ]; then + rm tests/$testname + fi done