You are not logged in.

#351 2010-03-13 20:39:26

X-dark
Member
From: France
Registered: 2009-10-25
Posts: 142
Website

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

q0tsa wrote:
X-dark wrote:

BTW, what's wrong with Firefox being nammed Namoroka ? It's the same, works the same ...

Not really the right place to discuss this. Let's say I'm just used to the original icons and firebrand is a very easy way to get them.

Sorry, I was just trolling. lol


Cedric Girard

Offline

#352 2010-03-16 16:14:57

wassup
Member
Registered: 2010-03-16
Posts: 12

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

Hello everyone!

I would like to suggest a new feature. While it is good for a normal use of packer to show the colorized output, it is not really intended when one uses it in a scripts. Can I, therefore, ask for the --nocolor switch to be added, please?

Kind regards.

Offline

#353 2010-03-25 04:57:54

disturb
Member
Registered: 2009-12-18
Posts: 70

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

Is it just me or packer has a bad case of vi ?
Even though all my editor env vars are set to emacs, it still edits with vi...
Am I missing something, or is this a bug ?

Last edited by disturb (2010-03-25 04:58:23)

Offline

#354 2010-03-25 05:34:05

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

disturb wrote:

Even though all my editor env vars are set to emacs, it still edits with vi...
Am I missing something, or is this a bug ?

This has been brought up in this thread before. (see http://bbs.archlinux.org/viewtopic.php? … 41#p711541) As silly as it sounds, after setting your EDITOR variable, have you tried rebooting and then running packer again?

Offline

#355 2010-03-25 09:27:47

X-dark
Member
From: France
Registered: 2009-10-25
Posts: 142
Website

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

drcouzelis wrote:

[...] after setting your EDITOR variable, have you tried rebooting and then running packer again?

Rebooting ? Are you joking ? tongue
If you define EDITOR in your bashrc, just source it and run packer from the same terminal.
The worst thing you may have to do is log out and log in if you defined EDITOR with some exotic way (I can't think of any). But why rebooting ?

Last edited by X-dark (2010-03-25 09:28:09)


Cedric Girard

Offline

#356 2010-03-25 12:49:21

jdarnold
Member
From: Medford MA USA
Registered: 2009-12-15
Posts: 485
Website

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

Is it trying to edit the files as root and do you have root's EDITOR set to emacs?

Offline

#357 2010-03-25 13:45:42

JohannesSM64
Member
From: Norway
Registered: 2009-10-11
Posts: 623
Website

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

drcouzelis wrote:

have you tried rebooting

Hey, this isn't Windows big_smile

Offline

#358 2010-03-25 14:12:29

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

X-dark wrote:

Rebooting ? Are you joking ? tongue

JohannesSM64 wrote:

Hey, this isn't Windows big_smile

Oh, for goodness sake, I was just quoting a "solution" from someone who had a similar problem. Pages 12 and 13 of this thread are filled with posts about packer using vi instead of another editor. Go respond to those posts. tongue

jdarnold wrote:

Is it trying to edit the files as root and do you have root's EDITOR set to emacs?

I never thought of that! And I don't think anyone else mentioned that as a possible reason for the problem in this thread. I wonder if packer is trying to load the editor for root instead of the editor for the user. Maybe bruenig has an idea about it. big_smile

Offline

#359 2010-03-28 03:07:56

bruenig
Member
Registered: 2007-05-20
Posts: 175

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

I added drcouzelis man page. packer -S packer should get it. All the other code is the same though.

Offline

#360 2010-03-31 03:13:08

kjslag
Member
Registered: 2009-11-03
Posts: 43

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

When I upgrade packages, yaourt tells me what the old version was, and lets me know if only the package release has changed. It would be nice to have this in packer.

core/grep 2.6.1-1 -> 2.6.2-1
extra/chromium version 5.0.342.8 release 1 -> 2

Offline

#361 2010-03-31 06:34:01

bruenig
Member
Registered: 2007-05-20
Posts: 175

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

kjslag wrote:

When I upgrade packages, yaourt tells me what the old version was, and lets me know if only the package release has changed. It would be nice to have this in packer.

core/grep 2.6.1-1 -> 2.6.2-1
extra/chromium version 5.0.342.8 release 1 -> 2

But when you update it in pacman, it doesn't....

Offline

#362 2010-03-31 07:10:48

Kiwi
Member
Registered: 2008-02-24
Posts: 153

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

Hey, if Yaourt can do it, Packer can do it, and better! Amirite?

Offline

#363 2010-03-31 07:54:23

neldoreth
Member
From: AT
Registered: 2009-02-01
Posts: 212

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

Hello,

I just wrote a little patch that forwards some of the "-R"-remove and "-Q"-query commands right to pacman. It is not much code, but it brought me to the idea that the "sub"-arguments like the i in -Qi should be parsed in a better way.

From b9dcad08e9e49a0f839f4f7f8bbf16bef0374ff2 Mon Sep 17 00:00:00 2001
From: neldoreth <mail@pwmt.org>
Date: Wed, 31 Mar 2010 09:47:03 +0200
Subject: [PATCH] Forward remove and query commands

This patch forwards some -R remove and -Q query commands to
pacman:

  -R
  -Rd
  -Rf
  -Rdf
  -Rfd
  -Q
  -Qi
  -Qs
---
 packer |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/packer b/packer
index 2bec5a0..015abd8 100755
--- a/packer
+++ b/packer
@@ -44,6 +44,8 @@ usage() {
   echo '    -Syu|-Su    - updates all packages'
   echo '    -Ss|-Ssq    - searches for package'
   echo '    -Si         - outputs info for package'
+  echo '    -Q          - query package'
+  echo '    -R          - removes package'
   echo '    -G          - download and extract aur tarball only'
   echo
   echo '    --quiet     - only output package name for searches'
@@ -470,6 +472,14 @@ while [[ $1 ]]; do
     '-Ssq'|'-Sqs') option=search ; quiet='1' ;;
     '-Si') option=info ;;
     '-Su'|'-Suy'|'-Syu'|'-Syyu'|'-Suyy'|'Syuy') option=update ; pacmanarg="$1" ;;
