From 40d17d5b04daf813c1f9f838ba73adaac31f68fa Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sun, 17 Jun 2001 19:13:49 +0000 Subject: [PATCH] Fixed installation problems and protection problems svn: r162 --- Makefile.in | 11 ++++++----- gramps.spec | 4 ++-- src/RelImage.py | 21 +++++++++++++++++---- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/Makefile.in b/Makefile.in index 295cbefaf..62e667a2a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -3,6 +3,7 @@ exec_prefix = @exec_prefix@ bindir = @bindir@ datadir = @datadir@/@PACKAGE@ INSTALL = @INSTALL@ +sharedir = ${prefix}/share/gramps @SET_MAKE@ @@ -18,12 +19,12 @@ install: (cd src/filters; ${MAKE} install) (cd src/data; ${MAKE} install) -${INSTALL} -d ${bindir} - -${INSTALL} -d ${prefix}/share/example/gramps - -${INSTALL} -d ${prefix}/share/example/gedcom + -${INSTALL} -d ${sharedir}/example/gramps + -${INSTALL} -d ${sharedir}/example/gedcom ${INSTALL} gramps.sh ${bindir}/gramps - -${INSTALL} example/gramps/*.jpg ${prefix}/share/example/gramps - -${INSTALL} example/gramps/data.gramps ${prefix}/share/example/gramps - -${INSTALL} example/gedcom/*.ged ${prefix}/share/example/gedcom + -${INSTALL} example/gramps/*.jpg ${sharedir}/example/gramps + -${INSTALL} example/gramps/data.gramps ${sharedir}/example/gramps + -${INSTALL} example/gedcom/*.ged ${sharedir}/example/gedcom chmod +x ${bindir}/gramps uninstall: diff --git a/gramps.spec b/gramps.spec index 35304b0a5..cef4ccf1d 100644 --- a/gramps.spec +++ b/gramps.spec @@ -54,8 +54,8 @@ rm -rf $RPM_BUILD_ROOT %{prefix}/share/pixmaps/gramps.png # %{prefix}/share/gramps/* %{prefix}/share/locale/*/LC_MESSAGES/gramps.mo -%{prefix}/share/example/gedcom/* -%{prefix}/share/example/gramps/* +%{prefix}/share/gramps/example/gedcom/* +%{prefix}/share/gramps/example/gramps/* %{prefix}/share/gramps/*.pyo %{prefix}/share/gramps/*.so %{prefix}/share/gramps/*.py diff --git a/src/RelImage.py b/src/RelImage.py index 9dfc7ae33..f8e831d6a 100644 --- a/src/RelImage.py +++ b/src/RelImage.py @@ -57,8 +57,14 @@ def import_photo(filename,path,prefix): break thumb = path+os.sep+".thumb" - if not os.path.exists(thumb): - os.mkdir(thumb) + + try: + if not os.path.exists(thumb): + os.mkdir(thumb) + except IOError,msg: + GnomeErrorDialog(_("Could not create %s") % thumb + "\n" + str(msg)) + except: + GnomeErrorDialog(_("Could not create %s") % thumb) try: path = thumb + os.sep + base @@ -107,8 +113,15 @@ def scale_image(path,size): def mk_thumb(source,dest,size): dir = os.path.dirname(dest) - if not os.path.exists(dir): - os.mkdir(dir) + try: + if not os.path.exists(dir): + os.mkdir(dir) + except IOError,msg: + GnomeErrorDialog(_("Could not create %s") % dir + "\n" + str(msg)) + return + except: + GnomeErrorDialog(_("Could not create %s") % dir) + return if no_pil: cmd = "%s -geometry %dx%d '%s' '%s'" % (const.convert,size,size,source,dest)