oshazard / apacman

ArchLinux User Repository (AUR) helper and pacman wrapper
https://aur.archlinux.org/packages/apacman/
GNU General Public License v3.0
70 stars 11 forks source link

search chokes on unfound packages #24

Closed ghost closed 8 years ago

ghost commented 9 years ago
  [bts@workhorse ~]$ apacman -Si blahblah
  /var/tmp/apacman/blahblah.PKGBUILD: line 1: html: No such file or directory
  /var/tmp/apacman/blahblah.PKGBUILD: line 2: syntax error near unexpected token `<'
  'var/tmp/apacman/blahblah.PKGBUILD: line 2: `<head><title>Index of /</title></head>
  Repository     : aur
  Name           : 
  Version        : -
  URL            : 
  AUR            : https://aur.archlinux.org/packages//
  Licenses       : 
  Groups         : None
  Provides       : None
  Depends On     : 
  Make Depends   : 
  Optional Deps  : None
  Conflicts With : None
  Replaces       : None
  Architecture   : 
  Description    : 

If a package is not found, it seems to choke.

Here's the contents of blahblah.PKGBUILD:

  <html>
  <head><title>Index of /</title></head>
  <body bgcolor="white">
  <h1>Index of /</h1><hr><pre><a href="../">../</a>
  <a href="api/">api/</a>                                               21-Jun-2015 20:34                   -
  <a href="api.old/">api.old/</a>                                           21-Jun-2015 17:40                   -
  <a href="testReport/">testReport/</a>                                        14-Mar-2015 19:14                   -
  <a href="testReport.tar">testReport.tar</a>                                     14-Mar-2015 19:23              163840
  </pre><hr></body>
  </html>

You can perhaps check the status of the RPC call via something like: curl -sLf someurlhere and then get the exit code via the "${?}" variable. it will be 0 if it returns successfully (HTTP status 200), otherwise it will be i.e. 22 for a 404.

oshazard commented 9 years ago

I cannot seem to reproduce.

$ apacman -Si blahblah
error: package 'blahblah' was not found

What version of apacman are you using?

$ apacman -Ss apacman  
aur/apacman 2.0-2 [installed] (16)
    AUR wrapper forked from packer
oshazard commented 9 years ago

Also are you using a config file (/etc/apacman.conf) ? you can check which flags are enabled as such

$ apacman -v
apacmanconf    : /etc/apacman.conf                     
downdir        : /var/cache/pacman/pkg                 
makepkgconf    : /etc/makepkg.conf                     
pacmanconf     : /etc/pacman.conf                      
savedir        : /var/cache/apacman/pkg                
tmpdir         : /tmp/apacmantmp-1001                  
progress       : yes                                   
error: must specify a package.
ghost commented 9 years ago

you know, i rebooted for a kernel upgrade and for the life of me, i cannot reproduce this now. so sorry, oshazard! closing. :)

ghost commented 9 years ago

WAIT! there we go. wrong machine.

[root@workhorse ~]# apacman -Si blahblah
/var/tmp/apacman/blahblah.PKGBUILD: line 1: html: No such file or directory
/var/tmp/apacman/blahblah.PKGBUILD: line 2: syntax error near unexpected token `<'
'var/tmp/apacman/blahblah.PKGBUILD: line 2: `<head><title>Index of /</title></head>
Repository     : aur
Name           : 
Version        : -
URL            : 
AUR            : https://aur.archlinux.org/packages//
Licenses       : 
Groups         : None
Provides       : None
Depends On     : 
Make Depends   : 
Optional Deps  : None
Conflicts With : None
Replaces       : None
Architecture   : 
Description    : 

[root@workhorse ~]# apacman -Qi apacman
Name           : apacman
Version        : 2.0-2
Description    : AUR wrapper forked from packer
Architecture   : any
URL            : http://github.com/oshazard/apacman
Licenses       : GPL
Groups         : None
Provides       : packer
Depends On     : bash  binutils  ca-certificates  curl  fakeroot  file  grep  jshon  sed  tar  wget
Optional Deps  : apacman-deps: Required AUR build depends [installed]
                 apacman-utils: Useful AUR tools
                 customizepkg: Tool to auto-patch AUR PKGBUILDs
                 rsync: Built-in ABS support [installed]
Required By    : None
Optional For   : None
Conflicts With : None
Replaces       : None
Installed Size :  82.00 KiB
Packager       : Unknown Packager
Build Date     : Mon 24 Aug 2015 07:29:25 PM EDT
Install Date   : Mon 24 Aug 2015 07:32:54 PM EDT
Install Reason : Explicitly installed
Install Script : Yes
Validated By   : None

[root@workhorse ~]# apacman -v
apacmanconf    : /etc/apacman.conf                     
builddir       : /var/tmp/pkgbuild-0                   
downdir        : /var/cache/pacman/pkg                 
editor         : /usr/bin/vim                          
makepkgconf    : /etc/makepkg.conf                     
pacmanconf     : /etc/pacman.conf                      
savedir        : /var/cache/apacman/pkg                
tmpdir         : /var/tmp/apacman                      
noconfirm      : yes                                   
noedit         : yes                                   
skipinteg      : yes                                   
error: must specify a package.

this is for my testing buildbox, so it's not high priority, but i was able to reproduce it (curiously, however, only on one of my machines). if i had to guess, it might be my custom tmdir/builddir?

oshazard commented 9 years ago

@bts368 can you please try version 2.1. While, I haven't made any changes specifically addressing this, there were a few bugs fixed that may have indirectly had an effect on this.

oshazard commented 9 years ago

@bts368 added a bunch of sanity checks to v2.2, please give it a try.

ghost commented 8 years ago

Sorry for the delay, @oshazard! I am closing this, the issue seems to now be resolved.