1
0
Fork 0

Scripts to regularly update things off the OBS

This commit is contained in:
Luca Beltrame 2016-09-17 01:37:11 +02:00
parent 8035d21a27
commit 6fa4bc7aea
Signed by: einar
GPG key ID: 40C8281493B01C16
3 changed files with 480 additions and 0 deletions

View file

@ -0,0 +1,200 @@
akonadi akonadi-server
akonadi-calendar akonadi-calendar
akonadi-calendar-tools akonadi-calendar-tools
akonadi-contacts akonadi-contacts
akonadi-import-wizard akonadi-import-wizard
akonadi-mime akonadi-mime
akonadi-notes akonadi-notes
akonadi-search akonadi-search
akonadiconsole akonadiconsole
akregator akregator
analitza analitza
ark ark
artikulate artikulate
baloo-widgets baloo5-widgets
blinken blinken
blogilo blogilo
bomber bomber
bovo bovo
calendarsupport calendarsupport
cantor cantor
cervisia cervisia
dolphin dolphin
dolphin-plugins dolphin-plugins
dragon dragonplayer
eventviews eventviews
ffmpegthumbs ffmpegthumbs
filelight filelight
gpgmepp gpgmepp5
granatier granatier
grantlee-editor grantlee-editor
grantleetheme grantleetheme
gwenview gwenview5
incidenceeditor incidenceeditor
kaccounts-integration kaccounts-integration
kaccounts-providers kaccounts-providers
kaddressbook kaddressbook
kalarm kalarm
kalarmcal kalarmcal
kalgebra kalgebra
kalzium kalzium
kanagram kanagram
kapman kapman
kapptemplate kapptemplate
kate kate
katomic katomic
kblackbox kblackbox
kblocks kblocks
kblog kblog
kbounce kbounce
kbreakout kbreakout
kbruch kbruch
kcachegrind kcachegrind
kcalc kcalc
kcalcore kcalcore
kcalutils kcalutils
kcharselect kcharselect
kcontacts kcontacts
kcron kcron
kde-baseapps kde-baseapps
kde-dev-scripts kde-dev-scripts
kdebugsettings kdebugsettings
kdeedu-data kdeedu-data
kdegraphics-thumbnailers kdegraphics-thumbnailers
kdenlive kdenlive
kdepim-addons kdepim-addons
kdepim-apps-libs kdepim-apps-libs
kdepim-runtime kdepim-runtime
kdesdk-thumbnailers kdesdk-thumbnailers
kdf kdf
kdgantt2 kdgantt2
kdiamond kdiamond
kdnssd kdnssd
kfloppy kfloppy
kfourinline kfourinline
kgeography kgeography
kget kget
kgoldrunner kgoldrunner
kgpg kgpg
khangman khangman
khelpcenter khelpcenter5
kholidays kholidays
kidentitymanagement kidentitymanagement
kig kig
kigo kigo
killbots killbots
kimap kimap
kio-extras kio-extras
kiriki kiriki
kiten kiten
kjumpingcube kjumpingcube
kldap kldap
kleopatra kleopatra5
klettres klettres
klickety klickety
klines klines
kmag kmag
kmahjongg kmahjongg
kmail kmail
kmail-account-wizard kmail-account-wizard
kmailtransport kmailtransport
kmbox kmbox
kmime kmime
kmines kmines
kmix kmix
kmousetool kmousetool
kmouth kmouth
kmplot kmplot
knavalbattle knavalbattle
knetwalk knetwalk
knotes knotes
kolf kolf
kollision kollision
kolourpaint kolourpaint
kompare kompare
konquest konquest
konsole konsole
kontact kontact
kontactinterface kontactinterface
kopete kopete
korganizer korganizer
kpat kpat
kpimtextedit kpimtextedit
kqtquickcharts kqtquickcharts
krdc krdc
kreversi kreversi
krfb krfb
kross-interpreters kross-interpreters
kruler kruler
kscd kscd
kshisen kshisen
ksirk ksirk
ksnakeduel ksnakeduel
kspaceduel kspaceduel
ksquares ksquares
kstars kstars
ksudoku ksudoku
ksystemlog ksystemlog
kteatime kteatime
ktimer ktimer
ktp-accounts-kcm ktp-accounts-kcm
ktp-approver ktp-approver
ktp-auth-handler ktp-auth-handler
ktp-common-internals ktp-common-internals
ktp-contact-list ktp-contact-list
ktp-contact-runner ktp-contact-runner
ktp-desktop-applets ktp-desktop-applets
ktp-filetransfer-handler ktp-filetransfer-handler
ktp-kded-module ktp-kded-module
ktp-send-file ktp-send-file
ktp-text-ui ktp-text-ui
ktuberling ktuberling
kturtle kturtle
kubrick kubrick
kuser kuser
kwordquiz kwordquiz
libgravatar libgravatar
libgravatar libgravatar
libkcddb libkcddb5
libkdcraw libkdcraw
libkdegames libkdegames
libkdepim libkdepim
libkeduvocdocument libkeduvocdocument
libkexiv2 libkexiv2
libkface libkface
libkgapi libkgapi
libkgeomap libkgeomap
libkipi libkipi
libkleo libkleo
libkmahjongg libkmahjongg
libkomparediff2 libkomparediff2
libksane libksane
libksieve libksieve
ktnef libktnef
prison libprison
lokalize lokalize
lskat lskat
mailcommon mailcommon
mailimporter mailimporter
marble marble
mbox-importer mbox-importer
messagelib messagelib
okteta okteta
okular okular5 frameworks
pairs pairs
palapeli palapeli
parley parley
picmi picmi
pim-data-exporter pim-data-exporter
pim-sieve-editor pim-sieve-editor
pim-storage-service-manager pim-storage-service-manager
pimcommon pimcommon
pimcommon pimcommon
print-manager kde-print-manager
rocs rocs
signon-kwallet-extension signon-kwallet-extension
spectacle spectacle
step step
svgpart svgpart
syndication syndication
umbrello umbrello frameworks
1 akonadi akonadi-server
2 akonadi-calendar akonadi-calendar
3 akonadi-calendar-tools akonadi-calendar-tools
4 akonadi-contacts akonadi-contacts
5 akonadi-import-wizard akonadi-import-wizard
6 akonadi-mime akonadi-mime
7 akonadi-notes akonadi-notes
8 akonadi-search akonadi-search
9 akonadiconsole akonadiconsole
10 akregator akregator
11 analitza analitza
12 ark ark
13 artikulate artikulate
14 baloo-widgets baloo5-widgets
15 blinken blinken
16 blogilo blogilo
17 bomber bomber
18 bovo bovo
19 calendarsupport calendarsupport
20 cantor cantor
21 cervisia cervisia
22 dolphin dolphin
23 dolphin-plugins dolphin-plugins
24 dragon dragonplayer
25 eventviews eventviews
26 ffmpegthumbs ffmpegthumbs
27 filelight filelight
28 gpgmepp gpgmepp5
29 granatier granatier
30 grantlee-editor grantlee-editor
31 grantleetheme grantleetheme
32 gwenview gwenview5
33 incidenceeditor incidenceeditor
34 kaccounts-integration kaccounts-integration
35 kaccounts-providers kaccounts-providers
36 kaddressbook kaddressbook
37 kalarm kalarm
38 kalarmcal kalarmcal
39 kalgebra kalgebra
40 kalzium kalzium
41 kanagram kanagram
42 kapman kapman
43 kapptemplate kapptemplate
44 kate kate
45 katomic katomic
46 kblackbox kblackbox
47 kblocks kblocks
48 kblog kblog
49 kbounce kbounce
50 kbreakout kbreakout
51 kbruch kbruch
52 kcachegrind kcachegrind
53 kcalc kcalc
54 kcalcore kcalcore
55 kcalutils kcalutils
56 kcharselect kcharselect
57 kcontacts kcontacts
58 kcron kcron
59 kde-baseapps kde-baseapps
60 kde-dev-scripts kde-dev-scripts
61 kdebugsettings kdebugsettings
62 kdeedu-data kdeedu-data
63 kdegraphics-thumbnailers kdegraphics-thumbnailers
64 kdenlive kdenlive
65 kdepim-addons kdepim-addons
66 kdepim-apps-libs kdepim-apps-libs
67 kdepim-runtime kdepim-runtime
68 kdesdk-thumbnailers kdesdk-thumbnailers
69 kdf kdf
70 kdgantt2 kdgantt2
71 kdiamond kdiamond
72 kdnssd kdnssd
73 kfloppy kfloppy
74 kfourinline kfourinline
75 kgeography kgeography
76 kget kget
77 kgoldrunner kgoldrunner
78 kgpg kgpg
79 khangman khangman
80 khelpcenter khelpcenter5
81 kholidays kholidays
82 kidentitymanagement kidentitymanagement
83 kig kig
84 kigo kigo
85 killbots killbots
86 kimap kimap
87 kio-extras kio-extras
88 kiriki kiriki
89 kiten kiten
90 kjumpingcube kjumpingcube
91 kldap kldap
92 kleopatra kleopatra5
93 klettres klettres
94 klickety klickety
95 klines klines
96 kmag kmag
97 kmahjongg kmahjongg
98 kmail kmail
99 kmail-account-wizard kmail-account-wizard
100 kmailtransport kmailtransport
101 kmbox kmbox
102 kmime kmime
103 kmines kmines
104 kmix kmix
105 kmousetool kmousetool
106 kmouth kmouth
107 kmplot kmplot
108 knavalbattle knavalbattle
109 knetwalk knetwalk
110 knotes knotes
111 kolf kolf
112 kollision kollision
113 kolourpaint kolourpaint
114 kompare kompare
115 konquest konquest
116 konsole konsole
117 kontact kontact
118 kontactinterface kontactinterface
119 kopete kopete
120 korganizer korganizer
121 kpat kpat
122 kpimtextedit kpimtextedit
123 kqtquickcharts kqtquickcharts
124 krdc krdc
125 kreversi kreversi
126 krfb krfb
127 kross-interpreters kross-interpreters
128 kruler kruler
129 kscd kscd
130 kshisen kshisen
131 ksirk ksirk
132 ksnakeduel ksnakeduel
133 kspaceduel kspaceduel
134 ksquares ksquares
135 kstars kstars
136 ksudoku ksudoku
137 ksystemlog ksystemlog
138 kteatime kteatime
139 ktimer ktimer
140 ktp-accounts-kcm ktp-accounts-kcm
141 ktp-approver ktp-approver
142 ktp-auth-handler ktp-auth-handler
143 ktp-common-internals ktp-common-internals
144 ktp-contact-list ktp-contact-list
145 ktp-contact-runner ktp-contact-runner
146 ktp-desktop-applets ktp-desktop-applets
147 ktp-filetransfer-handler ktp-filetransfer-handler
148 ktp-kded-module ktp-kded-module
149 ktp-send-file ktp-send-file
150 ktp-text-ui ktp-text-ui
151 ktuberling ktuberling
152 kturtle kturtle
153 kubrick kubrick
154 kuser kuser
155 kwordquiz kwordquiz
156 libgravatar libgravatar
157 libgravatar libgravatar
158 libkcddb libkcddb5
159 libkdcraw libkdcraw
160 libkdegames libkdegames
161 libkdepim libkdepim
162 libkeduvocdocument libkeduvocdocument
163 libkexiv2 libkexiv2
164 libkface libkface
165 libkgapi libkgapi
166 libkgeomap libkgeomap
167 libkipi libkipi
168 libkleo libkleo
169 libkmahjongg libkmahjongg
170 libkomparediff2 libkomparediff2
171 libksane libksane
172 libksieve libksieve
173 ktnef libktnef
174 prison libprison
175 lokalize lokalize
176 lskat lskat
177 mailcommon mailcommon
178 mailimporter mailimporter
179 marble marble
180 mbox-importer mbox-importer
181 messagelib messagelib
182 okteta okteta
183 okular okular5 frameworks
184 pairs pairs
185 palapeli palapeli
186 parley parley
187 picmi picmi
188 pim-data-exporter pim-data-exporter
189 pim-sieve-editor pim-sieve-editor
190 pim-storage-service-manager pim-storage-service-manager
191 pimcommon pimcommon
192 pimcommon pimcommon
193 print-manager kde-print-manager
194 rocs rocs
195 signon-kwallet-extension signon-kwallet-extension
196 spectacle spectacle
197 step step
198 svgpart svgpart
199 syndication syndication
200 umbrello umbrello frameworks

