From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Wingo Subject: Re: bug#22693: `guix refresh -u` updates other packages with same version Date: Mon, 04 Apr 2016 13:53:38 +0200 Message-ID: <87r3elh9od.fsf@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]:35985) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1an34l-0006p2-2v for guix-devel@gnu.org; Mon, 04 Apr 2016 07:53:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1an34h-0001gp-RY for guix-devel@gnu.org; Mon, 04 Apr 2016 07:53:47 -0400 Received: from pb-sasl0.pobox.com ([208.72.237.25]:57832 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1an34h-0001gj-NR for guix-devel@gnu.org; Mon, 04 Apr 2016 07:53:43 -0400 In-Reply-To: <87pou5oete.fsf@member.fsf.org> (=?utf-8?B?IuWui+aWh+atpiIn?= =?utf-8?B?cw==?= message of "Mon, 04 Apr 2016 18:20:45 +0800") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: =?utf-8?B?5a6L5paH5q2m?= 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