+    '-Q') option=query ;;
+    '-Qi') option=query; info=1 ;;
+    '-Qs') option=query; search=1 ;;
+    '-R') option=remove ;;
+    '-Rd') option=remove ; nodeps=1;;
+    '-Rf') option=remove ; force=1;;
+    '-Rdf') option=remove ; nodeps=1; force=1;;
+    '-Rfd') option=remove ; nodeps=1; force=1;;
     '-G') option=download ;;
     '-h'|'--help') usage ;;
     '--quiet') quiet='1' ;;
@@ -582,6 +592,34 @@ if [[ $option = download ]]; then
   done
 fi
 
+# Query -Q
+if [[ $option = query ]]; then
+  if [ -n "$info" ]; then
+    arg+="i"
+  fi
+  if [ -n "$search" ]; then
+    arg+="s"
+  fi
+
+  for package in "${packageargs[@]}"; do
+    runasroot $outputpacman -Q$arg $package
+  done
+fi
+
+# Remove package -R
+if [[ $option = remove ]]; then
+  if [ -n "$nodeps" ]; then
+    arg+="d"
+  fi
+  if [ -n "$force" ]; then
+    arg+="f"
+  fi
+
+  for package in "${packageargs[@]}"; do
+    runasroot $outputpacman -R$arg $package
+  done
+fi
+
 # Search (-Ss) handling
 if [[ $option = search || $option = searchinstall ]]; then
   # Pacman searching 
-- 
1.7.0.3

Best regards


pwmt.org : programs with movie titles

Offline

#364 2010-03-31 09:58:40

X-dark
Member
From: France
Registered: 2009-10-25
Posts: 142
Website

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

Kiwi wrote:

Hey, if Yaourt can do it, Packer can do it, and better! Amirite?

Not doing it was mainly a speed concern.


Cedric Girard

Offline

#365 2010-03-31 23:33:02

bruenig
Member
Registered: 2007-05-20
Posts: 175

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

neldoreth wrote:

Hello,

I just wrote a little patch that forwards some of the "-R"-remove and "-Q"-query commands right to pacman. It is not much code, but it brought me to the idea that the "sub"-arguments like the i in -Qi should be parsed in a better way.

From b9dcad08e9e49a0f839f4f7f8bbf16bef0374ff2 Mon Sep 17 00:00:00 2001
From: neldoreth <mail@pwmt.org>
Date: Wed, 31 Mar 2010 09:47:03 +0200
Subject: [PATCH] Forward remove and query commands

This patch forwards some -R remove and -Q query commands to
pacman:

  -R
  -Rd
  -Rf
  -Rdf
  -Rfd
  -Q
  -Qi
  -Qs
---
 packer |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/packer b/packer
index 2bec5a0..015abd8 100755
--- a/packer
+++ b/packer
@@ -44,6 +44,8 @@ usage() {
   echo '    -Syu|-Su    - updates all packages'
   echo '    -Ss|-Ssq    - searches for package'
   echo '    -Si         - outputs info for package'
+  echo '    -Q          - query package'
+  echo '    -R          - removes package'
   echo '    -G          - download and extract aur tarball only'
   echo
   echo '    --quiet     - only output package name for searches'
@@ -470,6 +472,14 @@ while [[ $1 ]]; do
     '-Ssq'|'-Sqs') option=search ; quiet='1' ;;
     '-Si') option=info ;;
     '-Su'|'-Suy'|'-Syu'|'-Syyu'|'-Suyy'|'Syuy') option=update ; pacmanarg="$1" ;;
+    '-Q') option=query ;;
+    '-Qi') option=query; info=1 ;;
+    '-Qs') option=query; search=1 ;;
+    '-R') option=remove ;;
+    '-Rd') option=remove ; nodeps=1;;
+    '-Rf') option=remove ; force=1;;
+    '-Rdf') option=remove ; nodeps=1; force=1;;
+    '-Rfd') option=remove ; nodeps=1; force=1;;
     '-G') option=download ;;
     '-h'|'--help') usage ;;
     '--quiet') quiet='1' ;;
@@ -582,6 +592,34 @@ if [[ $option = download ]]; then
   done
 fi
 
+# Query -Q
+if [[ $option = query ]]; then
+  if [ -n "$info" ]; then
+    arg+="i"
+  fi
+  if [ -n "$search" ]; then
+    arg+="s"
+  fi
+
+  for package in "${packageargs[@]}"; do
+    runasroot $outputpacman -Q$arg $package
+  done
+fi
+
+# Remove package -R
+if [[ $option = remove ]]; then
+  if [ -n "$nodeps" ]; then
+    arg+="d"
+  fi
+  if [ -n "$force" ]; then
+    arg+="f"
+  fi
+
+  for package in "${packageargs[@]}"; do
+    runasroot $outputpacman -R$arg $package
+  done
+fi
+
 # Search (-Ss) handling
 if [[ $option = search || $option = searchinstall ]]; then
   # Pacman searching 
-- 
1.7.0.3

Best regards

There is no doubt that the parsing should be different if it were to be expanded. However, I do not see any reason why -R and -Q should be packer arguments. You can use pacman directly for that. Secondly, if one wanted this to be a full pacman replacement thing, the better way I think would be to just pass anything unfamiliar right off to pacman and let it handle parsing and error handling.

Offline

#366 2010-04-01 07:01:03

neldoreth
Member
From: AT
Registered: 2009-02-01
Posts: 212

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

Hello,

bruenig wrote:

There is no doubt that the parsing should be different if it were to be expanded. However, I do not see any reason why -R and -Q should be packer arguments. You can use pacman directly for that.

It is just because I personally do not want to differ between two programs when installing (or other operations) packages from the official repositories or the AUR.

bruening wrote:

Secondly, if one wanted this to be a full pacman replacement thing, the better way I think would be to just pass anything unfamiliar right off to pacman and let it handle parsing and error handling.

That is a good idea, I never thought of it.

Best regards

Last edited by neldoreth (2010-04-01 07:12:53)


pwmt.org : programs with movie titles

Offline

#367 2010-04-02 03:21:26

disturb
Member
Registered: 2009-12-18
Posts: 70

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

jdarnold wrote:

Is it trying to edit the files as root and do you have root's EDITOR set to emacs?

*slaps forehead*

thanks

Offline

#368 2010-04-05 10:33:38

thoffmeyer
Member
From: Chi
Registered: 2006-07-27
Posts: 91

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

Love it!

Offline

#369 2010-04-06 09:10:04

Sertse
Member
Registered: 2009-11-19
Posts: 35

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

There appears to be a bug when installing from aur. When you install stuff from the repo it's like this:

[acer@myhost ~]$ packer -S pidgin
resolving dependencies...
looking for inter-conflicts...

Targets (6): libnice-0.0.11-1  farsight2-0.0.17-1  silc-toolkit-1.1.10-1  libpurple-2.6.6-1  gtkspell-2.0.16-1  pidgin-2.6.6-1  

Total Download Size:    11.88 MB
Total Installed Size:   40.40 MB

Proceed with installation? [Y/n]

This tells you what deps there are and how much disk space is used, so you can decide if you really want to install it.

But if you install something from aur it's like this:

[acer@myhost ~]$ packer -S wxcam

Aur Targets    (1): wxcam
Pacman Targets (1): wxgtk

Proceed with installation? [Y/n] 
resolving dependencies...
looking for inter-conflicts...

Targets (1): wxgtk-2.8.10.1-6  

Total Download Size:    6.23 MB
Total Installed Size:   22.14 MB

