]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
new: Add a new parameter (copyright-owner) in the "new" script
authorNirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
Thu, 22 May 2025 05:41:34 +0000 (05:41 +0000)
committerZorro Lang <zlang@kernel.org>
Fri, 23 May 2025 15:16:05 +0000 (23:16 +0800)
This patch another optional interactive prompt to enter the
copyright-owner for each new test file that is created using
the "new" file.

The sample output looks like something like the following:

./new selftest
Next test id is 007
Append a name to the ID? Test name will be 007-$name. y,[n]:
Creating test file '007'
Add to group(s) [auto] (separate by space, ? for list): selftest quick
Enter <copyright owner>: IBM Corporation
Creating skeletal script for you to edit ...
 done.

Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
new

diff --git a/new b/new
index 6b50ffeda9102dc8d1f6acbbbfcaa43a7b5a00b2..a7ad7135137c0930cb03e86a984aa3eb18ecd51f 100755 (executable)
--- a/new
+++ b/new
@@ -136,6 +136,9 @@ else
        check_groups "${new_groups[@]}" || exit 1
 fi
 
+read -p "Enter <copyright owner>: " -r
+copyright_owner="${REPLY:=YOUR NAME HERE}"
+
 echo -n "Creating skeletal script for you to edit ..."
 
 year=`date +%Y`
@@ -143,7 +146,7 @@ year=`date +%Y`
 cat <<End-of-File >$tdir/$id
 #! /bin/bash
 # SPDX-License-Identifier: GPL-2.0
-# Copyright (c) $year YOUR NAME HERE.  All Rights Reserved.
+# Copyright (c) $year $copyright_owner.  All Rights Reserved.
 #
 # FS QA Test $id
 #