Skip to content
This repository
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 111 lines (83 sloc) 2.245 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
#!/bin/bash


uninstall_locales() # arg1=datadir.

{
rm -f "${DESTDIR}${1}/locale/"*"/LC_MESSAGES/devede.mo"
}


uninstall_others() # arg1=bindir, arg2=datadir, arg3=pkglibdir,
# arg4=pkgdatadir, arg5=pkgdocdir.

{
rm -f "${DESTDIR}${1}/devede"
rm -f "${DESTDIR}${1}/devede.py"
rm -f "${DESTDIR}${1}/devede_debug"
        rm -f "${DESTDIR}${1}/devede-debug"
rm -rf "${DESTDIR}${3}"
rm -rf "${DESTDIR}${4}"
rm -rf "${DESTDIR}${5}"
rm -f "${DESTDIR}${2}/pixmaps/devede.png"
rm -f "${DESTDIR}${2}/pixmaps/devede.svg"
rm -f "${DESTDIR}${2}/applications/devede.desktop"
}


# Process arguments.

PARAM=

for arg
do if [ "${PARAM}" ]
then eval "${PARAM}=\"${arg}\""
PARAM=
else
case "${arg}" in

--*) PARAM="${arg: 2}"
;;

-*) PARAM="${arg: 1}"
;;

*) PARAM="${arg}"
;;
esac

case "${PARAM}" in

*=*) eval "${PARAM}"
PARAM=
;;
esac
fi
done

if [ "${PARAM}" ]
then eval "${PARAM}="
fi

DESTDIR="${DESTDIR:-}"

# Version is targeted if specified as such, or if a parameter is set.

targeted=${targeted:-${prefix}${bindir}${libdir}${datadir}${docdir}\
${pkglibdir}${pkgdatadir}${pkgdocdir}${DESTDIR}no}

if [ "${targeted}" = "no" ]
then
# Version is not targeted. Uninstall legacy and current versions
# in default paths (relative to DESTDIR).

uninstall_locales "/usr/share" # Locales are common.

# Remove legacy version.

uninstall_others "/usr/bin" \
"/usr/share" \
"/usr/lib/devede" \
"/usr/share/devede" \
"/usr/share/doc/devede"

# Remove current version.

uninstall_others "/usr/local/bin" \
"/usr/local/share" \
"/usr/local/lib/devede" \
"/usr/local/share/devede" \
"/usr/local/share/doc/devede"
else
# Be sure all paths are defined.

prefix="${prefix:-/usr/local}"
bindir="${bindir:-${prefix}/bin}"
libdir="${libdir:-${prefix}/lib}"
datadir="${datadir:-${prefix}/share}"
docdir="${docdir:-${datadir}/doc}"
pkglibdir="${pkglibdir:-${libdir}/devede}"
pkgdatadir="${pkgdatadir:-${datadir}/devede}"
pkgdocdir="${pkgdocdir:-${docdir}/devede}"

# Remove targeted version.

uninstall_locales "${datadir}"
uninstall_others "${bindir}" \
"${datadir}" \
"${pkglibdir}" \
"${pkgdatadir}" \
"${pkgdocdir}"
fi
Something went wrong with that request. Please try again.