From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#22693: `guix refresh -u` updates other packages with same version Date: Mon, 04 Apr 2016 22:57:09 +0200 Message-ID: <87inzxcct6.fsf__48147.3035448746$1459803503$gmane$org@gnu.org> References: <20160216092724.GA10422@jasmine> <87pou5oete.fsf@member.fsf.org> <87r3elh9od.fsf@igalia.com> 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]:40315) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anBZV-0002Z6-KB for bug-guix@gnu.org; Mon, 04 Apr 2016 16:58:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1anBZS-00013K-ES for bug-guix@gnu.org; Mon, 04 Apr 2016 16:58:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:54324) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anBZS-00013B-B0 for bug-guix@gnu.org; Mon, 04 Apr 2016 16:58:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1anBZS-00055u-5o for bug-guix@gnu.org; Mon, 04 Apr 2016 16:58:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87r3elh9od.fsf@igalia.com> (Andy Wingo's message of "Mon, 04 Apr 2016 13:53:38 +0200") 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: Andy Wingo Cc: guix-devel@gnu.org, 22693@debbugs.gnu.org, =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Andy Wingo skribis: > 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 upstre= am). >> it find the file, then use =E2=80=98substitute=E2=80=99 to replace the v= ersion 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 = get 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. Right. =E2=80=98package-field-location=E2=80=99 does something along these= lines. > Then limit your substitute* to work within those lines. A simpler yet less elegant trick used in =E2=80=98report-formatting-issues= =E2=80=99 in (guix scripts lint) is to have a maximum number of lines assumed to be part of the =E2=80=98package=E2=80=99 form following its starting line. Thanks, Ludo=E2=80=99.