You are not logged in.

#1 2007-06-29 07:42:16

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

Removing local packages in cascade...

I often make new packages for programs that are absent in every repo so I often need to install some other dependences, both for compile time or for running time.

If later I'd like to uninstall the package using pacman -Rns, pacman does not removes the packages no more needed.

I do not know if it is a bug, it is intended or solvable. For I think that when uninstalling with -Rs pacman should check what is now a leaf of the dependency DAG and it wasn't before uninstalling and uninstall everything...

What do you think?

Offline

#2 2007-06-29 08:16:13

stonecrest
Member
From: Boulder
Registered: 2005-01-22
Posts: 1,190

Re: Removing local packages in cascade...

I'm a little confused because you mention "cascade", which corresponds to -Rc, but your description seems to be about -Rs.

Anyway, according to man pacman:

REMOVE OPTIONS
       -s, --recursive
              Remove each target specified including all dependencies, provided that (A) they are not required by other packages; and (B) they  were  not explicitly installed by the user.  This option is analogous to a backwards --sync operation.

So either you are explicitly installing these packages or they are required by other packages.

Last edited by stonecrest (2007-06-29 08:16:43)


I am a gated community.

Offline

#3 2007-06-29 08:30:30

hacosta
Member
From: Mexico
Registered: 2006-10-22
Posts: 423

Re: Removing local packages in cascade...

that's the intended behavior, pacman won't recursively remove packages if they were explicitly installed... the only way arround this (that i know of) is to make your own local repo so you can pacman -S your_repo/package  and that way dependencies are pulled as dependencies


*i really think i wasn't clear so you can probably disregard this message

Offline

#4 2007-06-29 08:39:51

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

Re: Removing local packages in cascade...

@stonecrest
This answer about the `intended' part....

@hacosta
So I have to make a local repo? I thought it was an overkill for a single workstation instead it is actually the only way...But this won't solve the problem of compile time dependences, do it?

Offline

#5 2007-06-29 10:59:04

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: Removing local packages in cascade...

That one is pretty complicated.
There are cases when we want to do this "installed as dependencies" extra check for -Rs, and other cases when we don't.

See http://bugs.archlinux.org/task/3241#comment16872 where I tried to explain a situation where this check is wanted.
And this current thread for a situation where it isn't wanted.

An hackish but useful solution was to use pacman -D, for faking the "installed as deps part" , but this option has been removed
(probably because of the hackish nature) :
http://bugs.archlinux.org/task/7193

Another might be to allow disabling this extra check for -Rs (with an extra option, or something).


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#6 2007-06-29 11:17:51

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

Re: Removing local packages in cascade...

This is crazy... if there is an undocumented feature the most logical action is document it, not remove it... Crazy....

Offline

#7 2007-06-29 11:44:52

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: Removing local packages in cascade...

ezzetabi wrote:

This is crazy... if there is an undocumented feature the most logical action is document it, not remove it... Crazy....

You can't document something if you don't understand why it's there in the first place.
And it isn't easy to understand the purpose of something both a little hackish and undocumented.
Though, I'm not saying it should have been removed but well.. that isn't a real problem, because it's easy to add it back.

Anyway, which one would you prefer between adding back that pacman -D option, and making -Rs configurable ?


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#8 2007-06-29 13:32:13

lloeki
Member
From: France
Registered: 2007-02-20
Posts: 456
Website

Re: Removing local packages in cascade...

I just set up a local repository, it's then much easier for me.

personally, I use this convenience script of my own made, so as to make the process easier and cleaner.

features include:
- KISS: one thing does one task and does it right, leveraging existing ones (makepkg, repo-add, ...). as a side effect, it does NOT attempt to resolve dependencies or install the package. this is not yaourt. this is not pacman.
- builds in a tmp dir (i.e /var/abs/local/packagename/ contains and will only contain package 'source' files, like PKGBUILD)
- caches downloaded files (not stored /var/abs/local/packagename/, see remark above)
- moves the built package to a local repo, removing previous version
- bonus: fetches and builds packages from the AUR, resulting in only the built package (and cached files) added to the repo.
- attempts to sanitize rights of the package before building (e.g for when some AUR packages have weird groups or even dirs with setgid set, instilling weirdness upon installation)

it's easy as pie to setup, just set up the thing like this:
add this to /etc/pacman.conf

[aur]
Server = file:///var/local/pacman/aur

[abs]
Server = file:///var/local/pacman/abs

create four dirs:

mkdir -p /var/local/pacman/abs
mkdir -p /var/local/pacman/aur
mkdir -p /var/local/cache/abs
mkdir -p /var/local/cache/aur

now, just use abs (in /var/abs/local) normally, except the 'makepkg' part.
instead you run, as root (as I'm not fond of fakeroot, but with proper permissions set, it might just work):

absman.sh abs packagename

where packagename is the name of the package (which you hopefully stored in /var/abs/local/packagename)
then run

pacman -Sy packagename

notes:
- options (including directories) are settable in either the script itself or in /etc/absman.conf. see the beginning of the script source.
- as it was then trivial to implement, I added the ability to remotely fetch and build a package from the AUR, which end up in an aur local repository. just call the thing with aur instead of abs as first arg.
- failure leave temp files in /tmp/reponame/randomdir: this is intended, so as to investigate failure cause.
- obviously this will not exactly work for build time dependencies unless they're already installed. maybe I should add '-sr' to makepkg?

Last edited by lloeki (2007-06-29 13:45:20)


To know recursion, you must first know recursion.

Offline

#9 2007-06-29 16:31:23

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

Re: Removing local packages in cascade...

@shining
Personally I think it is better changing the -R option. Yet, if -D did the job it sounded strange it has been removed.

Offline

Board footer

Powered by FluxBB