148
kde_unstable_frameworks.csv Normal file
View file

@ -0,0 +1,148 @@
attica-qt5
baloo5
bluedevil5
bluez-qt
breeze
breeze4-style
breeze5-icons
breeze-gtk
cmake
cmake-gui
discover
extra-cmake-modules
frameworkintegration
gpgmepp5
grub2-theme-breeze
hack-fonts
kaccounts-aggregate
kactivities5
kactivities-stats
kactivitymanagerd
kapidox
karchive
kauth
kbookmarks
kcm_sddm
kcmutils
kcodecs
kcompletion
kconfig
kconfigwidgets
kcoreaddons
kcrash
kdbusaddons
kdeclarative
kde-cli-tools5
kded
kde-gtk-config5
kdelibs4support
kde-oxygen-fonts
kdesignerplugin
kdesu
kde-user-manager
kdewebkit
kdnssd-framework
kdoctools
kemoticons
kf5-filesystem
kfilemetadata5
kgamma5
kglobalaccel
kguiaddons
khelpcenter5
khotkeys5
khtml
ki18n
kiconthemes
kidletime
kimageformats
kinfocenter5
kinit
kio
kio-extras5
kirigami
kitemmodels
kitemviews
kjobwidgets
kjs
kjsembed
kmediaplayer
kmenuedit5
knewstuff
knotifications
knotifyconfig
kpackage
kparts
kpeople5
kplotting
kpty
kross
krunner
kscreen5
kscreenlocker
kservice
ksshaskpass5
ksysguard5
ktexteditor
ktextwidgets
kunitconversion
kwallet
kwalletmanager5
kwayland
kwayland-integration
kwidgetsaddons
kwin5
kwindowsystem
kwrited5
kxmlgui
kxmlrpcclient5
libepoxy
libkdecoration2
libKF5ModemManagerQt
libKF5NetworkManagerQt
libkscreen2
libksysguard5
libraw
milou5
oxygen4
oxygen5
oxygen5-icon-theme
PackageKit-Qt5
phonon4qt5
phonon4qt5-backend-gstreamer
phonon4qt5-backend-vlc
plasma5-addons
plasma5-desktop
plasma5-integration
plasma5-mediacenter
plasma5-openSUSE
plasma5-pa
plasma5-pk-updates
plasma5-sdk
plasma5-session
plasma5-workspace
plasma5-workspace-wallpapers
plasma-framework
plasma-nm5
plymouth-theme-breeze
polkit-default-privs
polkit-kde-agent-5
polkit-qt5-1
poppler
poppler-qt
poppler-qt5
powerdevil5
purpose
rpmlint
rpmlint-Factory
rpmlint-mini
sddm
sni-qt
solid
solid-power
sonnet
sprinter
sprinter-plugins
systemsettings5
taglib
threadweaver
1 attica-qt5
2 baloo5
3 bluedevil5
4 bluez-qt
5 breeze
6 breeze4-style
7 breeze5-icons
8 breeze-gtk
9 cmake
10 cmake-gui
11 discover
12 extra-cmake-modules
13 frameworkintegration
14 gpgmepp5
15 grub2-theme-breeze
16 hack-fonts
17 kaccounts-aggregate
18 kactivities5
19 kactivities-stats
20 kactivitymanagerd
21 kapidox
22 karchive
23 kauth
24 kbookmarks
25 kcm_sddm
26 kcmutils
27 kcodecs
28 kcompletion
29 kconfig
30 kconfigwidgets
31 kcoreaddons
32 kcrash
33 kdbusaddons
34 kdeclarative
35 kde-cli-tools5
36 kded
37 kde-gtk-config5
38 kdelibs4support
39 kde-oxygen-fonts
40 kdesignerplugin
41 kdesu
42 kde-user-manager
43 kdewebkit
44 kdnssd-framework
45 kdoctools
46 kemoticons
47 kf5-filesystem
48 kfilemetadata5
49 kgamma5
50 kglobalaccel
51 kguiaddons
52 khelpcenter5
53 khotkeys5
54 khtml
55 ki18n
56 kiconthemes
57 kidletime
58 kimageformats
59 kinfocenter5
60 kinit
61 kio
62 kio-extras5
63 kirigami
64 kitemmodels
65 kitemviews
66 kjobwidgets
67 kjs
68 kjsembed
69 kmediaplayer
70 kmenuedit5
71 knewstuff
72 knotifications
73 knotifyconfig
74 kpackage
75 kparts
76 kpeople5
77 kplotting
78 kpty
79 kross
80 krunner
81 kscreen5
82 kscreenlocker
83 kservice
84 ksshaskpass5
85 ksysguard5
86 ktexteditor
87 ktextwidgets
88 kunitconversion
89 kwallet
90 kwalletmanager5
91 kwayland
92 kwayland-integration
93 kwidgetsaddons
94 kwin5
95 kwindowsystem
96 kwrited5
97 kxmlgui
98 kxmlrpcclient5
99 libepoxy
100 libkdecoration2
101 libKF5ModemManagerQt
102 libKF5NetworkManagerQt
103 libkscreen2
104 libksysguard5
105 libraw
106 milou5
107 oxygen4
108 oxygen5
109 oxygen5-icon-theme
110 PackageKit-Qt5
111 phonon4qt5
112 phonon4qt5-backend-gstreamer
113 phonon4qt5-backend-vlc
114 plasma5-addons
115 plasma5-desktop
116 plasma5-integration
117 plasma5-mediacenter
118 plasma5-openSUSE
119 plasma5-pa
120 plasma5-pk-updates
121 plasma5-sdk
122 plasma5-session
123 plasma5-workspace
124 plasma5-workspace-wallpapers
125 plasma-framework
126 plasma-nm5
127 plymouth-theme-breeze
128 polkit-default-privs
129 polkit-kde-agent-5
130 polkit-qt5-1
131 poppler
132 poppler-qt
133 poppler-qt5
134 powerdevil5
135 purpose
136 rpmlint
137 rpmlint-Factory
138 rpmlint-mini
139 sddm
140 sni-qt
141 solid
142 solid-power
143 sonnet
144 sprinter
145 sprinter-plugins
146 systemsettings5
147 taglib
148 threadweaver

