From owner-freebsd-ports@freebsd.org Tue Jun 28 10:51:23 2016 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0288BB8543E for ; Tue, 28 Jun 2016 10:51:23 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (elsa.codelab.cz [94.124.105.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 659572156; Tue, 28 Jun 2016 10:51:22 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (localhost [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id B7F0928435; Tue, 28 Jun 2016 12:51:19 +0200 (CEST) Received: from illbsd.quip.test (ip-86-49-16-209.net.upcbroadband.cz [86.49.16.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by elsa.codelab.cz (Postfix) with ESMTPSA id E951A28429; Tue, 28 Jun 2016 12:51:18 +0200 (CEST) Message-ID: <577256A6.6020303@quip.cz> Date: Tue, 28 Jun 2016 12:51:18 +0200 From: Miroslav Lachman <000.fbsd@quip.cz> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:35.0) Gecko/20100101 Firefox/35.0 SeaMonkey/2.32 MIME-Version: 1.0 To: Baptiste Daroussin CC: freebsd-ports@freebsd.org Subject: Re: How to change repository name of installed packages in local database? References: <57724E71.4030600@quip.cz> <20160628103316.zabg6oipxqnfge3f@ivaldir.etoilebsd.net> In-Reply-To: <20160628103316.zabg6oipxqnfge3f@ivaldir.etoilebsd.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2016 10:51:23 -0000 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