Proceed with installation? [Y/n] 
:: Retrieving packages from extra...
 wxgtk-2.8.10.1-6-x86_64    6.2M 2023.5K/s 00:00:03 [#####################################################################################] 100%
checking package integrity...
(1/1) checking for file conflicts                   [#####################################################################################] 100%
(1/1) installing wxgtk                              [#####################################################################################] 100%
Edit wxcam PKGBUILD with $EDITOR? [Y/n]

It asks you straight away, before telling you about the disk space deps would take whether you want to install and by the time it does tell you the download needed and disk space required, it automatically starts downloading the deps. (Proceed with installation? [Y/n] :: Retrieving packages from extra... is automatic "Y" ....so here I was forced to download that 6mb without warning). I think the confirmation should come after you have a chance to check download size/disk space of the deps required. This only happens in aur...

Last edited by Sertse (2010-04-06 09:11:16)

Offline

#370 2010-04-06 18:20:51

bruenig
Member
Registered: 2007-05-20
Posts: 175

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

Sertse wrote:

There appears to be a bug when installing from aur. When you install stuff from the repo it's like this:

[acer@myhost ~]$ packer -S pidgin
resolving dependencies...
looking for inter-conflicts...

Targets (6): libnice-0.0.11-1  farsight2-0.0.17-1  silc-toolkit-1.1.10-1  libpurple-2.6.6-1  gtkspell-2.0.16-1  pidgin-2.6.6-1  

Total Download Size:    11.88 MB
Total Installed Size:   40.40 MB

Proceed with installation? [Y/n]

This tells you what deps there are and how much disk space is used, so you can decide if you really want to install it.

But if you install something from aur it's like this:

[acer@myhost ~]$ packer -S wxcam

Aur Targets    (1): wxcam
Pacman Targets (1): wxgtk

Proceed with installation? [Y/n] 
resolving dependencies...
looking for inter-conflicts...

Targets (1): wxgtk-2.8.10.1-6  

Total Download Size:    6.23 MB
Total Installed Size:   22.14 MB

Proceed with installation? [Y/n] 
:: Retrieving packages from extra...
 wxgtk-2.8.10.1-6-x86_64    6.2M 2023.5K/s 00:00:03 [#####################################################################################] 100%
checking package integrity...
(1/1) checking for file conflicts                   [#####################################################################################] 100%
(1/1) installing wxgtk                              [#####################################################################################] 100%
Edit wxcam PKGBUILD with $EDITOR? [Y/n]

It asks you straight away, before telling you about the disk space deps would take whether you want to install and by the time it does tell you the download needed and disk space required, it automatically starts downloading the deps. (Proceed with installation? [Y/n] :: Retrieving packages from extra... is automatic "Y" ....so here I was forced to download that 6mb without warning). I think the confirmation should come after you have a chance to check download size/disk space of the deps required. This only happens in aur...

I see what you are talking about, but there is no obvious way to do this, since the first prompt is generated by packer and the second prompt is generated by pacman.

Last edited by bruenig (2010-04-06 18:21:10)

Offline

#371 2010-04-06 20:39:54

JohannesSM64
Member
From: Norway
Registered: 2009-10-11
Posts: 623
Website

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

From a quick look at the code:

    if [[ $pacmandepends ]]; then
      runasroot $outputpacman --noconfirm --asdeps -S -- "${pacmandepends[@]}" || err "Installation failed."
    fi

Remove the --noconfirm if you want to be asked by pacman as well.

Offline

#372 2010-04-07 03:24:45

bruenig
Member
Registered: 2007-05-20
Posts: 175

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

JohannesSM64 wrote:

From a quick look at the code:

    if [[ $pacmandepends ]]; then
      runasroot $outputpacman --noconfirm --asdeps -S -- "${pacmandepends[@]}" || err "Installation failed."
    fi

Remove the --noconfirm if you want to be asked by pacman as well.

Sorry his comment was a bit confusing. Did he want it to allow him to answer the pacman prompt there, or did he want me to somehow combine the two prompts? I thought the latter, but if the former, it is pretty simply done like you point out.

Offline

#373 2010-04-07 06:16:22

Sertse
Member
Registered: 2009-11-19
Posts: 35

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

I don't mind either method. I just want to know the download/install size before needing to make a decision, so I know what I'm getting in to. The latter is probably "cleaner" though, but as long as it works, I'm good. smile

Offline

#374 2010-04-08 05:37:39

pluckypigeon
Member
Registered: 2009-01-09
Posts: 86

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

q0tsa wrote:

packer -S aur/firebrand

/tmp/packertmp-1000/aur/firebrand.info: No such file or directory
grep: /tmp/packertmp-1000/aur/firebrand.info: No such file or directory
/tmp/packertmp-1000/aur/firebrand.PKGBUILD: No such file or directory
/usr/bin/packer: line 126: /tmp/packertmp-1000/aur/firebrand.PKGBUILD: No such file or directory
/tmp/packertmp-1000/aur/firebrand.info: No such file or directory
grep: /tmp/packertmp-1000/aur/firebrand.info: No such file or directory

Aur Targets    (1): aur/firebrand

Proceed with installation? [Y/n] 
/tmp/packertmp-1000/aur/firebrand.PKGBUILD: No such file or directory
/usr/bin/packer: line 126: /tmp/packertmp-1000/aur/firebrand.PKGBUILD: No such file or directory
--2010-03-13 19:26:32--  http://aur.archlinux.org/packages/aur/firebrand/aur/firebrand.tar.gz
Resolving aur.archlinux.org... 208.92.232.29
Connecting to aur.archlinux.org|208.92.232.29|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2010-03-13 19:26:33 ERROR 404: Not Found.

tar: aur/firebrand.tar.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
/usr/bin/packer: line 273: cd: aur/firebrand: No such file or directory
No PKGBUILD found in directory.

The script uses $1 for installing packages

wget "http://aur.archlinux.org/packages/$1/$1.tar.gz"

Typing aur/package changes the url to:
aur.archlinux.org/packages/aur/package/package.tar.gz
when it should be:
aur.archlinux.org/packages/package/package.tar.gz

Just leave out the aur/ bit

Edit: Sorry, just saw that you left out the aur bit before and it caused problems

Last edited by pluckypigeon (2010-04-08 05:46:37)

Offline

#375 2010-04-12 07:37:48

bruenig
Member
Registered: 2007-05-20
Posts: 175

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

By the way, for those interested, if you do packer -S packer and get the latest git version of packer, you can use the script here: http://github.com/bruenig/pacwrap/blob/master/pacwrap.

It is a wrapper for all of those crying about wanting to be able to do EVERYTHING with packer. Anyways, I clearly spent little to no time on it. But for those who want to play with it, there it is.

Offline

Board footer

Powered by FluxBB