[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Quilt-dev] [PATCH 17/39] backup-files: Drop variable filelist
From: |
Jean Delvare |
Subject: |
[Quilt-dev] [PATCH 17/39] backup-files: Drop variable filelist |
Date: |
Sat, 19 Mar 2011 10:52:47 +0100 |
User-agent: |
quilt/0.48-17.1 |
No need to copy all file names to a dedicated array, we can use $@
directly instead.
Signed-off-by: Jean Delvare <address@hidden>
Reviewed-by: Raphael Hertzog <address@hidden>
---
quilt/scripts/backup-files.in | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
--- a/quilt/scripts/backup-files.in
+++ b/quilt/scripts/backup-files.in
@@ -141,7 +141,6 @@ noop()
ECHO=echo
OPT_WHAT=noop
-declare -a FILELIST
while [ $# -gt 0 ]; do
case $1 in
-b) OPT_WHAT=backup
@@ -167,8 +166,7 @@ while [ $# -gt 0 ]; do
-?*) usage
exit 0
;;
- *) FILELIST=("$@")
- break
+ *) break
;;
esac
@@ -192,10 +190,8 @@ if [ -n "$OPT_FILE" ]; then
done
fi
-I=0
-while [ $I -lt address@hidden ]; do
-
- case "${FILELIST[$I]}" in
+while [ $# -gt 0 ]; do
+ case $1 in
-)
find "$OPT_PREFIX" -type f -print \
| while read
@@ -207,9 +203,9 @@ while [ $I -lt address@hidden ]; do
fi
;;
*)
- $OPT_WHAT "${FILELIST[$I]}"
+ $OPT_WHAT "$1"
;;
esac
- I=$(($I+1))
+ shift
done
- [Quilt-dev] [PATCH 13/39] backup-files: Split code to sparate functions, (continued)
- [Quilt-dev] [PATCH 13/39] backup-files: Split code to sparate functions, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 24/39] backup-files: Avoid negations, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 14/39] backup-files: Mass reindent, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 01/39] Make backup-files a shell script, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 22/39] backup-files: Check if backup exists, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 12/39] backup-files: Simplify find loop, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 15/39] backup-files: Optimize restore, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 23/39] backup-files: Optimize noop, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 27/39] backup-files: Remember the list of files, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 17/39] backup-files: Drop variable filelist,
Jean Delvare <=
- [Quilt-dev] [PATCH 09/39] backup-files: Inline copy_file and link_or_copy_file, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 19/39] backup-files: Use internal implementation of dirname, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 33/39] backup-files: Try mass copy first on copy, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 05/39] Clean up legacy C code, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 11/39] backup-files: Prefix must be a directory, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 30/39] backup-files: Skip first mkdir on restore, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 29/39] backup-files: Try mass link/copy first on restore, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 36/39] backup-files: Drop support for -L on restore, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 16/39] backup-files: Optimize backup, Jean Delvare, 2011/03/19
- [Quilt-dev] [PATCH 06/39] backup-files: Drop suffix option, Jean Delvare, 2011/03/19