From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Wingo Subject: bug#22693: `guix refresh -u` updates other packages with same version Date: Mon, 04 Apr 2016 13:53:38 +0200 Message-ID: <87r3elh9od.fsf__43423.48048599$1459770862$gmane$org@igalia.com> References: <20160216092724.GA10422@jasmine> <87pou5oete.fsf@member.fsf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1an353-0006uw-Ah for bug-guix@gnu.org; Mon, 04 Apr 2016 07:54:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1an350-0001jH-4w for bug-guix@gnu.org; Mon, 04 Apr 2016 07:54:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:53508) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1an350-0001jD-1b for bug-guix@gnu.org; Mon, 04 Apr 2016 07:54:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1an34z-00074K-Pd for bug-guix@gnu.org; Mon, 04 Apr 2016 07:54:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87pou5oete.fsf@member.fsf.org> ("=?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?="'s message of "Mon, 04 Apr 2016 18:20:45 +0800") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Cc: guix-devel@gnu.org, 22693@debbugs.gnu.org On Mon 04 Apr 2016 12:20, iyzsong@member.fsf.org (=E5=AE=8B=E6=96=87=E6=AD= =A6) writes: > How to fix this? > > The procedure is =E2=80=98update-package-source=E2=80=99 in (guix upstrea= m). > it find the file, then use =E2=80=98substitute=E2=80=99 to replace the ve= rsion and > hash. =E2=80=98substitute=E2=80=99 works line-by-line, it can=E2=80=99t = match mutiple lines. > > I try: > - use =E2=80=98package-location=E2=80=99 and =E2=80=98read=E2=80=99 to g= et the package object, > but it lost all format and comments. One option: 1. open the source file for the package 2. Call (read) until port-line / port-column are beyond the package-location of the package 3. At that point you have the ending location of the package. Then limit your substitute* to work within those lines. Another option would be to extend substitute* to start on a certain line, and to limit the number of substitutions. That way if you start on package-location and limit to one substitution you are likely to update the correct version. Andy