Changeset 2421 for lliurex-desktops-keeper/trunk/fuentes
- Timestamp:
- Sep 14, 2016, 1:36:47 PM (4 years ago)
- Location:
- lliurex-desktops-keeper/trunk/fuentes
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lliurex-desktops-keeper/trunk/fuentes/debian/postinst
r2395 r2421 22 22 configure) 23 23 lliurex-desktops-db ADD /usr/share/lliurex-desktops-keeper/custom-desktops 25 24 lliurex-desktops-db HIDE /usr/share/lliurex-desktops-keeper/desktops-hide 24 25 25 26 update-desktop-database /usr/share/applications/ >/dev/null 2>/dev/null || true -
lliurex-desktops-keeper/trunk/fuentes/install/usr/sbin/lliurex-desktops-db
r2395 r2421 11 11 12 12 diversion_db="/var/lib/lliurex-desktops-keeper/lliurex-desktops.db" 13 diversion_db_hide="/var/lib/lliurex-desktops-keeper/lliurex-desktops_hide.db" 13 14 destination_path="/usr/share/applications/" 14 15 db=[] 16 db_hide=[] 15 17 16 18 … … 166 168 167 169 168 170 def hide(path): 171 global db_hide 172 173 initdb_hide() 174 175 must_save=False 176 177 for file in os.listdir(path): 178 179 hide_desktop_file=open(path+os.sep+file, "r") 180 181 for line in hide_desktop_file: 182 xfile=line.strip() 183 184 if os.path.exists(xfile): 185 print "True" 186 must_save=True 187 print xfile 188 db_hide.append(xfile) 189 print subprocess.call(["dpkg-divert","--package","lliurex-desktops-keeper","--rename","--quiet","--add", "--divert",str(xfile+".diverted"),str(xfile)]) 190 191 if must_save: 192 #sa database 193 dbfile=open(diversion_db_hide,"w+") 194 for c in db_hide: 195 dbfile.write(c+"\n") 196 197 dbfile.close() 198 199 hide_desktop_file.close() 169 200 170 201 def initdb(): … … 186 217 187 218 219 def initdb_hide(): 220 global db_hide 221 222 #print "* Opening Database" 223 if not os.path.exists(diversion_db_hide): 224 #print "* Database not found" 225 #exit(-1) 226 subprocess.call(["touch", str(diversion_db_hide)]) 227 228 dbfile_hide=open(diversion_db_hide,"r") 229 for line in dbfile_hide: 230 tmp = line.strip() 231 if(len(tmp)>1): 232 db_hide.append(tmp) 233 234 dbfile_hide.close() 235 236 237 188 238 189 239 def main(): … … 213 263 purge() 214 264 265 if order=="HIDE": 266 hide(path) 215 267 216 268 exit(0)
Note: See TracChangeset
for help on using the changeset viewer.