Implemented rpkg.
This commit is contained in:
parent
76d298ac8d
commit
100fcb554d
33
src/rpkg
33
src/rpkg
@ -1,4 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Not yet implemented"
|
||||
DESTDIR="${FPKG_ROOT}/"
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user