Coder Social home page Coder Social logo

daenyth / pkgtools Goto Github PK

View Code? Open in Web Editor NEW
76.0 76.0 14.0 599 KB

A collection of scripts for archlinux packages

Home Page: http://aur.archlinux.org/packages.php?ID=17941

License: GNU General Public License v2.0

Shell 87.00% Python 8.24% Makefile 4.77%

pkgtools's People

Contributors

anatol avatar andrwe avatar brain0 avatar bram85 avatar daenyth avatar eagletmt avatar falconindy avatar garoth avatar joanrieu avatar jrstjohn avatar mineo avatar solsticedhiver avatar tuxce avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pkgtools's Issues

Do we still need 'whoneeds'?

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.

pip2arch empty in release

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).

pkgfile-hook.sh file at /etc/profile.d problem

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.

pkgconflict doesn't work with .xz files

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 fails to parse local repos correctly

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:

with file:// proto

:: 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

as a local path

:: 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.

Error when makepkg from pkgtools 23-3 is trying to run zipman

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]

LANG=C bash -x /usr/bin/makepkg -si --asroot

(...)

  • IFS='
    '
  • read -rd '' -a hardlinks
    ++ find usr/man usr/info usr/share/man usr/share/info usr/local/man usr/local/info usr/local/share/man usr/local/share/info 'opt//man' 'opt//info' '!' -name qvideoob.1 -samefile usr/share/man/man1/qvideoob.1
    ++++ gettext 'An unknown error has occurred. Exiting...'
    +++ trap_exit 'An unknown error has occurred. Exiting...'
    +++ (( ! INFAKEROOT ))
    +++ echo
    +++ error 'An unknown error has occurred. Exiting...'
    +++ local 'mesg=An unknown error has occurred. Exiting...'
    +++ shift
    ++++ gettext ERROR:
    +++ printf '==> ERROR: An unknown error has occurred. Exiting...\n'
    ==> ERROR: An unknown error has occurred. Exiting...
    +++ [[ -n '' ]]
    +++ exit 1
  • true
  • rm -f
  • gzip -9 usr/share/man/man1/qvideoob.1
    (...)
    [/code]

Regards,
sputnick.

Add option like pacman -Syy

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.

Missing output when searching for a directory

$ 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.

pkgfile C module needs license header

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.

C-pkgfile does not work under python 3.1

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

pkgconflict needs --help output

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'

pip2arch: pipy requires https

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>

pkgconflict doesn't work with pkgfile 22

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

pkgfile doesn't work with pacman 3.5

 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

Add unit tests

Should run through basic usage with a prebuilt file list db.

pkgfile-hook.* causing error when command begins w/ '-'

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.

Last commit causes problems with "whoneeds.bash"

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
$ 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.