forked from baruch/diskscan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This should simplify full cleanup when packaging. The script was slightly modified from the original contribution of Eriberto to pass shellcheck checks. Closes baruch#52
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/sh | ||
|
||
# distclean.sh for diskscan | ||
# Copyright 2015 Joao Eriberto Mota Filho <[email protected]> | ||
# v2015111402 | ||
# This file can used under GPL-3+ license or BSD-3-Clause. | ||
|
||
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
|
||
PREFIX="." | ||
|
||
# Files and directories to remove | ||
|
||
OBJS=" CMakeFiles/ \ | ||
Makefile \ | ||
CMakeCache.txt \ | ||
Documentation/diskscan.1 \ | ||
cmake_install.cmake \ | ||
install_manifest.txt \ | ||
libscsicmd/src/CMakeFiles/ \ | ||
libscsicmd/src/Makefile \ | ||
libscsicmd/src/cmake_install.cmake \ | ||
tags" | ||
|
||
# Main procedures | ||
|
||
remove_files () { | ||
if [ -e "$PREFIX/$TARGET" ]; then | ||
echo "Removing $PREFIX/$TARGET" | ||
rm -rf "${PREFIX:?}/$TARGET" | ||
else | ||
echo "$PREFIX/$TARGET NOT FOUND." | ||
fi | ||
} | ||
|
||
# Distclean | ||
|
||
echo "DOING DISTCLEAN..." | ||
|
||
for TARGET in $OBJS | ||
do | ||
remove_files | ||
done | ||
|
||
echo "DONE." | ||
echo |