Skip to content

Instantly share code, notes, and snippets.

@detrout
Last active December 17, 2015 19:19
Show Gist options
  • Save detrout/5659143 to your computer and use it in GitHub Desktop.
Save detrout/5659143 to your computer and use it in GitHub Desktop.
{
"metadata": {
"name": "outdated"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "code",
"collapsed": false,
"input": [
"import imp\n",
"import numpy as np\n",
"import os\n",
"import pandas as pd\n",
"import re\n",
"\n",
"from lxml.html import parse\n",
"from debian.debian_support import NativeVersion\n",
"\n",
"from ooddr import pdood\n",
"from ooddr import watch\n",
"from ooddr import changelog"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 15
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# be ready to reload stuff i'm hacking on\n",
"imp.reload(pdood)\n",
"imp.reload(watch)\n",
"imp.reload(changelog)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "pyout",
"prompt_number": 16,
"text": [
"<module 'ooddr.changelog' from 'ooddr/changelog.py'>"
]
}
],
"prompt_number": 16
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"myrepo = '/var/cache/pbuilder/diane/wheezy/dists/wheezy/main/binary-amd64/Packages'\n",
"sc_tree = '/home/diane/kde/src/kde-sc'\n",
"telepathy_tree = '/home/diane/kde/src/kde-telepathy'\n",
"extras_tree = '/home/diane/kde/src/kde-extras'\n",
"downloads = '/home/diane/kde/src/kde-sc/src-4.10'\n",
"telepathy_downloads = '/home/diane/kde/src/kde-telepathy/src'"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 17
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h2>Find package metadata</h2>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# find all the project directories\n",
"debian_dirs = pdood.find_debian_files([sc_tree, telepathy_tree, extras_tree])"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 18
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# import control / changelog information\n",
"sourcepkg, pkgneeds, pkgbinaries = pdood.build_package_tables(debian_dirs)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stderr",
"text": [
"deb822.py: WARNING: cannot parse package relationship \"\", returning it raw\n",
"deb822.py: WARNING: cannot parse package relationship \"\", returning it raw\n",
"deb822.py: WARNING: cannot parse package relationship \"\", returning it raw"
]
},
{
"output_type": "stream",
"stream": "stderr",
"text": [
"\n",
"deb822.py: WARNING: cannot parse package relationship \"\", returning it raw\n",
"deb822.py: WARNING: cannot parse package relationship \"\", returning it raw"
]
},
{
"output_type": "stream",
"stream": "stderr",
"text": [
"\n",
"deb822.py: WARNING: cannot parse package relationship \"\", returning it raw"
]
},
{
"output_type": "stream",
"stream": "stderr",
"text": [
"\n",
"deb822.py: WARNING: cannot parse package relationship \"\", returning it raw\n",
"deb822.py: WARNING: cannot parse package relationship \"\", returning it raw\n",
"deb822.py: WARNING: cannot parse package relationship \"\", returning it raw\n",
"deb822.py: WARNING: cannot parse package relationship \"\", returning it raw\n",
"deb822.py: WARNING: cannot parse package relationship \"\", returning it raw\n",
"deb822.py: WARNING: cannot parse package relationship \"\", returning it raw\n",
"deb822.py: WARNING: cannot parse package relationship \"\", returning it raw"
]
},
{
"output_type": "stream",
"stream": "stderr",
"text": [
"\n",
"deb822.py: WARNING: cannot parse package relationship \"\", returning it raw\n",
"deb822.py: WARNING: cannot parse package relationship \"\", returning it raw\n",
"deb822.py: WARNING: cannot parse package relationship \"\", returning it raw\n",
"deb822.py: WARNING: cannot parse package relationship \"\", returning it raw\n",
"deb822.py: WARNING: cannot parse package relationship \"\", returning it raw"
]
},
{
"output_type": "stream",
"stream": "stderr",
"text": [
"\n",
"deb822.py: WARNING: cannot parse package relationship \"\", returning it raw\n",
"deb822.py: WARNING: cannot parse package relationship \"\", returning it raw\n",
"deb822.py: WARNING: cannot parse package relationship \"\", returning it raw\n"
]
}
],
"prompt_number": 19
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# update watch class with local file references\n",
"def find_file(x, filelist, downloads):\n",
" if x:\n",
" try:\n",
" return x.scan_local_filelist(filelist, downloads)\n",
" except ValueError as e:\n",
" print('Problem with:',x)\n",
" return None\n",
" \n",
"files = os.listdir(downloads)\n",
"_ = sourcepkg.Watch.map(lambda x: find_file(x, files, downloads))"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 20
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# extract a version from the changelog class\n",
"sourcepkg['NativeVersion'] = sourcepkg.Version.map(lambda x: NativeVersion(x.upstream_version))\n",
"\n",
"# extract version number from the watch map\n",
"sourcepkg['WatchVersion'] = sourcepkg.Watch.map(lambda x: NativeVersion(x.version) if x else None)"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 21
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h2>Packages without watch files</h2>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"sourcepkg[pd.isnull(sourcepkg.WatchVersion)][['Source']]"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Source</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>43 </th>\n",
" <td> debconf-kde</td>\n",
" </tr>\n",
" <tr>\n",
" <th>46 </th>\n",
" <td> pkg-kde-tools</td>\n",
" </tr>\n",
" <tr>\n",
" <th>56 </th>\n",
" <td> meta-kde</td>\n",
" </tr>\n",
" <tr>\n",
" <th>85 </th>\n",
" <td> oxygencursors</td>\n",
" </tr>\n",
" <tr>\n",
" <th>86 </th>\n",
" <td> kde-l10n</td>\n",
" </tr>\n",
" <tr>\n",
" <th>106</th>\n",
" <td> libksane</td>\n",
" </tr>\n",
" <tr>\n",
" <th>113</th>\n",
" <td> kanagram</td>\n",
" </tr>\n",
" <tr>\n",
" <th>114</th>\n",
" <td> khangman</td>\n",
" </tr>\n",
" <tr>\n",
" <th>119</th>\n",
" <td> kturtle</td>\n",
" </tr>\n",
" <tr>\n",
" <th>124</th>\n",
" <td> kgeography</td>\n",
" </tr>\n",
" <tr>\n",
" <th>131</th>\n",
" <td> marble</td>\n",
" </tr>\n",
" <tr>\n",
" <th>150</th>\n",
" <td> meta-kde-telepathy</td>\n",
" </tr>\n",
" <tr>\n",
" <th>155</th>\n",
" <td> ktp-contact-applet</td>\n",
" </tr>\n",
" <tr>\n",
" <th>157</th>\n",
" <td> qt-gstreamer</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"output_type": "pyout",
"prompt_number": 22,
"text": [
" Source\n",
"43 debconf-kde\n",
"46 pkg-kde-tools\n",
"56 meta-kde\n",
"85 oxygencursors\n",
"86 kde-l10n\n",
"106 libksane\n",
"113 kanagram\n",
"114 khangman\n",
"119 kturtle\n",
"124 kgeography\n",
"131 marble\n",
"150 meta-kde-telepathy\n",
"155 ktp-contact-applet\n",
"157 qt-gstreamer"
]
}
],
"prompt_number": 22
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h2>Packages that have newer source downloaded</h2>\n",
"\n",
"I manually downloaded all the source archive to a cache directory, \n",
"My watch file parser has some capabilities for matching url patterns \n",
"to the local filesystem."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"print ('Todo:', len(sourcepkg[sourcepkg.NativeVersion < sourcepkg.WatchVersion]))\n",
"sourcepkg[sourcepkg.NativeVersion < sourcepkg.WatchVersion][['Source', 'NativeVersion', 'WatchVersion']]"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Todo: 32\n"
]
},
{
"html": [
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Source</th>\n",
" <th>NativeVersion</th>\n",
" <th>WatchVersion</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>84 </th>\n",
" <td> soprano</td>\n",
" <td> 2.9.0+dfsg1</td>\n",
" <td> None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>117</th>\n",
" <td> libindi</td>\n",
" <td> 0.9.1</td>\n",
" <td> 0.9.6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>118</th>\n",
" <td> rocs</td>\n",
" <td> 4.8.4</td>\n",
" <td> 4.10.2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>123</th>\n",
" <td> parley</td>\n",
" <td> 4.8.4</td>\n",
" <td> 4.10.2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>127</th>\n",
" <td> step</td>\n",
" <td> 4.8.4</td>\n",
" <td> 4.10.2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>132</th>\n",
" <td> kwordquiz</td>\n",
" <td> 4.8.4</td>\n",
" <td> 4.10.2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>134</th>\n",
" <td> kmplot</td>\n",
" <td> 4.8.4</td>\n",
" <td> 4.10.2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>143</th>\n",
" <td> telepathy-logger-qt</td>\n",
" <td> 0.6.0</td>\n",
" <td> None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>144</th>\n",
" <td> ktp-contact-runner</td>\n",
" <td> 0.5.1</td>\n",
" <td> None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>145</th>\n",
" <td> ktp-common-internals</td>\n",
" <td> 0.6.2</td>\n",
" <td> None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>146</th>\n",
" <td> telepathy-gabble</td>\n",
" <td> 0.16.5</td>\n",
" <td> None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>147</th>\n",
" <td> ktp-filetransfer-handler</td>\n",
" <td> 0.6.1</td>\n",
" <td> None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>148</th>\n",
" <td> ktp-desktop-applets</td>\n",
" <td> 0.6.1</td>\n",
" <td> None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>149</th>\n",
" <td> ktp-approver</td>\n",
" <td> 0.6.2</td>\n",
" <td> None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>151</th>\n",
" <td> telepathy-farstream</td>\n",
" <td> 0.6.0</td>\n",
" <td> None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>152</th>\n",
" <td> telepathy-glib</td>\n",
" <td> 0.20.1</td>\n",
" <td> None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>153</th>\n",
" <td> telepathy-qt</td>\n",
" <td> 0.9.3</td>\n",
" <td> None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>154</th>\n",
" <td> farstream</td>\n",
" <td> 0.1.2</td>\n",
" <td> None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>156</th>\n",
" <td> ktp-presence-applet</td>\n",
" <td> 0.5.3</td>\n",
" <td> None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>158</th>\n",
" <td> ktp-accounts-kcm</td>\n",
" <td> 0.6.2</td>\n",
" <td> None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>159</th>\n",
" <td> ktp-kded-integration-module</td>\n",
" <td> 0.6.1</td>\n",
" <td> None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>160</th>\n",
" <td> libnice</td>\n",
" <td> 0.1.4</td>\n",
" <td> None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>161</th>\n",
" <td> ktp-send-file</td>\n",
" <td> 0.6.1</td>\n",
" <td> None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>162</th>\n",
" <td> ktp-auth-handler</td>\n",
" <td> 0.6.2</td>\n",
" <td> None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>163</th>\n",
" <td> ktp-call-ui</td>\n",
" <td> 0.6.2</td>\n",
" <td> None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>164</th>\n",
" <td> ktp-contact-list</td>\n",
" <td> 0.6.2</td>\n",
" <td> None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>165</th>\n",
" <td> farstream</td>\n",
" <td> 0.2.3</td>\n",
" <td> None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>166</th>\n",
" <td> ktp-text-ui</td>\n",
" <td> 0.6.2.1</td>\n",
" <td> None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>167</th>\n",
" <td> bluedevil</td>\n",
" <td> 1.3.1</td>\n",
" <td> None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>168</th>\n",
" <td> libbluedevil</td>\n",
" <td> 1.9.3</td>\n",
" <td> None</td>\n",
" </tr>\n",
" <tr>\n",
" <th>169</th>\n",
" <td> amarok</td>\n",
" <td> 2.6.0</td>\n",
" <td> .</td>\n",
" </tr>\n",
" <tr>\n",
" <th>170</th>\n",
" <td> konversation</td>\n",
" <td> 1.4</td>\n",
" <td> None</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"output_type": "pyout",
"prompt_number": 23,
"text": [
" Source NativeVersion WatchVersion\n",
"84 soprano 2.9.0+dfsg1 None\n",
"117 libindi 0.9.1 0.9.6\n",
"118 rocs 4.8.4 4.10.2\n",
"123 parley 4.8.4 4.10.2\n",
"127 step 4.8.4 4.10.2\n",
"132 kwordquiz 4.8.4 4.10.2\n",
"134 kmplot 4.8.4 4.10.2\n",
"143 telepathy-logger-qt 0.6.0 None\n",
"144 ktp-contact-runner 0.5.1 None\n",
"145 ktp-common-internals 0.6.2 None\n",
"146 telepathy-gabble 0.16.5 None\n",
"147 ktp-filetransfer-handler 0.6.1 None\n",
"148 ktp-desktop-applets 0.6.1 None\n",
"149 ktp-approver 0.6.2 None\n",
"151 telepathy-farstream 0.6.0 None\n",
"152 telepathy-glib 0.20.1 None\n",
"153 telepathy-qt 0.9.3 None\n",
"154 farstream 0.1.2 None\n",
"156 ktp-presence-applet 0.5.3 None\n",
"158 ktp-accounts-kcm 0.6.2 None\n",
"159 ktp-kded-integration-module 0.6.1 None\n",
"160 libnice 0.1.4 None\n",
"161 ktp-send-file 0.6.1 None\n",
"162 ktp-auth-handler 0.6.2 None\n",
"163 ktp-call-ui 0.6.2 None\n",
"164 ktp-contact-list 0.6.2 None\n",
"165 farstream 0.2.3 None\n",
"166 ktp-text-ui 0.6.2.1 None\n",
"167 bluedevil 1.3.1 None\n",
"168 libbluedevil 1.9.3 None\n",
"169 amarok 2.6.0 .\n",
"170 konversation 1.4 None"
]
}
],
"prompt_number": 23
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h2>Look for old build files</h2>\n",
"\n",
"As you develop you eventually end up with bunches of .dsc and sources.build sources.changes files. It'd be \n",
"nice to have utilities to help clean those up."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# get dsc list\n",
"dscs, dsc_files = pdood.build_dsc_tables(debian_dirs)\n",
"# Mix in the current source tree version numbers\n",
"dsc_status = pd.merge(dsc_files, sourcepkg[['Source', 'NativeVersion']], on='Source')\n",
"# list what build files are no longer needed.\n",
"dsc_status[dsc_status.NativeVersion > dsc_status.Version]"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Source</th>\n",
" <th>Version</th>\n",
" <th>md5sum</th>\n",
" <th>name</th>\n",
" <th>sha1</th>\n",
" <th>sha256</th>\n",
" <th>size</th>\n",
" <th>NativeVersion</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>83 </th>\n",
" <td> pkg-kde-tools</td>\n",
" <td> 0.15.5</td>\n",
" <td> 69cee644e9d6262e34045dfe16f59f67</td>\n",
" <td> pkg-kde-tools_0.15.5.tar.bz2</td>\n",
" <td> ce1d0eaf17a51a9b1b7a20641bd959b9e663bd59</td>\n",
" <td> fa132c81b553a96c7ab5d2526585fb7b01157a0c16686e...</td>\n",
" <td> 102416</td>\n",
" <td> 0.15.6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>84 </th>\n",
" <td> pkg-kde-tools</td>\n",
" <td> 0.15.5</td>\n",
" <td> NaN</td>\n",
" <td> /home/diane/kde/src/kde-sc/pkg-kde-tools_0.15....</td>\n",
" <td> NaN</td>\n",
" <td> NaN</td>\n",
" <td> NaN</td>\n",
" <td> 0.15.6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>85 </th>\n",
" <td> pkg-kde-tools</td>\n",
" <td> 0.15.5</td>\n",
" <td> NaN</td>\n",
" <td> /home/diane/kde/src/kde-sc/pkg-kde-tools_0.15....</td>\n",
" <td> NaN</td>\n",
" <td> NaN</td>\n",
" <td> NaN</td>\n",
" <td> 0.15.6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>435</th>\n",
" <td> soprano</td>\n",
" <td> 2.9.0</td>\n",
" <td> NaN</td>\n",
" <td> /home/diane/kde/src/kde-sc/nepomuk/soprano_2.9...</td>\n",
" <td> NaN</td>\n",
" <td> NaN</td>\n",
" <td> NaN</td>\n",
" <td> 2.9.0+dfsg1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>436</th>\n",
" <td> soprano</td>\n",
" <td> 2.9.0</td>\n",
" <td> 636a302a16b1b9b7757f932d076d8298</td>\n",
" <td> soprano_2.9.0.debian.tar.gz</td>\n",
" <td> 302130bcf008a730484643093d44548d3e3c9952</td>\n",
" <td> 49c501c54198fd933d5bdbaf3d6e778d9608597268c9d3...</td>\n",
" <td> 28782</td>\n",
" <td> 2.9.0+dfsg1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>437</th>\n",
" <td> soprano</td>\n",
" <td> 2.9.0</td>\n",
" <td> 90134eaaf40b6663dd01cfaefdaba7fb</td>\n",
" <td> soprano_2.9.0.orig.tar.bz2</td>\n",
" <td> 2bc0e0874f115c97a34d0bf267a1c31957ec7497</td>\n",
" <td> b39323386ede0ed4e8e278540fb9e2725b9f486bbc3975...</td>\n",
" <td> 1956448</td>\n",
" <td> 2.9.0+dfsg1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>438</th>\n",
" <td> soprano</td>\n",
" <td> 2.9.0</td>\n",
" <td> NaN</td>\n",
" <td> /home/diane/kde/src/kde-sc/nepomuk/soprano_2.9...</td>\n",
" <td> NaN</td>\n",
" <td> NaN</td>\n",
" <td> NaN</td>\n",
" <td> 2.9.0+dfsg1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>673</th>\n",
" <td> meta-kde-telepathy</td>\n",
" <td> 0.4.0</td>\n",
" <td> NaN</td>\n",
" <td> /home/diane/kde/src/kde-telepathy/meta-kde-tel...</td>\n",
" <td> NaN</td>\n",
" <td> NaN</td>\n",
" <td> NaN</td>\n",
" <td> 0.6.1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>674</th>\n",
" <td> meta-kde-telepathy</td>\n",
" <td> 0.4.0</td>\n",
" <td> NaN</td>\n",
" <td> /home/diane/kde/src/kde-telepathy/meta-kde-tel...</td>\n",
" <td> NaN</td>\n",
" <td> NaN</td>\n",
" <td> NaN</td>\n",
" <td> 0.6.1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>675</th>\n",
" <td> meta-kde-telepathy</td>\n",
" <td> 0.4.0</td>\n",
" <td> 868727d9720981c4418a275fe5420d79</td>\n",
" <td> meta-kde-telepathy_0.4.0.tar.gz</td>\n",
" <td> 2e718bd0960cfffc5cf0967fb4d4e85831dfe8cb</td>\n",
" <td> 7db0b4c7403202e4c5d0453249b0ae9a691f2b0606ea27...</td>\n",
" <td> 1914</td>\n",
" <td> 0.6.1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>677</th>\n",
" <td> farstream</td>\n",
" <td> 0.1.2-1</td>\n",
" <td> 5d6e561b3688d0d0c8906fec4f356df3</td>\n",
" <td> farstream_0.1.2.orig.tar.gz</td>\n",
" <td> e0b9519bd334305fa3b406e4f6e6d5ed262b63aa</td>\n",
" <td> fa5a40597b47b59d124f7fd57f66704b030d576cdc0d90...</td>\n",
" <td> 1265972</td>\n",
" <td> 0.2.3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>679</th>\n",
" <td> farstream</td>\n",
" <td> 0.1.2-1</td>\n",
" <td> 9be89090dbe09ffe8e0c002345b1eb41</td>\n",
" <td> farstream_0.1.2-1.debian.tar.gz</td>\n",
" <td> 7ba505a77a68c2fca70900accdbc96fd8e116eb2</td>\n",
" <td> 521708dec40cbb44a545f6ae666a23c7235d47d8dae337...</td>\n",
" <td> 6784</td>\n",
" <td> 0.2.3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>702</th>\n",
" <td> libnice</td>\n",
" <td> 0.1.3-1</td>\n",
" <td> NaN</td>\n",
" <td> /home/diane/kde/src/kde-telepathy/libnice_0.1....</td>\n",
" <td> NaN</td>\n",
" <td> NaN</td>\n",
" <td> NaN</td>\n",
" <td> 0.1.4</td>\n",
" </tr>\n",
" <tr>\n",
" <th>703</th>\n",
" <td> libnice</td>\n",
" <td> 0.1.3-1</td>\n",
" <td> 1a0907605f852dcda32a3b3daf38d36c</td>\n",
" <td> libnice_0.1.3.orig.tar.gz</td>\n",
" <td> 3e022ff7d20b26b74020fda51664ebf5d7e4f949</td>\n",
" <td> 046ce11f66638b54f2e042e7b1fbcc537ec99c27185fb0...</td>\n",
" <td> 672174</td>\n",
" <td> 0.1.4</td>\n",
" </tr>\n",
" <tr>\n",
" <th>704</th>\n",
" <td> libnice</td>\n",
" <td> 0.1.3-1</td>\n",
" <td> 8ea64bb6b84215aeb6f651f0499a600a</td>\n",
" <td> libnice_0.1.3-1.debian.tar.gz</td>\n",
" <td> 2799a61e5a19302a1bf1699e5fdd044797616412</td>\n",
" <td> d713ecaa76f312f4a343a056efb3c1c9fa271f5f0fb0e9...</td>\n",
" <td> 15168</td>\n",
" <td> 0.1.4</td>\n",
" </tr>\n",
" <tr>\n",
" <th>705</th>\n",
" <td> libnice</td>\n",
" <td> 0.1.3-1</td>\n",
" <td> NaN</td>\n",
" <td> /home/diane/kde/src/kde-telepathy/libnice_0.1....</td>\n",
" <td> NaN</td>\n",
" <td> NaN</td>\n",
" <td> NaN</td>\n",
" <td> 0.1.4</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"output_type": "pyout",
"prompt_number": 24,
"text": [
" Source Version md5sum \\\n",
"83 pkg-kde-tools 0.15.5 69cee644e9d6262e34045dfe16f59f67 \n",
"84 pkg-kde-tools 0.15.5 NaN \n",
"85 pkg-kde-tools 0.15.5 NaN \n",
"435 soprano 2.9.0 NaN \n",
"436 soprano 2.9.0 636a302a16b1b9b7757f932d076d8298 \n",
"437 soprano 2.9.0 90134eaaf40b6663dd01cfaefdaba7fb \n",
"438 soprano 2.9.0 NaN \n",
"673 meta-kde-telepathy 0.4.0 NaN \n",
"674 meta-kde-telepathy 0.4.0 NaN \n",
"675 meta-kde-telepathy 0.4.0 868727d9720981c4418a275fe5420d79 \n",
"677 farstream 0.1.2-1 5d6e561b3688d0d0c8906fec4f356df3 \n",
"679 farstream 0.1.2-1 9be89090dbe09ffe8e0c002345b1eb41 \n",
"702 libnice 0.1.3-1 NaN \n",
"703 libnice 0.1.3-1 1a0907605f852dcda32a3b3daf38d36c \n",
"704 libnice 0.1.3-1 8ea64bb6b84215aeb6f651f0499a600a \n",
"705 libnice 0.1.3-1 NaN \n",
"\n",
" name \\\n",
"83 pkg-kde-tools_0.15.5.tar.bz2 \n",
"84 /home/diane/kde/src/kde-sc/pkg-kde-tools_0.15.... \n",
"85 /home/diane/kde/src/kde-sc/pkg-kde-tools_0.15.... \n",
"435 /home/diane/kde/src/kde-sc/nepomuk/soprano_2.9... \n",
"436 soprano_2.9.0.debian.tar.gz \n",
"437 soprano_2.9.0.orig.tar.bz2 \n",
"438 /home/diane/kde/src/kde-sc/nepomuk/soprano_2.9... \n",
"673 /home/diane/kde/src/kde-telepathy/meta-kde-tel... \n",
"674 /home/diane/kde/src/kde-telepathy/meta-kde-tel... \n",
"675 meta-kde-telepathy_0.4.0.tar.gz \n",
"677 farstream_0.1.2.orig.tar.gz \n",
"679 farstream_0.1.2-1.debian.tar.gz \n",
"702 /home/diane/kde/src/kde-telepathy/libnice_0.1.... \n",
"703 libnice_0.1.3.orig.tar.gz \n",
"704 libnice_0.1.3-1.debian.tar.gz \n",
"705 /home/diane/kde/src/kde-telepathy/libnice_0.1.... \n",
"\n",
" sha1 \\\n",
"83 ce1d0eaf17a51a9b1b7a20641bd959b9e663bd59 \n",
"84 NaN \n",
"85 NaN \n",
"435 NaN \n",
"436 302130bcf008a730484643093d44548d3e3c9952 \n",
"437 2bc0e0874f115c97a34d0bf267a1c31957ec7497 \n",
"438 NaN \n",
"673 NaN \n",
"674 NaN \n",
"675 2e718bd0960cfffc5cf0967fb4d4e85831dfe8cb \n",
"677 e0b9519bd334305fa3b406e4f6e6d5ed262b63aa \n",
"679 7ba505a77a68c2fca70900accdbc96fd8e116eb2 \n",
"702 NaN \n",
"703 3e022ff7d20b26b74020fda51664ebf5d7e4f949 \n",
"704 2799a61e5a19302a1bf1699e5fdd044797616412 \n",
"705 NaN \n",
"\n",
" sha256 size NativeVersion \n",
"83 fa132c81b553a96c7ab5d2526585fb7b01157a0c16686e... 102416 0.15.6 \n",
"84 NaN NaN 0.15.6 \n",
"85 NaN NaN 0.15.6 \n",
"435 NaN NaN 2.9.0+dfsg1 \n",
"436 49c501c54198fd933d5bdbaf3d6e778d9608597268c9d3... 28782 2.9.0+dfsg1 \n",
"437 b39323386ede0ed4e8e278540fb9e2725b9f486bbc3975... 1956448 2.9.0+dfsg1 \n",
"438 NaN NaN 2.9.0+dfsg1 \n",
"673 NaN NaN 0.6.1 \n",
"674 NaN NaN 0.6.1 \n",
"675 7db0b4c7403202e4c5d0453249b0ae9a691f2b0606ea27... 1914 0.6.1 \n",
"677 fa5a40597b47b59d124f7fd57f66704b030d576cdc0d90... 1265972 0.2.3 \n",
"679 521708dec40cbb44a545f6ae666a23c7235d47d8dae337... 6784 0.2.3 \n",
"702 NaN NaN 0.1.4 \n",
"703 046ce11f66638b54f2e042e7b1fbcc537ec99c27185fb0... 672174 0.1.4 \n",
"704 d713ecaa76f312f4a343a056efb3c1c9fa271f5f0fb0e9... 15168 0.1.4 \n",
"705 NaN NaN 0.1.4 "
]
}
],
"prompt_number": 24
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h2>Packages ready for re-compiling</h2>\n",
" \n",
"Their source tree is newer than whats in the repository "
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"columns = ['Source', 'Version_src', 'Version_repo'] \n",
"repository = pdood.build_repository_table(myrepo)\n",
"print(pdood.find_has_newer_source(sourcepkg, pkgbinaries, repository)[columns].drop_duplicates())"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
" Source \\\n",
"50 libkmahjongg \n",
"76 palapeli \n",
"86 libkdegames \n",
"148 kactivities \n",
"211 meta-kde \n",
"215 meta-kde \n",
"217 meta-kde \n",
"230 grantlee \n",
"298 oxygencursors \n",
"299 kde-l10n \n",
"363 kdepimlibs \n",
"463 okular \n",
"473 libkdcraw \n",
"477 kdegraphics-strigi-analyzer \n",
"482 kdegraphics-mobipocket \n",
"493 kdesdk \n",
"525 ktouch \n",
"538 rocs \n",
"539 kturtle \n",
"547 parley \n",
"562 step \n",
"576 kwordquiz \n",
"580 kmplot \n",
"673 ktp-contact-runner \n",
"679 telepathy-gabble \n",
"688 ktp-approver \n",
"692 telepathy-farstream \n",
"706 farstream \n",
"717 farstream \n",
"728 ktp-contact-applet \n",
"732 qt-gstreamer \n",
"741 ktp-accounts-kcm \n",
"753 ktp-auth-handler \n",
"755 ktp-call-ui \n",
"757 ktp-contact-list \n",
"759 ktp-text-ui \n",
"765 amarok \n",
"770 konversation \n",
"\n",
" Version_src Version_repo \n",
"50 (libkmahjongg (4:4.10.3-1) UNRELEASED; urgency... 4:4.10.2-2 \n",
"76 (palapeli (4:4.10.2-1) UNRELEASED; urgency=low... 0 \n",
"86 (libkdegames (4:4.10.3-1) UNRELEASED; urgency=... 4:4.10.2-2 \n",
"148 (kactivities (4:4.10.3-1) unstable; urgency=lo... 4:4.10.2-1 \n",
"211 (meta-kde (5:79) UNRELEASED; urgency=low\\n\\n ... 5:78 \n",
"215 (meta-kde (5:79) UNRELEASED; urgency=low\\n\\n ... 4:4.10.2+5.78 \n",
"217 (meta-kde (5:79) UNRELEASED; urgency=low\\n\\n ... 0 \n",
"230 (grantlee (0.3.0-5) UNRELEASED; urgency=low\\n\\... 0.3.0-1 \n",
"298 (oxygencursors (0.0.2012-06-kde4.8-2.1) unstab... 0 \n",
"299 (kde-l10n (4:4.10.2-1) experimental; urgency=l... 0 \n",
"363 (kdepimlibs (4:4.10.3-1) unstable; urgency=low... 4:4.10.2-2 \n",
"463 (okular (4:4.10.2-2) UNRELEASED; urgency=low\\n... 4:4.10.2-1 \n",
"473 (libkdcraw (4:4.10.2-3) experimental; urgency=... 4:4.10.2-1 \n",
"477 (kdegraphics-strigi-analyzer (4:4.10.2-2) UNRE... 4:4.10.2-1 \n",
"482 (kdegraphics-mobipocket (4:4.10.2-2) experimen... 4:4.10.2-1 \n",
"493 (kdesdk (4:4.10.2+dfsg-3) UNRELEASED; urgency=... 4:4.10.2+dfsg-2 \n",
"525 (ktouch (4:4.10.2-1) experimental; urgency=low... 0 \n",
"538 (rocs (4:4.8.4-1) unstable; urgency=low\\n\\n *... 0 \n",
"539 (kturtle (4:4.10.2-1) experimental; urgency=lo... 4:4.10.2-0r1 \n",
"547 (parley (4:4.8.4-1) unstable; urgency=low\\n\\n ... 0 \n",
"562 (step (4:4.8.4-1) unstable; urgency=low\\n\\n *... 0 \n",
"576 (kwordquiz (4:4.8.4-1) unstable; urgency=low\\n... 0 \n",
"580 (kmplot (4:4.8.4-2) unstable; urgency=low\\n\\n ... 0 \n",
"673 (ktp-contact-runner (0.5.1) UNRELEASED; urgenc... 0 \n",
"679 (telepathy-gabble (0.16.5-1) unstable; urgency... 0 \n",
"688 (ktp-approver (0.6.2-1) UNRELEASED; urgency=lo... 0.6.1-1 \n",
"692 (telepathy-farstream (0.6.0) UNRELEASED; urgen... 0 \n",
"706 (farstream (0.1.2-1) unstable; urgency=low\\n\\n... 0 \n",
"717 (farstream (0.2.3-1) UNRELEASED; urgency=low\\n... 0 \n",
"728 (ktp-desktop-applets (0.6.2-1) UNRELEASED; urg... 0.5.3-1 \n",
"732 (qt-gstreamer (0.10.2-2) unstable; urgency=low... 0 \n",
"741 (ktp-accounts-kcm (0.6.2-1) UNRELEASED; urgenc... 0.6.1-1 \n",
"753 (ktp-auth-handler (0.6.2-1) UNRELEASED; urgenc... 0.6.1-1 \n",
"755 (ktp-call-ui (0.6.2-1) UNRELEASED; urgency=low... 0.6.1-1 \n",
"757 (ktp-contact-list (0.6.2-1) UNRELEASED; urgenc... 0.6.1-1 \n",
"759 (ktp-text-ui (0.6.2.1-1) UNRELEASED; urgency=l... 0.6.1-1 \n",
"765 (amarok (2.6.0-2) UNRELEASED; urgency=low\\n\\n ... 0 \n",
"770 (konversation (1.4-1) unstable; urgency=low\\n\\... 0 \n"
]
}
],
"prompt_number": 37
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h2>Check for repositories on anonscm.debian.org/gitweb/</h2>\n",
"\n",
"Uses a local copy of the file as that service is really slow."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# parse local download of gitweb file\n",
"# curl -o debian.gitweb http://anonscm.debian.org/gitweb/\n",
"debgitweb = parse('/home/diane/src/ooddr/debian.gitweb')"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 26
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"archives = [ re.sub('[-_]\\d\\.\\d.*','', x) for x in files if x[0] != '.']\n",
"missingrepos = []\n",
"for x in archives:\n",
" if len(sourcepkg[sourcepkg.Source == x]) == 0:\n",
" missingrepos.append(x)\n"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 27
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"def shorten_gitweb_name(name):\n",
" elements = name.split('/')\n",
" return elements[-1].replace('.git', '')\n",
" "
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 28
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"debgitweb.xpath('.//table/tr')[3].text"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 29
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"debgitwebrepos = dict([ (shorten_gitweb_name(x.text), (x.text, x.attrib['href'])) for x in debgitweb.xpath('.//table/tr/td[1]/a')])"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 30
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"for x in missingrepos:\n",
" repoinfo = debgitwebrepos.get(x)\n",
" if repoinfo:\n",
" print(repoinfo)\n",
" else:\n",
" print('No repo:', x)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"No repo: pairs\n",
"No repo: perlkde\n",
"No repo: kimono\n",
"No repo: perlqt\n",
"('pkg-kde/kde-sc/oxygen-icons.git', '?p=pkg-kde/kde-sc/oxygen-icons.git;a=summary')\n",
"('pkg-kde/kde-std/calligra.git', '?p=pkg-kde/kde-std/calligra.git;a=summary')\n",
"No repo: kdelibs\n",
"No repo: picmi\n",
"No repo: qyoto\n"
]
}
],
"prompt_number": 31
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<h2>What's installed?</h2>"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"pr = pd.merge(pkgbinaries[['Source', 'Package']], repository[['Package', 'Version']], how='left')[['Source', 'Version']].drop_duplicates()"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 32
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from debian.debian_support import NativeVersion\n",
"pr[['Version']].fillna(NativeVersion(0))"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "pyout",
"prompt_number": 33,
"text": [
"<class 'pandas.core.frame.DataFrame'>\n",
"Int64Index: 172 entries, 0 to 759\n",
"Data columns:\n",
"Version 172 non-null values\n",
"dtypes: object(1)"
]
}
],
"prompt_number": 33
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"pr[['Version']].fillna(NativeVersion(0))[50:]"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "pyout",
"prompt_number": 34,
"text": [
"<class 'pandas.core.frame.DataFrame'>\n",
"Int64Index: 122 entries, 162 to 759\n",
"Data columns:\n",
"Version 122 non-null values\n",
"dtypes: object(1)"
]
}
],
"prompt_number": 34
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 34
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 35
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 35
}
],
"metadata": {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment