You are not logged in.

#1 2015-01-15 13:16:41

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

[solved] bigpkg doesn't like /var/lib/pacman/local/ALPM_DB_VERSION

I can't use bigpkg anymore, because it expects everything in /var/lib/pacman/local/ to be a directory:
https://aur.archlinux.org/packages/bigpkg/ -> http://allanmcrae.com/scripts/bigpkg
Here are the important lines:

LOCAL_DB_PATH="/var/lib/pacman/local"

file = LOCAL_DB_PATH + "/" + dir + "/desc"
f = open(file, "r")

After running 'pacman-db-upgrade', /var/lib/pacman/local/ALPM_DB_VERSION was placed there

$ pacman -Qo /var/lib/pacman/local/ALPM_DB_VERSION
error: No package owns /var/lib/pacman/local/ALPM_DB_VERSION
$ cat /var/lib/pacman/local/ALPM_DB_VERSION
9
$ bigpkg
Traceback (most recent call last):
  File "/usr/bin/bigpkg", line 83, in <module>
    parse_package_info(pkg, dir)
  File "/usr/bin/bigpkg", line 51, in parse_package_info
    f = open(file, "r")
NotADirectoryError: [Errno 20] Not a directory: '/var/lib/pacman/local/ALPM_DB_VERSION/desc'

I can remove that file and make bigpkg work again, but it breaks pacman:

error: failed to initialize alpm library
(database is incorrect version: /var/lib/pacman/)
error:   try running pacman-db-upgrade

Is it a bug? If not, can someone please fix bigpkg? I don't speak python, so I can't do it myself :-(

Last edited by karol (2015-01-16 18:50:59)

Offline

#2 2015-01-15 13:29:04

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,163
Website

Re: [solved] bigpkg doesn't like /var/lib/pacman/local/ALPM_DB_VERSION

Have you tried rebuilding bigpkg against pacman 4.2?


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#3 2015-01-15 14:26:11

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved] bigpkg doesn't like /var/lib/pacman/local/ALPM_DB_VERSION

Yup.
AFAICT the bigpkg script expects no files, just directories in /var/lib/pacman/local/. If I can ask bigpkg to ignore /var/lib/pacman/local/ALPM_DB_VERSION I'm all set.

Offline

#4 2015-01-15 14:30:58

bstaletic
Member
Registered: 2014-02-02
Posts: 658

Re: [solved] bigpkg doesn't like /var/lib/pacman/local/ALPM_DB_VERSION

Download just the script from Allan's blog, the package is outdated. I'm not sure this will solve the problem, but it'sworth a shot.

Offline

#5 2015-01-15 17:55:24

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved] bigpkg doesn't like /var/lib/pacman/local/ALPM_DB_VERSION

bstaletic wrote:

Download just the script from Allan's blog, the package is outdated.

Have a look at the PKGBUILD: https://aur.archlinux.org/packages/bi/bigpkg/PKGBUILD
It only downloads and installs the script.

Offline

#6 2015-01-15 17:57:45

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [solved] bigpkg doesn't like /var/lib/pacman/local/ALPM_DB_VERSION

Just use expac...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2015-01-15 22:36:49

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved] bigpkg doesn't like /var/lib/pacman/local/ALPM_DB_VERSION

jasonwryan wrote:

Just use expac...

I do, I do :-)

