Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Jun 2016 12:51:18 +0200
From:      Miroslav Lachman <000.fbsd@quip.cz>
To:        Baptiste Daroussin <bapt@FreeBSD.org>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: How to change repository name of installed packages in local database?
Message-ID:  <577256A6.6020303@quip.cz>
In-Reply-To: <20160628103316.zabg6oipxqnfge3f@ivaldir.etoilebsd.net>
References:  <57724E71.4030600@quip.cz> <20160628103316.zabg6oipxqnfge3f@ivaldir.etoilebsd.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Baptiste Daroussin wrote on 06/28/2016 12:33:
> On Tue, Jun 28, 2016 at 12:16:17PM +0200, Miroslav Lachman wrote:
>> I searched the man pages but cannot find the answer.
>> If we have machine with packages installed from more than one repository and
>> one day we want to use some already installed packages from another
>> repository, is there any easy way of switching this packages to another
>> repo?

[...]

>> Now we need to switch all packages from testing repo "redmine320" to
>> production repo "codelab".
>>
>> Is there any other way instead of manual deinstall and reinstall of all
>> those packages?
>>
>
> # remove the "repository" annotation
> pkg annotate -D expat repository
>
> # add the new one
> pkg annotate -A expat repository codelab
>
> For convenience we could allow to overrite an existing one, but we do not yet

Modification with pkg annotate -M works for me!

    # pkg annotate -M rubygem-web-console repository codelab
rubygem-web-console-2.3.0: Change annotation tagged: repository to new 
value: codelab? [y/N]: y
rubygem-web-console-2.3.0: Modified annotation tagged: repository

    # pkg annotate -S rubygem-web-console repository
rubygem-web-console-2.3.0: Tag: repository Value: codelab


I switched all repo "redmine320" packages to repository "codelab" with 
following command (not so elegant)

   # pkg query '%R %n' | awk '$1 == "redmine320" { print $2 }' | xargs 
-L1 -J % pkg annotate -y -M % repository codelab


Thank you Bapt and Franco!

Miroslav Lachman




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?577256A6.6020303>