Changeset 2460
- Timestamp:
- Sep 19, 2016, 12:27:33 PM (4 years ago)
- Location:
- lliurex-desktops-keeper/trunk/fuentes/install/usr
- Files:
-
- 2 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
lliurex-desktops-keeper/trunk/fuentes/install/usr/sbin/lliurex-desktops-db
r2430 r2460 12 12 diversion_db="/var/lib/lliurex-desktops-keeper/lliurex-desktops.db" 13 13 diversion_db_hide="/var/lib/lliurex-desktops-keeper/lliurex-desktops_hide.db" 14 mate_db="/usr/share/lliurex-desktops-keeper/desktops-hide/mate-desktops" 14 15 destination_path="/usr/share/applications/" 15 16 db=[] 16 17 db_hide=[] 18 db_mate=[] 17 19 18 20 … … 30 32 31 33 34 def lookup_mate(file): 35 matefile= -1 36 37 for c in db_mate: 38 if c==file: 39 matefile=0 40 return int(matefile) 32 41 33 42 #add command … … 37 46 38 47 initdb() 39 40 41 42 48 initdb_mate() 49 43 50 for file in os.listdir(path): 44 51 match=re.match(".*\.desktop$",file) … … 46 53 47 54 ret=lookup(path+os.sep+file) 55 matefile=lookup_mate(file) 48 56 49 57 if ret==-1: … … 51 59 must_save=True 52 60 db.append((path+os.sep+file,priority)) 53 54 subprocess.call(["dpkg-divert","--package","lliurex-desktops-keeper","--rename","--quiet","--add","--divert", str(destination_path+file+".diverted"),str(destination_path+file)])61 if matefile ==-1: 62 subprocess.call(["dpkg-divert","--package","lliurex-desktops-keeper","--rename","--quiet","--add","--divert", str(destination_path+file+".diverted"),str(destination_path+file)]) 55 63 shutil.copy(str(path+os.sep+file),str(destination_path+file)) 56 64 else: … … 65 73 if ret < priority: 66 74 #print "* Inserting with a higher priority: ",file 67 subprocess.call(["dpkg-divert","--package","lliurex-desktops-keeper","--rename","--quiet","--add","--divert", str(destination_path+file+".diverted"),str(destination_path+file)]) 75 if matefile==-1: 76 subprocess.call(["dpkg-divert","--package","lliurex-desktops-keeper","--rename","--quiet","--add","--divert", str(destination_path+file+".diverted"),str(destination_path+file)]) 68 77 shutil.copy(str(path+os.sep+file),str(destination_path+file)) 69 78 … … 146 155 147 156 initdb() 157 initdb_mate() 148 158 149 159 todel=[] … … 157 167 158 168 for file in todel: 169 matefile=lookup_mate(file) 159 170 if os.path.exists(destination_path+file+".diverted"): 160 171 … … 165 176 subprocess.call(["dpkg-divert","--package","lliurex-desktops-keeper","--rename","--quiet","--remove",str(destination_path+file)]) 166 177 178 else: 179 if matefile==0: 180 if os.path.exists(destination_path+file): 181 #print "* Removing:",file 182 os.remove(destination_path+file) 183 167 184 #print "* Removing db file" 168 185 os.remove(diversion_db) … … 183 200 184 201 for line in hide_desktop_file: 185 xfile=line.strip() 202 xfile=line.strip() 203 must_save=True 204 db_hide.append(xfile) 186 205 187 if os.path.exists(xfile): 188 189 must_save=True 190 db_hide.append(xfile) 191 subprocess.call(["dpkg-divert","--package","lliurex-desktops-keeper","--rename","--quiet","--add", "--divert",str(xfile+".diverted"),str(xfile)]) 192 193 if must_save: 194 #sa database 195 dbfile=open(diversion_db_hide,"w+") 196 for c in db_hide: 197 dbfile.write(c+"\n") 198 199 dbfile.close() 206 if not (os.path.exists(xfile +".diverted")) and xfile!="": 207 208 subprocess.call(["dpkg-divert","--package","lliurex-desktops-keeper","--rename","--quiet","--add", "--divert",str(xfile+".diverted"),str(xfile)]) 209 210 if must_save: 211 #saving database 212 dbfile=open(diversion_db_hide,"w+") 213 for c in db_hide: 214 dbfile.write(c+"\n") 215 dbfile.close() 200 216 201 217 hide_desktop_file.close() … … 215 231 for line in toshow: 216 232 xfile=line.strip() 217 if os.path.exists( line+".diverted"):218 subprocess.call(["dpkg-divert","--package","lliurex-desktops-keeper","--rename","--quiet","--remove",str( line)])233 if os.path.exists(xfile+".diverted"): 234 subprocess.call(["dpkg-divert","--package","lliurex-desktops-keeper","--rename","--quiet","--remove",str(xfile)]) 219 235 220 236 #print "* Removing db file" … … 258 274 259 275 276 def initdb_mate(): 277 global db_mate 278 if os.path.exists(mate_db): 279 mate_file=open(mate_db,"r") 280 for line in mate_file: 281 tmp=line.split("/") 282 if (len(tmp)>1): 283 db_mate.append(tmp[5].strip()) 284 mate_file.close() 260 285 261 286 -
lliurex-desktops-keeper/trunk/fuentes/install/usr/share/lliurex-desktops-keeper/custom-desktops/JB-javaws.desktop
r2449 r2460 20 20 X-GNOME-Settings-Panel=Oracle Java 7 Web Start 21 21 X-Unity-Settings-Panel=Oracle Java 7 Web Start 22 Categories=Sy tem;22 Categories=System; 23 23 -
lliurex-desktops-keeper/trunk/fuentes/install/usr/share/lliurex-desktops-keeper/desktops-hide/lliurex-desktops-keeper-hide
r2444 r2460 29 29 /usr/share/applications/JB-mission-control-jdk9.desktop 30 30 /usr/share/applications/mugshot.desktop 31 /usr/share/mate/applications/edu.media.mit.scratch2editor.desktop32 /usr/share/applications/edu.media.mit.scratch2editor.desktop
Note: See TracChangeset
for help on using the changeset viewer.