132
update_unstable.py Normal file
View file

@ -0,0 +1,132 @@
#!/usr/bin/env python3
import argparse
import csv
import logging
from pathlib import Path
import pickle
import git
import sarge
logging.basicConfig(format='%(levelname)s:%(message)s',
level=logging.DEBUG)
class GitHashCache:
def __init__(self, cache_file):
self.cache = cache_file
self._data = dict()
def __getitem__(self, key):
if key not in self._data:
return ""
return self._data[key]
def __setitem__(self, key, value):
self._data[key] = value
def save(self):
logging.debug("Saving pickled data")
with open(self.cache, "wb") as handle:
pickle.dump(self._data, handle, pickle.HIGHEST_PROTOCOL)
def load(self):
if not Path(self.cache).exists():
logging.debug("File cache not found, not loading")
return
logging.debug("Saving pickled data")
with open(self.cache, "rb") as handle:
self._data = pickle.load(handle)
def lsremote(url):
remote_refs = {}
g = git.cmd.Git()
for ref in g.ls_remote(url).split('\n'):
hash_ref_list = ref.split('\t')
remote_refs[hash_ref_list[1]] = hash_ref_list[0]
return remote_refs
def get_remote_hash(url, branch="master"):
refs = "refs/heads/{}".format(branch)
return lsremote(url)[refs]
def run_osc(repository, package_name):
cmd = "osc service remoterun {0} {1}"
cmd = cmd.format(repository, package_name)
logging.debug("Running {}".format(cmd))
# pid = sarge.run(cmd)
# if pid.returncode != 0:
# logging.error("Error during service run, package {}".format(
# package_name))
logging.debug("Package {} complete".format(package_name))
def update_package(hash_data, package_name, remote_name, obs_repository,
branch):
repo_name = "kde:{}".format(remote_name)
remote_hash = get_remote_hash(repo_name, branch)
current_hash = hash_data[remote_name]
logging.debug("Package {}, theirs {}, ours {}".format(remote_name,
remote_hash, current_hash))
if remote_hash != current_hash:
logging.debug("Hash doesn't match, updating")
run_osc(obs_repository, package_name)
# hash_data[remote_name] = remote_hash
def update_packages(cache_file, obs_repository, repo_mapping_file):
hash_data = GitHashCache(cache_file)
hash_data.load()
logging.info("Updating packages for {}".format(obs_repository))
with open(repo_mapping_file, "r") as mapping:
reader = csv.reader(mapping, delimiter="\t")
for row in reader:
kde_name, obs_name, branch = row
branch = "master" if not branch else branch
logging.debug("Updating package {} ({})".format(kde_name,
obs_name))
logging.debug("Using branch {}".format(branch))
update_package(hash_data, obs_name, kde_name, obs_repository,
branch)
logging.debug("Saving data")
hash_data.save()
def main():
parser = argparse.ArgumentParser()
parser.add_argument("repository", help="OBS repository to use")
parser.add_argument("mapping_file", help="KDE:OBS repository mapping file")
options = parser.parse_args()
cache_file = Path.home() / ".local/share/obs_{}_cache".format(options.repository)
cache_file = str(cache_file)
update_packages(cache_file, options.repository, options.mapping_file)
logging.info("Complete")
if __name__ == "__main__":
main()