[ftools-fv] 01/01: Change default temp location to /tmp

Ole Streicher olebole at moszumanska.debian.org
Mon May 18 12:26:43 UTC 2015


This is an automated email from the git hooks/post-receive script.

olebole pushed a commit to branch debian
in repository ftools-fv.

commit 89ff63a5bfc5bcfdc418fe744a91979bc7b7f505
Author: Ole Streicher <debian at liska.ath.cx>
Date:   Mon May 18 14:27:17 2015 +0200

    Change default temp location to /tmp
---
 debian/changelog           |  8 ++++++-
 debian/patches/fvtmp.patch | 60 ++++++++++++++++++++++++++++++++++++++++++++++
 debian/patches/series      |  1 +
 3 files changed, 68 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index c199243..d45a4e5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ftools-fv (5.3+dfsg-7) UNRELEASED; urgency=low
+
+  * Change default temp location to /tmp
+
+ -- Ole Streicher <olebole at debian.org>  Mon, 18 May 2015 14:24:19 +0200
+
 ftools-fv (5.3+dfsg-6) unstable; urgency=low
 
   * build-depend on libcfitsio-dev instead of libcfitsio3-dev. Closes: #761708
@@ -10,7 +16,7 @@ ftools-fv (5.3+dfsg-6) unstable; urgency=low
 ftools-fv (5.3+dfsg-5) unstable; urgency=low
 
   * Change maintainer to debian-astro
-  * [Nicolas Sévelin-Radiguet] Fix FTBFS with clang instead of gcc. 
+  * [Nicolas Sévelin-Radiguet] Fix FTBFS with clang instead of gcc.
     Closes: #743702
   * Push standard version to 3.9.5. No changes needed.
 
diff --git a/debian/patches/fvtmp.patch b/debian/patches/fvtmp.patch
new file mode 100644
index 0000000..5f0d607
--- /dev/null
+++ b/debian/patches/fvtmp.patch
@@ -0,0 +1,60 @@
+Author: Ole Streicher <olebole at debian.org>
+Description: Change default temp location to /tmp
+ According to FHS, temporary files should be written to /tmp, and not to
+ the home directory. This patch moves the temp files there while keeping the
+ FVTMP behaviour intact.
+--- fv.orig/ftools/guis/fv/class/fvApp.tcl
++++ fv/ftools/guis/fv/class/fvApp.tcl
+@@ -438,37 +438,45 @@ itcl::body fvApp::_setupBackup { } {
+    if { $isWin } {
+       set fvBackupDir "fv_tmp"
+       set fvHOME FV_HOME
++      set fvTMP TMP
+    } elseif { $isMac } {
+       set fvBackupDir "fv_temp_folder"
+       set fvHOME HOME
++      set fvTMP TMPDIR
+    } else {
+       set fvBackupDir "fvtmp"
+       set fvHOME HOME
++      set fvTMP TMPDIR
+    }
+      
+    set currentTime [clock seconds]
+    set currentPid  [pid]
+ 
+-   set fvTmp "$fvBackupDir/fvTmp_${currentPid}_$currentTime"
++   set fvTmp "fvTmp_${currentPid}_$currentTime"
+ 
+    if { ![info exist env(FVTMP)] } {
+       if { ![info exist env($fvHOME)] } {
+          error "Please set up your $fvHOME enviroment first"
+          exit 
+       } else {
+-         if { [file exist [file join $env($fvHOME) $fvTmp]] } {
+-	    file stat [file join $env($fvHOME) $fvTmp] fstat
++         if { ![info exist env($fvTMP)] } {
++	    set tmpdir "/tmp"
++	 } else {
++	    set tmpdir $env($fvTMP)
++	 }
++         if { [file exist [file join $tmpdir $fvTmp]] } {
++	    file stat [file join $tmpdir $fvTmp] fstat
+ 	    if { $fstat(type) != "directory"} {
+-               puts "~/$fvTmp is not a directory, can not create back up files"
++               puts "$tmpdir/$fvTmp is not a directory, can not create back up files"
+                exit
+ 	    } 
+          } else {
+-	    file mkdir [file join $env($fvHOME) $fvTmp]
++	    file mkdir [file join $tmpdir $fvTmp]
+          }	       
+-         set g_backupDir [file join $env($fvHOME) $fvTmp]
++         set g_backupDir [file join $tmpdir $fvTmp]
+       }
+    } else {
+-      set g_backupDir $env(FVTMP)/$fvTmp
++      set g_backupDir $env(FVTMP)/$fvBackupDir/$fvTmp
+       if ![file exists $g_backupDir] {
+ 	 file mkdir $g_backupDir
+       }
diff --git a/debian/patches/series b/debian/patches/series
index 0c718b7..c2f9ad0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -9,3 +9,4 @@ fv_fix_initial_menubar.patch
 fv_fix_startup.patch
 fv_fix_sample.patch
 clang_FTBFS_Wreturn-type.patch
+fvtmp.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-astro/packages/ftools-fv.git



More information about the debian-science-commits mailing list