$ type greatpkg
greatpkg is aliased to `expac -s -H M "%-30n %m" | sort -rhk 2 | head'

Offline

#8 2015-01-15 22:56:40

progandy
Member
Registered: 2012-05-17
Posts: 5,266

Re: [solved] bigpkg doesn't like /var/lib/pacman/local/ALPM_DB_VERSION

I believe you can use bigpkg if you patch it like this:

for dir in os.listdir(LOCAL_DB_PATH):
    try:
        pkg = dir[0:dir.rindex("-",0,dir.rindex("-"))]
        pkg_list.append(pkg)
        parse_package_info(pkg, dir)
    except ValueError:
        pass

Last edited by progandy (2015-01-15 22:57:20)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#9 2015-01-15 23:07:33

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: [solved] bigpkg doesn't like /var/lib/pacman/local/ALPM_DB_VERSION

So Allan broke his own script when updating ALPM? lol lol lol lol big_smile


allan_sux.png


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#10 2015-01-15 23:32:38

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,474
Website

Re: [solved] bigpkg doesn't like /var/lib/pacman/local/ALPM_DB_VERSION

Allan has not looked at that script in a few years,,,

Offline

#11 2015-01-16 08:44:19

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved] bigpkg doesn't like /var/lib/pacman/local/ALPM_DB_VERSION

progandy wrote:

I believe you can use bigpkg if you patch it like this:

for dir in os.listdir(LOCAL_DB_PATH):
    try:
        pkg = dir[0:dir.rindex("-",0,dir.rindex("-"))]
        pkg_list.append(pkg)
        parse_package_info(pkg, dir)
    except ValueError:
        pass

Can you post a diff? I have no idea where to put it.
bigpkg complains

$ /usr/bin/bigpkg_patched
Traceback (most recent call last):
  File "/usr/bin/bigpkg_patched", line 53, in <module>
    pkg_list.append(pkg)
NameError: name 'pkg_list' is not defined

if I try to use the part you posted before the line that says

pkg_list = []

but I still have problems with

file = LOCAL_DB_PATH + "/" + dir + "/desc"
f = open(file, "r")

Offline

#12 2015-01-16 12:13:41

progandy
Member
Registered: 2012-05-17
Posts: 5,266

Re: [solved] bigpkg doesn't like /var/lib/pacman/local/ALPM_DB_VERSION

karol wrote:

Can you post a diff? I have no idea where to put it.

There is a similar for-loop in the original code that you have to replace

diff --git a/bigpkg b/bigpkg
index b0ac16f..f8619ef 100644
--- a/bigpkg
+++ b/bigpkg
@@ -78,9 +78,12 @@ pkg_provides = {}
 pkg_size = {}
 
 for dir in os.listdir(LOCAL_DB_PATH):
-    pkg = dir[0:dir.rfind("-",0,dir.rfind("-"))]
-    pkg_list.append(pkg)
-    parse_package_info(pkg, dir)
+    try:
+        pkg = dir[0:dir.rindex("-",0,dir.rindex("-"))]
+        pkg_list.append(pkg)
+        parse_package_info(pkg, dir)
+    except ValueError:
+        pass
 
 pkg_deptree = {}
 

| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#13 2015-01-16 18:50:44

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved] bigpkg doesn't like /var/lib/pacman/local/ALPM_DB_VERSION

Thank you very much :-)

Offline

#14 2015-01-17 23:29:21

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: [solved] bigpkg doesn't like /var/lib/pacman/local/ALPM_DB_VERSION

Allan wrote:

Allan has not looked at that script in a few years,,,

I expected as much, but the nominal comedic value is golden. big_smile


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#15 2015-07-15 12:49:52

kozaki
Member
From: London >. < Paris
Registered: 2005-06-13
Posts: 673
Website

Re: [solved] bigpkg doesn't like /var/lib/pacman/local/ALPM_DB_VERSION

Patching bigpkg as proposed above gives a Syntax error in this location:
# bigpkg

  File "/usr/bin/bigpkg", line 84
    except ValueError:
         ^
SyntaxError: invalid syntax

Dunno Python so I could just check if I closed parenthesis above line 84 and yes they are =}
---
pacman 4.2.1-1


Seeded last month: Arch 50 gig, derivatives 1 gig
Desktop @3.3GHz 8 gig RAM, linux-ck
laptop #1 Atom 2 gig RAM, Arch linux stock i686 (6H w/ 6yrs old battery smile) #2: ARM Tegra K1, 4 gig RAM, ChrOS
Atom Z520 2 gig RAM, OMV (Debian 7) kernel 3.16 bpo on SDHC | PGP Key: 0xFF0157D9

Offline

Board footer

Powered by FluxBB