actionless / pikaur

AUR helper with minimal dependencies. Review PKGBUILDs all in once, next build them all without user interaction.
GNU General Public License v3.0
866 stars 87 forks source link

Small Bug if no packets can be upgraded #13

Closed dangerfish96 closed 6 years ago

dangerfish96 commented 6 years ago
 pikaur -Syu
 :: Synchronising package databases...
  core is up to date
  extra is up to date
  community is up to date
  multilib is up to date
  blackarch is up to date
 :: Starting full system upgrade...
 Reading repository package databases.............................................................
 :: Starting full AUR upgrade...
 Reading local package database..................................................................
 resolving dependencies...

 :: Proceed with installation? [Y/n] 
 :: [v]iew package detail   [m]anually select packages
 > v

 :: Proceed with installation? [Y/n] 
 :: [v]iew package detail   [m]anually select packages
 > v

 :: Proceed with installation? [Y/n] 
 :: [v]iew package detail   [m]anually select packages
 > m
 Traceback (most recent call last):
   File "/tmp/trizen-daniel/pikaur-git/src/pikaur-git/pikaur.py", line 8, in <module>
   File "/tmp/trizen-daniel/pikaur-git/src/pikaur-git/pikaur/main.py", line 244, in main
   File "/tmp/trizen-daniel/pikaur-git/src/pikaur-git/pikaur/main.py", line 196, in cli_entry_point
    File "/tmp/trizen-daniel/pikaur-git/src/pikaur-git/pikaur/main.py", line 93, in cli_upgrade_packages
   File "/tmp/trizen-daniel/pikaur-git/src/pikaur-git/pikaur/main.py", line 56, in cli_install_packages
   File "/tmp/trizen-daniel/pikaur-git/src/pikaur-git/pikaur/install_cli.py", line 98, in __init__
   File "/tmp/trizen-daniel/pikaur-git/src/pikaur-git/pikaur/install_cli.py", line 215, in install_prompt
 NotImplementedError

I feel like this is not intended. Maybe a check is missing, if packets exist that should be upgraded.

Thank you for your work, we all appreciate it :)

actionless commented 6 years ago

no, it's just indeed not implemented (yet) :-)

dangerfish96 commented 6 years ago

But shouldn't there be a message like "Already up-to-date.", since no packets need an upgrade?

actionless commented 6 years ago

that happens only if you choose m, i will implement that in the next week or so

dangerfish96 commented 6 years ago

I meant that "Proceed with installation? [Y/n]" should not be asked, as no packets have to be upgraded

actionless commented 6 years ago

weird, i've tried and seems to be fine, could you update to the latest version and try again?

$ ./pikaur.py -Syu --ignore pokemon-revolution-online-bin
:: Synchronizing package databases...
 core is up to date
 extra                                          1595.1 KiB  15.4M/s 00:00 [------------------------------------------] 100%
 community                                         4.1 MiB  43.2M/s 00:00 [------------------------------------------] 100%
 multilib is up to date
 heftig is up to date
:: Starting full system upgrade...
Reading repository package databases.......................................................................................
:: Starting full AUR upgrade...
Reading local package database.............................................................................................
:: warning: Following packages can not be found in AUR:
    awesome_config_actionless_meta
    protoplug
    scrot-patched
    urbanterror-data

:: Already up-to-date.
dangerfish96 commented 6 years ago

I tried with the newest version and problem persists, but I don't know how to debug it

actionless commented 6 years ago

1) double-check what version is at least 0.5+12 2) to debug it you can print out the condition used to determine if prompt should be shown or not:

diff --git a/pikaur/main.py b/pikaur/main.py
index ae38688..a729243 100644
--- a/pikaur/main.py
+++ b/pikaur/main.py
@@ -89,6 +89,7 @@ def cli_upgrade_packages(args):
     ] + [
         u.Name for u in aur_updates
     ]
+    print(all_upgradeable_package_names)
     if all_upgradeable_package_names:
         cli_install_packages(
             args=args,
dangerfish96 commented 6 years ago

I found the culprit. If packages are on the NoUpgrade list of pacman, than the check (line 92) does not ignore them. In my case it is linux-lts which should be ignored by the check. If I do 'pikaur -Syu --ignore linux-lts' it works as expected.

actionless commented 6 years ago

https://www.archlinux.org/pacman/pacman.conf.5.html

 NoUpgrade = file …

All files listed with a NoUpgrade directive will never be touched during a package install/upgrade, and the new files will be installed with a .pacnew extension. These files refer to files in the package archive, so do not include the leading slash (the RootDir) when specifying them. Shell-style glob patterns are allowed. It is possible to invert matches by prepending a file with an exclamation mark. Inverted files will result in previously blacklisted files being whitelisted again. Subsequent matches will override previous ones. A leading literal exclamation mark or backslash needs to be escaped.

dangerfish96 commented 6 years ago

Is it possible to add the following?

diff --git a/pikaur/meta_package.py b/pikaur/meta_package.py
index d912d86..f201f16 100644
--- a/pikaur/meta_package.py
+++ b/pikaur/meta_package.py
@@ -33,7 +33,9 @@ def find_repo_updates():
     repo_packages_updates = []
     repo_pkgs_info = PackageDB.get_repo_dict()
     for update in packages_updates_lines:
-        pkg_name, current_version, _, new_version, *_ = update.split()
+        pkg_name, current_version, _, new_version, ignored, *_ = update.split()
+        if (ignored == "[ignored]"):
+            continue
         pkg_info = repo_pkgs_info[pkg_name]
         repo_packages_updates.append(
             PackageUpdate(

This ignores packages that are ignored by pacman

actionless commented 6 years ago

i think it will raise ValueError: not enough values to unpack in a lot of cases

but i am still not able to reproduce your setup and problem, mb you could elaborate more on that part?

dangerfish96 commented 6 years ago

This is how one can probably reproduce this:

actionless commented 6 years ago

could you try with this patch?

diff --git a/pikaur/install_cli.py b/pikaur/install_cli.py
index f7e09b1..0d52e69 100644
--- a/pikaur/install_cli.py
+++ b/pikaur/install_cli.py
@@ -90,7 +90,9 @@ class InstallPackagesCLI():
         self.args = args

         packages = packages or args.positional
+        print(packages)
         exclude_ignored_packages(packages, args)
+        print(packages)
         self.find_packages(packages)

         if not args.noconfirm:

and show the output

dangerfish96 commented 6 years ago
./pikaur.py -Syu         
:: Synchronising package databases...
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date
 blackarch is up to date
:: Starting full system upgrade...
Reading repository package databases............................................................
:: Starting full AUR upgrade...
Reading local package database..................................................................
['linux-lts']
[]
resolving dependencies...

:: Proceed with installation? [Y/n] 
:: [v]iew package detail   [m]anually select packages
actionless commented 6 years ago

thank you for your patience while debugging!