Commit 319ddf77 authored by pcy's avatar pcy
Browse files

fix small bugs

parent 79d28eed
......@@ -26,9 +26,9 @@ pull_with_vcs() {
if ! [ -z "$3" ]; then
PKG_NAME="$3"
elif [ "$1" == "git" ] && [[ "$PKG_NAME" == *".git" ]]; then
PKG_NAME="${PKG_NAME%.*}"
PKG_NAME="${PKG_NAME%.*}"
elif [ "$1" == "http" ] || [ "$1" == "https" ] || [ "$1" == "rsync" ]; then
PKG_NAME="${PKG_NAME%%.*}"
PKG_NAME="${PKG_NAME%%.*}"
fi
if exec_subcommand src-db exists "$PKG_NAME"; then
......@@ -168,6 +168,11 @@ main() {
;;
esac
if ! [ -d "$SSPT_DL_DIR/$PKG_NAME" ]; then
>&2 echo "An error occured while pulling."
exit 1
fi
# need to register it before we can autogen the .sspt file
exec_subcommand src-db reg "$PKG_NAME" dummy_revision || exit 1
......
......@@ -77,21 +77,29 @@ main() {
exit 1
fi
(. "$SSPT_DL_DIR/$1/.sspt"; \
[ "$SSPT_TRACK_FILES" = "no" ] && exit 1 || exit 0)
if [ $? -eq 0 ]; then
run_strace "$@" || exit 1
else
echo "NOTE: installing package '$1' whose installed files" \
"will not be tracked by sspt. This will make \`sspt" \
"uninstall\` meaningless for this package."
if ! command -v strace >/dev/null 2>&1; then
echo "NOTE: \`strace' not found. sspt will not keep track of " \
"the installed files."
exec_subcommand pkgcmd install "$1" || exit 1
OUTFILE="$(temp_filename)"
touch "$OUTFILE"
else
(. "$SSPT_DL_DIR/$1/.sspt"; \
[ "$SSPT_TRACK_FILES" = "no" ] && exit 1 || exit 0)
if [ $? -eq 0 ]; then
run_strace "$@" || exit 1
else
echo "NOTE: installing package '$1' whose installed files" \
"will not be tracked by sspt. This will make \`sspt" \
"uninstall\` meaningless for this package."
exec_subcommand pkgcmd install "$1" || exit 1
OUTFILE="$(temp_filename)"
touch "$OUTFILE"
fi
fi
exec_subcommand bin-db reg "$1" "$OUTFILE" || exit 1
rm "$OUTFILE"
rm -f "$OUTFILE"
;;
esac
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment