Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-tweak.git;a=commitdiff;h=5ad4d74575ac8d4b7a4e1414a88cee7188a649be

commit 5ad4d74575ac8d4b7a4e1414a88cee7188a649be
Author: bouleetbil <[email protected]>
Date:   Thu Dec 29 13:39:26 2011 +0100

pacmandaemon
*daemon for update pacman-g2 database

diff --git a/py-pacman/pacmandaemon/pacmandaemon.py 
b/py-pacman/pacmandaemon/pacmandaemon.py
new file mode 100644
index 0000000..65798ba
--- /dev/null
+++ b/py-pacman/pacmandaemon/pacmandaemon.py
@@ -0,0 +1,32 @@
+"""
+ *  Copyright (C) 2011 by Gaetan Gourdin <[email protected]>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+"""
+
+import time
+from pacmang2.libpacman import *
+
+def UpdateDatabase():
+       pacman_update_db()
+
+#print("Start frugalware-tweak update database")
+UpdateDatabase()
+while True:
+    time.sleep(3600 ) # 60 min.
+    try:
+        UpdateDatabase()
+    except:
+        pass
diff --git a/py-pacman/pacmandaemon/pacmandaemon.service 
b/py-pacman/pacmandaemon/pacmandaemon.service
new file mode 100644
index 0000000..1743f85
--- /dev/null
+++ b/py-pacman/pacmandaemon/pacmandaemon.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=pacman-g2 daemon update database
+After=syslog.target
+
+[Service]
+Type=forking
+
+ExecStart=python /usr/bin/pacmandaemon.py
+
+[Install]
+WantedBy=multi-user.target
+
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to