ar can't recognize old version of dpkg. So exit on its failure but
this is also not required because script will exit anyway.

For some reason redirection to /dev/null is not happening.
[] will return boolean value any way use it instead of piggy backing
string value.
modify the condition to use new definition of is_valid_file.
ar and xz will not be installed by default. Check for existence if not
present then exit with messages.
Path to xz binary was wrong fixed now!.
Delete possible newline in file name before processing it to extract
information from name.
Toy with IFS to allow new line in file names and quote more
variables. Use sed as grep instead of using grep and sed both.
use trap to delete temporary directory on clean or abnormal exit
Drop cd $CURDIR statement it doesn't matter
set IFS to blank to allow reading new lines and spaces.
Delete newline or space in filenames.
Drop unneeded IFS modification in verify_copyright function.