daenyth / pkgtools Goto Github PK
View Code? Open in Web Editor NEWA collection of scripts for archlinux packages
Home Page: http://aur.archlinux.org/packages.php?ID=17941
License: GNU General Public License v2.0
A collection of scripts for archlinux packages
Home Page: http://aur.archlinux.org/packages.php?ID=17941
License: GNU General Public License v2.0
Add a repo blacklist feature to prevent attempts at updating repos which do not contain file lists.
If you know your file is in a specific repo, it could be useful to speed things up to limit searching to that repo only
pactree can print reverse dependency tree since pacman 3.4: http://projects.archlinux.org/pacman.git/tree/NEWS?id=v3.4.0
comm -12 <(pactree -lru $1|sort) <(pacman -Qqe|sort) | grep -v $1
is much faster than 'whoneeds $1' for bigger dep trees: 0.15 sec v. 10 sec. for 'whoneeds zlib' on my system (Pentium 4 @ 2 GHz).
The difference is much less pronounced when listing a small dep tree: 'whoneeds gcc' runs 0.3 sec and returns just 3 packages.
'whoneeds' prints 'Packages that depend on [$1]' as the first line of output, the one-liner I came up with does not.
While trying to install the latest release:
# pip2arch
install -Dm755 scripts/pip2arch/pip2arch.py /tmp/pkgtools/pkg/pkgtools/usr/bin/pip2arch
install: cannot stat ‘scripts/pip2arch/pip2arch.py’: No such file or directory
It turns out that the pip2arch
submodule is not being released (directory empty in the release tarball).
The file when sourced at logging in gives trouble with compiling package when calling ./configure
the ./configure process forks into many child processes.
When debugging with compiling many applications i found that lines similar to http://pastebin.com/ymkHz8Ud
is the one causing the leak.
removing the pkgfile-hook.sh file solves the problem.
2to3!pkgtools *> pkgconflict pkgtools-23-1-x86_64.pkg.tar.xz
Traceback (most recent call last):
File "/usr/bin/pkgconflict", line 90, in <module>
pkg_contents = list_package_contents(sys.argv[1])
File "/usr/bin/pkgconflict", line 71, in list_package_contents
tarball = tarfile.open(package, 'r:gz')
File "/usr/lib/python2.7/tarfile.py", line 1676, in open
return func(name, filemode, fileobj, **kwargs)
File "/usr/lib/python2.7/tarfile.py", line 1727, in gzopen
raise ReadError("not a gzip file")
tarfile.ReadError: not a gzip file
$ pkgfile -i /usr/bin/vim
Error: No target specified
As above. See gem2arch, spec2arch, cpan2arch, etc.
pacman accepts a local path in the form of file:///path/to/repo or /path/to/repo. pkgfile will not parse either of these , error'ing on the former and throwing an unknown URL exception on the latter:
:: Checking [cowpac] for files list ...
Warning: could not retrieve file:///mnt/Gluttony/cowpac.files.tar.gz
:: Checking [testing] for files list ...
:: Downloading http://mirror.rit.edu/archlinux/testing/os/x86_64/testing.files.tar.gz ...
:: Checking [core] for files list ...
:: Downloading http://mirror.rit.edu/archlinux/core/os/x86_64/core.files.tar.gz ...
:: Checking [extra] for files list ...
:: Downloading http://mirror.rit.edu/archlinux/extra/os/x86_64/extra.files.tar.gz ...
:: Checking [community] for files list ...
:: Downloading http://mirror.rit.edu/archlinux/community/os/x86_64/community.files.tar.gz ...
:: Converting local repo ...
Done
:: Checking [cowpac] for files list ...
Traceback (most recent call last):
File "/usr/bin/pkgfile", line 434, in <module>
main()
File "/usr/bin/pkgfile", line 416, in main
update_repo(options)
File "/usr/bin/pkgfile", line 182, in update_repo
conn = urllib2.urlopen(fileslist)
File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 384, in open
protocol = req.get_type()
File "/usr/lib/python2.7/urllib2.py", line 245, in get_type
raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type: /mnt/Gluttony/cowpac.files.tar.gz
As pacman accepts both these formats in /etc/pacman.conf as valid paths to repos, pkgfile needs to as well.
It's the only python2 code left.
Hi,
as I have had reported above on bbs https://bbs.archlinux.org/viewtopic.php?pid=1047129#p1047129 mapepkg seems broken.
When trying to install weboob-git AUR package :
code
changing mode of /var/abs/local/yaourtbuild/weboob-git/pkg/usr/bin/wetboobs to 755
changing mode of /var/abs/local/yaourtbuild/weboob-git/pkg/usr/bin/traveloob to 755
==> Tidying install...
-> Purging unwanted files...
-> Compressing man and info pages...
==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: An unknown error has occurred. Exiting...
==> ERROR: An unknown error has occurred. Exiting...
-> Stripping unneeded symbols from binaries and libraries...
==> Creating package...
-> Generating .PKGINFO file...
-> Compressing package...
==> Finished making: weboob-git 20120125-1 (Wed Jan 25 00:52:43 CET 2012)
==> Installing package weboob-git with pacman -U...
loading packages...
warning: weboob-git-20120125-1 is up to date -- reinstalling
resolving dependencies...
looking for inter-conflicts...
Targets (1): weboob-git-20120125-1
Total Installed Size: 6.18 MiB
Net Upgrade Size: 0.00 MiB
Proceed with installation? [Y/n] Y
(1/1) checking package integrity [##########################################################################] 100%
(1/1) loading package files [##########################################################################] 100%
(1/1) checking for file conflicts [##########################################################################] 100%
(1/1) upgrading weboob-git [##########################################################################] 100%
root@FreAkyLab:/var/abs/local/yaourtbuild/weboob-git#
[/code]
makepkg is bash, so it's simple to debug :
The [b]find[/b] command fails to find some man pages (qvideoob.1) :
[code]
(...)
Regards,
sputnick.
brain0 suggested:
maybe we should just have an option that allows to match the whole path
just searchmode = pkgfile.SEARCH_PACKAGE; if options.path: searchmode = pkgfile.SEARCH_PATH
With the python translation, updating is now smarter about not grabbing updates it shouldn't, but there's no way to override if it decides you don't need an update.
$ pkgfile -v /var/lock/
local/filesystem (2011.04-1) : /var/lock/
local/dmraid (1.0.0.rc16.3-2) : /var/lock/
$ pkgfile -lr . | grep /var/lock/
filesystem /var/lock/
dmraid /var/lock/
dmraid /var/lock/dmraid/
hylafax /var/lock/
The first output misses hylafax which contains this directory.
It would be a good to add license in the header of the files of the C module ??
I am ok with whatever license.
Need to ask brain0 as it is the main author here, with me as second.
https://github.com/falconindy/pkgfile effectively replaces the pkgfile script from pkgtools. It is currently in [extra]: https://www.archlinux.org/packages/extra/x86_64/pkgfile/
Would you accept a pull request to remove pkgfile from pkgtools? If so, should I also add 'pkgfile' as a dependency of pkgtools?
git checkout 2to3
cd modules/
make
gcc -c -Wall -O2 -pipe -I/usr/include/python3.1 -fPIC pkgfile2.c
pkgfile2.c: In function ‘initpkgfile’:
pkgfile2.c:17:3: warning: implicit declaration of function ‘Py_InitModule’
pkgfile2.c:17:5: warning: assignment makes pointer from integer without a cast
pkgfile2.c:20:5: warning: ‘return’ with no value, in function returning non-void
gcc -shared -fPIC -larchive -lpcre pkgfile2.o -o pkgfile.so
python
Python 3.1.3 (r313:86834, Dec 1 2010, 12:16:07)
[GCC 4.5.1 20101125 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pkgfile
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: ./pkgfile.so: undefined symbol: list_packages
This is using pacman-git, but I had someone running 3.4.3 try this for me and they get the same results.
$ pkgfile -l core/vi
Package "vi" not found in [core] repo
$ pkgfile -l vi
vi /usr/
vi /usr/bin/
vi /usr/bin/edit
vi /usr/bin/ex
etc.....
Traceback (most recent call last):
File "/usr/lib/python3.2/tarfile.py", line 1805, in gzopen
fileobj = gzip.GzipFile(name, mode + "b", compresslevel, fileobj)
File "/usr/lib/python3.2/gzip.py", line 157, in **init**
fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
IOError: [Errno 2] No such file or directory: '--help'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./pkgconflict.py", line 90, in <module>
pkg_contents = list_package_contents(sys.argv[1])
File "./pkgconflict.py", line 71, in list_package_contents
tarball = tarfile.open(package, 'r:gz')
File "/usr/lib/python3.2/tarfile.py", line 1757, in open
return func(name, filemode, fileobj, **kwargs)
File "/usr/lib/python3.2/tarfile.py", line 1809, in gzopen
fileobj.close()
AttributeError: 'NoneType' object has no attribute 'close'
I just thought I might give pip2arch a try, but out of the box the program terminates with
Traceback (most recent call last):
File "/sbin/pip2arch", line 251, in <module>
main()
File "/sbin/pip2arch", line 235, in main
version=args.version, outname=args.outname)
File "/sbin/pip2arch", line 61, in get_package
versions = self.client.package_releases(name)
File "/usr/lib/python3.5/xmlrpc/client.py", line 1092, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python3.5/xmlrpc/client.py", line 1432, in __request
verbose=self.__verbose
File "/usr/lib/python3.5/xmlrpc/client.py", line 1134, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python3.5/xmlrpc/client.py", line 1167, in single_request
dict(resp.getheaders())
xmlrpc.client.ProtocolError: <ProtocolError for pypi.python.org/pypi: 403 Must access using HTTPS instead of HTTP>
First, the shebang have to be fixed to point to python2, then if you try to use it, you get:
$ pkgconflict /var/cache/pacman/pkg/aspell-0.60.6-5-x86_64.pkg.tar.xz
Traceback (most recent call last):
File "/usr/bin/pkgconflict", line 89, in
known_files = read_file_lists(FILELIST_DIR)
File "/usr/bin/pkgconflict", line 59, in read_file_lists
packages = os.listdir(repopath)
OSError: [Errno 20] Not a directory: '/var/cache/pkgtools/lists/local.files.tar.gz
sudo pkgfile -u :: Converting local repo ... Traceback (most recent call last): File "/usr/bin/pkgfile", line 434, in main() File "/usr/bin/pkgfile", line 416, in main update_repo(options) File "/usr/bin/pkgfile", line 210, in update_repo local_dbpath = os.path.join(find_dbpath(), 'local') File "/usr/lib/python2.7/posixpath.py", line 68, in join elif path == '' or path.endswith('/'): AttributeError: 'NoneType' object has no attribute 'endswith'
pacman 3.5 has a new database format
Should run through basic usage with a prebuilt file list db.
At least for pkgfile, we should be using distutils to simplify deployment
Document all function inputs, outputs, usage examples, etc.
'gem2arch' tool is a separate project actively developed at https://github.com/anatol/gem2arch . The tool was rewriten to Ruby and added many new features.
Here is a package for it https://aur.archlinux.org/packages/gem2arch/ It actively used, about 300 AUR packages are kept updated with it.
It seems there no much reason to keep old gem2arch in pkgtools.
jimmy@vangogh:~$ -foo
Usage: pkgfile [ACTIONS] [OPTIONS] filename
pkgfile: error: no such option: -f
bash: -foo: command not found
Please change the line in /usr/share/pkgtools/pkgfile-hook.*
into:
local pkgs="$(pkgfile -b -v -- "$command")"
Regards.
The variables all got quoted, but that stops it working with multiple packages as pacman then takes the input as a single string:
$ whoneeds.bash qt4
error: package 'keepassx ophcrack' was not found
error: could not get information on keepassx ophcrack
$ sed -i 's/\"\$package\"/\$package/g' scripts/whoneeds.bash
$ whoneeds.bash qt4
Packages that depend on [qt4]
keepassx ophcrack
$
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.