Implemented rpkg.

This commit is contained in:
Faerbit 2018-09-15 11:16:24 +02:00
parent 76d298ac8d
commit 100fcb554d

View File

@ -1,4 +1,35 @@
#!/bin/bash #!/bin/bash
echo "Not yet implemented" DESTDIR="${FPKG_ROOT}/"
exit 1 RC=0
if [ $# -ne 1 ]
then
echo "Did not specify exactly one argument"
exit 1
fi
files=$(lpkg "$1" | tac -)
if [ $? -ne 0 ]
then
echo $files
exit 1
fi
cd "$DESTDIR"
for file in $files
do
if [ -d "$file" ]
then
out=$(rmdir -v "$file" 2>&1)
[ $? -eq 0 ] && echo $out
elif [ -e "$file" ]
then
rm -vf "$file"
else
echo "File $file not found."
RC=1
fi
done
exit $RC