Permalink
Browse files

When we remove the PBI make sure we unmount everything first, also

make sure to create fonts / cursors / icons dirs with X apps
  • Loading branch information...
1 parent a180dc7 commit 9d437ac9680d82f70e50e4cec35030d3d345ee8d @kmoore134 kmoore134 committed Oct 3, 2013
Showing with 18 additions and 0 deletions.
  1. +8 −0 src-sh/pbi-manager10/pbi-manager
  2. +10 −0 src-sh/pbi-manager10/pbime/pbime.c
@@ -4096,6 +4096,11 @@ clean_stage_dir() {
rm -rf ${PBI_STAGEDIR}/lib/X11/fonts/* >/dev/null 2>/dev/null
rm -rf ${PBI_STAGEDIR}/lib/X11/icons/* >/dev/null 2>/dev/null
fi
+ if [ -e "${PBI_STAGEDIR}/lib/X11" ] ; then
+ mkdir -p ${PBI_STAGEDIR}/lib/X11/icons/ >/dev/null 2>/dev/null
+ mkdir -p ${PBI_STAGEDIR}/lib/X11/fonts/ >/dev/null 2>/dev/null
+ mkdir -p ${PBI_STAGEDIR}/etc/fonts/ >/dev/null 2>/dev/null
+ fi
}
# Copy over any resource files into the PBI dir
@@ -4294,6 +4299,9 @@ do_pbi_delete() {
load_info_from_dir "${PBI_DBAPPDIR}/${PBI_DELETENAME}"
PBI_PROGDIRPATH="${PBI_ORIGPROGDIRPATH}"
+ # Unmount the PBI if its mounted
+ /usr/pbi/.pbime umount "/usr/pbi/.mounts/`basename $PBI_PROGDIRPATH`"
+
get_username_from_file "${PBI_DBAPPDIR}/${PBI_DELETENAME}/pbi_name"
if [ "$FILEUSER" != `whoami` -a `id -u` != "0" ] ; then
exit_err "Permission denied to modify PBI installed by: $FILEUSER"
@@ -53,8 +53,18 @@ main(int argc, char *argv[])
gid_t groups[NGROUPS];
login_cap_t *lcap;
+ /* Is this a request to unmount? */
+ if ( argc == 3 ) {
+ if ( strcmp(argv[1], "umount") == 0 ) {
+ strcpy(mountscript, "/usr/pbi/.pbimount umount ");
+ strcat(mountscript, argv[2]);
+ return system(mountscript);
+ }
+ }
+
if (argc < 4)
usage();
+
/* Get the current user ID and user name in the host system */
huid = getuid();
husername = getpwuid(huid);

0 comments on commit 9d437ac

Please sign in to comment.