From 7581c5fb8a8d8e1e0a79c343cbd23725475f846c Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 15 Jul 2009 17:02:34 +0200 Subject: Simplify the whole building, build all Python versions with setup.py --- debian/python-apt.docs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'debian/python-apt.docs') diff --git a/debian/python-apt.docs b/debian/python-apt.docs index 6ba083f5..29219341 100644 --- a/debian/python-apt.docs +++ b/debian/python-apt.docs @@ -1,5 +1,4 @@ README apt/README.apt data/templates/README.templates -build/doc/html/ -build/doc/text/ +build/sphinx/html/ -- cgit v1.2.3 From a123b39f6e3dc69c9db46dd00550fc04c1ee9399 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sat, 27 Feb 2010 17:48:53 +0100 Subject: Ship the list of deprecated things in the apt_pkg and apt_inst modules inside the script itself, so we don't have to parse the source code anymore. --- debian/changelog | 3 ++ debian/python-apt.docs | 1 + utils/migrate-0.8.py | 131 ++++++++++++++++++++++++++++--------------------- 3 files changed, 80 insertions(+), 55 deletions(-) (limited to 'debian/python-apt.docs') diff --git a/debian/changelog b/debian/changelog index e5945ef4..9a05185d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,9 @@ python-apt (0.7.93.2) unstable; urgency=low * utils/migrate-0.8.py: - Improve C++ parsing and add apt.progress.old to the modules, reduces false positives. + - Ship the list of deprecated things in the apt_pkg and apt_inst modules + inside the script itself, so we don't have to parse the source code + anymore. * python: - Handle deprecated attributes and methods in the tp_gettattro slot, this allows us to easily warn if a deprecated function is used. diff --git a/debian/python-apt.docs b/debian/python-apt.docs index 1bfc7c1c..c4191c81 100644 --- a/debian/python-apt.docs +++ b/debian/python-apt.docs @@ -4,3 +4,4 @@ TODO apt/README.apt data/templates/README.templates build/sphinx/html/ +utils/migrate-0.8.py diff --git a/utils/migrate-0.8.py b/utils/migrate-0.8.py index 61059b2a..d0d8e9a1 100755 --- a/utils/migrate-0.8.py +++ b/utils/migrate-0.8.py @@ -44,7 +44,7 @@ from collections import defaultdict from textwrap import fill color=False -if sys.argv[1] in ('-c', '--color', '--colour'): +if len(sys.argv) > 1 and sys.argv[1] in ('-c', '--color', '--colour'): color=True del sys.argv[1] @@ -55,6 +55,75 @@ if '-h' in sys.argv or '--help' in sys.argv or not sys.argv[1:]: if os.path.dirname(__file__).endswith('utils'): sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) +deprecated_cpp_stuff = set([ + '.Add', '.AllTargets', '.Arch', '.Architecture', '.Archive', + '.ArchiveURI', '.Auto', '.Base64Encode', '.Binaries', '.BrokenCount', + '.BuildDepends', '.Bytes', '.CheckDep', '.CheckDomainList', '.Clear', + '.Close', '.Commit', '.CompType', '.Complete', '.Component', '.Config', + '.CurStateConfigFiles', '.CurStateHalfConfigured', + '.CurStateHalfInstalled', '.CurStateInstalled', '.CurStateNotInstalled', + '.CurStateUnPacked', '.CurrentState', '.CurrentVer', '.Date', + '.DeQuoteString', '.DebSize', '.DelCount', '.DepType', '.DependsCount', + '.DependsList', '.DependsListStr', '.DescURI', '.Describe', '.DestFile', + '.Dist', '.DoInstall', '.Downloadable', '.ErrorText', '.Essential', + '.Exists', '.FetchNeeded', '.FileList', '.FileName', '.FileSize', + '.Files', '.Find', '.FindB', '.FindDir', '.FindFile', '.FindFlag', + '.FindI', '.FindIndex', '.FindRaw', '.FixBroken', '.FixMissing', + '.GetAcquire', '.GetArchives', '.GetCache', '.GetCandidateVer', + '.GetCdrom', '.GetDepCache', '.GetIndexes', '.GetLock', + '.GetPackageManager', '.GetPkgAcqFile', '.GetPkgActionGroup', + '.GetPkgProblemResolver', '.GetPkgRecords', '.GetPkgSourceList', + '.GetPkgSrcRecords', '.HasPackages', '.Hash', '.Homepage', '.ID', + '.Ident', '.Important', '.Index', '.IndexFiles', '.IndexType', '.Init', + '.InitConfig', '.InitSystem', '.InstCount', '.InstState', + '.InstStateHold', '.InstStateHoldReInstReq', '.InstStateOk', + '.InstStateReInstReq', '.InstallProtect', '.InstalledSize', + '.IsAutoInstalled', '.IsGarbage', '.IsInstBroken', '.IsNowBroken', + '.IsTrusted', '.IsUpgradable', '.Items', '.Jump', '.KeepCount', + '.Label', '.LanguageCode', '.LibVersion', '.List', '.Local', + '.LongDesc', '.Lookup', '.MD5Hash', '.Maintainer', '.MarkDelete', + '.MarkInstall', '.MarkKeep', '.MarkedDelete', '.MarkedDowngrade', + '.MarkedInstall', '.MarkedKeep', '.MarkedReinstall', '.MarkedUpgrade', + '.MinimizeUpgrade', '.MyTag', '.Name', '.NotAutomatic', '.NotSource', + '.Offset', '.Open', '.Origin', '.Package', '.PackageCount', + '.PackageFileCount', '.Packages', '.ParentPkg', '.ParentVer', + '.ParseCommandLine', '.ParseDepends', '.ParseSection', + '.ParseSrcDepends', '.ParseTagFile', '.PartialPresent', + '.PkgSystemLock', '.PkgSystemUnLock', '.PriExtra', '.PriImportant', + '.PriOptional', '.PriRequired', '.PriStandard', '.Priority', + '.PriorityStr', '.Protect', '.ProvidesCount', '.ProvidesList', + '.QuoteString', '.ReadConfigDir', '.ReadConfigFile', + '.ReadConfigFileISC', '.ReadMainList', '.ReadPinFile', '.Record', + '.Remove', '.Resolve', '.ResolveByKeep', '.Restart', '.RevDependsList', + '.RewriteSection', '.RewriteSourceOrder', '.Run', '.SHA1Hash', + '.SHA256Hash', '.Section', '.SelStateDeInstall', '.SelStateHold', + '.SelStateInstall', '.SelStatePurge', '.SelStateUnknown', + '.SelectedState', '.Set', '.SetCandidateVer', '.SetReInstall', + '.ShortDesc', '.Shutdown', '.Site', '.Size', '.SizeToStr', + '.SmartTargetPkg', '.SourcePkg', '.SourceVer', '.Status', '.Step', + '.StrToTime', '.StringToBool', '.SubTree', '.TargetPkg', '.TargetVer', + '.Time', '.TimeRFC1123', '.TimeToStr', '.TotalNeeded', + '.TranslationDescription', '.URI', '.URItoFileName', '.Update', + '.Upgrade', '.UpstreamVersion', '.UsrSize', '.ValueList', + '.VerFileCount', '.VerStr', '.Version', '.VersionCompare', + '.VersionCount', '.VersionList', '.newConfiguration', 'Base64Encode', + 'CheckDep', 'CheckDomainList', 'Config', 'CurStateConfigFiles', + 'CurStateHalfConfigured', 'CurStateHalfInstalled', 'CurStateInstalled', + 'CurStateNotInstalled', 'CurStateUnPacked', 'Date', 'DeQuoteString', + 'GetAcquire', 'GetCache', 'GetCdrom', 'GetDepCache', 'GetLock', + 'GetPackageManager', 'GetPkgAcqFile', 'GetPkgActionGroup', + 'GetPkgProblemResolver', 'GetPkgRecords', 'GetPkgSourceList', + 'GetPkgSrcRecords', 'InitConfig', 'InitSystem', 'InstStateHold', + 'InstStateHoldReInstReq', 'InstStateOk', 'InstStateReInstReq', + 'LibVersion', 'ParseCommandLine', 'ParseDepends', 'ParseSection', + 'ParseSrcDepends', 'ParseTagFile', 'PkgSystemLock', 'PkgSystemUnLock', + 'PriExtra', 'PriImportant', 'PriOptional', 'PriRequired', 'PriStandard', + 'QuoteString', 'ReadConfigDir', 'ReadConfigFile', 'ReadConfigFileISC', + 'RewriteSection', 'RewriteSourceOrder', 'SelStateDeInstall', + 'SelStateHold', 'SelStateInstall', 'SelStatePurge', 'SelStateUnknown', + 'SizeToStr', 'StrToTime', 'StringToBool', 'Time', 'TimeRFC1123', + 'TimeToStr', 'URItoFileName', 'UpstreamVersion', 'VersionCompare', + 'newConfiguration']) def do_color(string, words): """Colorize (red) the given words in the given string.""" @@ -66,61 +135,13 @@ def do_color(string, words): r"\2" + "\033[0m\\3", string) return string - -def find_deprecated_cpp(): - """Find all the deprecated functions and attributes.""" - is_open=False - all_old = set() - for fname in glob.glob('python/*.cc'): - lines = list(open(fname, 'r')) - while lines: - line = lines.pop(0) - while lines and not ('static PyMethodDef' in line or - 'static PyGetSetDef' in line): - line = lines.pop(0) - if not lines: - break - - while lines and not ';' in line: - while lines and not 'COMPAT_0_7' in line and not ';' in line: - line = lines.pop(0) - if ';' in line: - continue - if lines: - line = lines.pop(0) - while lines and not '#endif' in line: - name = line.split(",")[0].strip().strip('{"') - if not 'module' in fname: - name = '.' + name - else: - all_old.add('.' + name) - all_old.add(name) - line = lines.pop(0) - # Let's handle constants in the apt_pkg module - lines = list(open('python/apt_pkgmodule.cc')) - while lines: - while lines and not 'COMPAT_0_7' in line: - line = lines.pop(0) - if lines: - lines.pop(0) - while lines and not '#endif' in line: - if 'PyModule_Add' in line: - name = line.split(",")[1].strip().strip('"') - if name != '_COMPAT_0_7': - all_old.add('.' + name) - all_old.add(name) - line = lines.pop(0) - return all_old - - def find_deprecated_py(): - """Same as find_deprecated_cpp(), but for apt and aptsources. - - We import apt_pkg, set _COMPAT_0_7 to 0, import apt and aptsources and - create a list of all attributes. + """Find all the deprecated functions and attributes. - No we remove the imported modules, reimport them (with _COMPAT_0_7=1), - and see which functions have been removed. + Import apt_pkg, set _COMPAT_0_7 to 0, import apt and aptsources and + create a list of all attributes. Then remove the imported modules, + reimport them (with _COMPAT_0_7=1), and see which functions do not + exist anymore. """ modules = ('apt', 'apt.package', 'apt.cdrom', 'apt.cache', 'apt.debfile', @@ -204,7 +225,7 @@ if color: 'simply highlight the matched words (like grep).', 79) print -all_old = find_deprecated_cpp() +all_old = deprecated_cpp_stuff if not '-P' in sys.argv: all_old |= find_deprecated_py() -- cgit v1.2.3 From c6fd687e9b48133d025ccc47ff397087f5752203 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sat, 27 Feb 2010 18:31:57 +0100 Subject: * debian/python-apt.install: - Install utils/migrate-0.8.py to /usr/share/python-apt/. --- debian/changelog | 2 ++ debian/python-apt.docs | 1 - debian/python-apt.install | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'debian/python-apt.docs') diff --git a/debian/changelog b/debian/changelog index 9a05185d..5f060a9c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -30,6 +30,8 @@ python-apt (0.7.93.2) unstable; urgency=low - aptsources/distinfo.py: Support relative filenames for MirrorsFile. * debian/rules: - Run tests during build time. + * debian/python-apt.install: + - Install utils/migrate-0.8.py to /usr/share/python-apt/. [ Michael Vogt ] * apt/cache.py: diff --git a/debian/python-apt.docs b/debian/python-apt.docs index c4191c81..1bfc7c1c 100644 --- a/debian/python-apt.docs +++ b/debian/python-apt.docs @@ -4,4 +4,3 @@ TODO apt/README.apt data/templates/README.templates build/sphinx/html/ -utils/migrate-0.8.py diff --git a/debian/python-apt.install b/debian/python-apt.install index ca86ed11..29028531 100644 --- a/debian/python-apt.install +++ b/debian/python-apt.install @@ -4,3 +4,5 @@ usr/lib/python*/*/*/ usr/lib/python*/*/*.egg-info usr/share/locale usr/share/python-apt +# Install the migration helper +utils/migrate-0.8.py usr/share/python-apt -- cgit v1.2.3 From 72e6ef284a460c497eec3964b0eeddbdf24a4b5a Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 10 Mar 2010 15:58:50 +0100 Subject: Move documentation into python-apt-doc (Closes: #572617) --- debian/changelog | 1 + debian/control | 16 ++++++++++++++-- debian/python-apt-doc.doc-base | 8 ++++++++ debian/python-apt-doc.docs | 1 + debian/python-apt.doc-base | 8 -------- debian/python-apt.docs | 1 - debian/rules | 2 +- 7 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 debian/python-apt-doc.doc-base create mode 100644 debian/python-apt-doc.docs delete mode 100644 debian/python-apt.doc-base (limited to 'debian/python-apt.docs') diff --git a/debian/changelog b/debian/changelog index 5c6e6895..b0e6657b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ python-apt (0.7.93.4) unstable; urgency=low + * Move documentation into python-apt-doc (Closes: #572617) * python/acquire-item.cc: - Add AcquireItem.partialsize member. * python/apt_pkgmodule.cc: diff --git a/debian/control b/debian/control index 4db6c164..8e7605e6 100644 --- a/debian/control +++ b/debian/control @@ -23,10 +23,10 @@ Vcs-Browser: http://bzr.debian.org/loggerhead/apt/python-apt/debian-sid/changes Package: python-apt Architecture: any Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends} -Recommends: lsb-release, iso-codes, libjs-jquery +Recommends: lsb-release, iso-codes Breaks: debdelta (<< 0.28~), packagekit-backend-apt (<= 0.4.8-0ubuntu4) Provides: ${python:Provides} -Suggests: python-apt-dbg, python-gtk2, python-vte +Suggests: python-apt-dbg, python-gtk2, python-vte, python-apt-doc XB-Python-Version: ${python:Versions} Description: Python interface to libapt-pkg The apt_pkg Python interface will provide full access to the internal @@ -41,6 +41,18 @@ Description: Python interface to libapt-pkg The included 'aptsources' Python interface provides an abstraction of the sources.list configuration on the repository and the distro level. +Package: python-apt-doc +Architecture: all +Section: doc +Depends: libjs-jquery, ${misc:Depends} +Enhances: python-apt +Description: Python interface to libapt-pkg (API documentation) + The apt_pkg Python interface will provide full access to the internal + libapt-pkg structures allowing Python programs to easily perform a + variety of functions. + . + This package contains the API documentation of python-apt. + Package: python-apt-dbg Priority: extra Architecture: any diff --git a/debian/python-apt-doc.doc-base b/debian/python-apt-doc.doc-base new file mode 100644 index 00000000..4f3c4d31 --- /dev/null +++ b/debian/python-apt-doc.doc-base @@ -0,0 +1,8 @@ +Document: python-apt-api-reference +Title: Python APT: API reference manual +Abstract: API reference manual for Python bindings to libapt-pkg +Section: Programming/Python + +Format: HTML +Index: /usr/share/doc/python-apt-doc/html/index.html +Files: /usr/share/doc/python-apt-doc/html/* diff --git a/debian/python-apt-doc.docs b/debian/python-apt-doc.docs new file mode 100644 index 00000000..f85adafd --- /dev/null +++ b/debian/python-apt-doc.docs @@ -0,0 +1 @@ +build/sphinx/html/ diff --git a/debian/python-apt.doc-base b/debian/python-apt.doc-base deleted file mode 100644 index e9b2040c..00000000 --- a/debian/python-apt.doc-base +++ /dev/null @@ -1,8 +0,0 @@ -Document: python-apt-api-reference -Title: Python APT: API reference manual -Abstract: API reference manual for Python bindings to libapt-pkg -Section: Programming/Python - -Format: HTML -Index: /usr/share/doc/python-apt/html/index.html -Files: /usr/share/doc/python-apt/html/* diff --git a/debian/python-apt.docs b/debian/python-apt.docs index 1bfc7c1c..a53a1ccc 100644 --- a/debian/python-apt.docs +++ b/debian/python-apt.docs @@ -3,4 +3,3 @@ AUTHORS TODO apt/README.apt data/templates/README.templates -build/sphinx/html/ diff --git a/debian/rules b/debian/rules index 24d0952e..3711080c 100755 --- a/debian/rules +++ b/debian/rules @@ -10,7 +10,7 @@ export CFLAGS=-Wno-write-strings -DCOMPAT_0_7 override_dh_installdocs: dh_installdocs ln -sf ../../../../javascript/jquery/jquery.js \ - debian/python-apt/usr/share/doc/python-apt/html/_static/jquery.js + debian/python-apt-doc/usr/share/doc/python-apt-doc/html/_static/jquery.js rm -rf debian/python-apt-dbg/usr/share/doc/python-apt-dbg ln -s python-apt debian/python-apt-dbg/usr/share/doc/python-apt-dbg -- cgit v1.2.3