From nobody Sun Apr 02 03:07:50 2023 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PpzVX5gf2z43pGD for ; Sun, 2 Apr 2023 03:08:04 +0000 (UTC) (envelope-from pprocacci@gmail.com) Received: from mail-oa1-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PpzVX3m4cz3jwb for ; Sun, 2 Apr 2023 03:08:04 +0000 (UTC) (envelope-from pprocacci@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-17ab3a48158so27336568fac.1 for ; Sat, 01 Apr 2023 20:08:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680404883; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=0KQSuKFXVqPDaIk6HPh+S/s2JbxSs7UOe/dhba3qspE=; b=I6mdruiB2wmkAlsk/C/DRTXZGx00nPvRb8XSdQyE+ElhsbtBmcYG+UMsukKJ+dX+6i 0kzOi7W3ENCvmog83OUsQR15tXiJyZsbHVF7B/ckRuM2/qPL4jDgkHLGG/bVlulYXk9V ALFr76+1EblcXf4YypdOXBSkAX91KBhAzU4fio1i/2qFpoe0cnCYvIHb2sNtvSd015J5 Y5JV5wt4hxJCHYHF22M8iJQ2r9VXXwX7NfEpcSKVYkZjY60rdF3e+RCTC3Tyiu5h0qTQ 82jmivmK9NFWtpO3q6offkclRkkLQ52qSP4Sa6fRL1ySmiWu+lZEN3KMFgkz/3it5IPQ mIow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680404883; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0KQSuKFXVqPDaIk6HPh+S/s2JbxSs7UOe/dhba3qspE=; b=x9x1igqTWrIEV/X/MYtE7cu3T723e3xsoY5tElNvr7tPhMoLu9QPDPV7gXBuJqknYu GqCG9gAKYLpFnbIujftM5+DfiRNwoHyRwEW7GLCoFu5YV7ZO9Q9AspnkXg8YWgqO8dxb CTlkibFYCj557z5693WBeqpxVRjt3btoASFZu5VdwgqRWuLRN4meP6/p9fkU1JDk63nQ ckPhLcgIWb1D73I7fURO/Sq+NRt7JD5J1EkMxtsHEKgjk/CnCKt6IwSqsnb1zvOKWBpl 3Pg8rWeLglSy4r2xgK15youy31XjGMxSan2RESP82csFamfbwSc4WwI5L828HChg0clT vGSg== X-Gm-Message-State: AO0yUKVgexyj2EgvSqx3IOnYwzP62DOGbvstan4ZBHQiF+gQ3SxNyiVp R79UAA3UOcsfsEobcSeGRdPRCbDt2LipNOEh6Q39RE7HkzG2 X-Google-Smtp-Source: AKy350Z5FTZd2hU5QV2n09CcNUsS2USIEyRdgQ2cwL0MY0qyjJ5ZWl1NEWrF1SzkPp1JGO4q4MLoRMJVV1GdwUIg2V8= X-Received: by 2002:a05:6871:2511:b0:17e:291d:94f3 with SMTP id yx17-20020a056871251100b0017e291d94f3mr10589299oab.6.1680404883068; Sat, 01 Apr 2023 20:08:03 -0700 (PDT) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Paul Procacci Date: Sat, 1 Apr 2023 23:07:50 -0400 Message-ID: Subject: Re: "pkg upgrade foo" installs foo if not already installed, bug? To: Aleksandr Miroslav Cc: freebsd-questions@freebsd.org Content-Type: multipart/alternative; boundary="000000000000225b9c05f851c063" X-Rspamd-Queue-Id: 4PpzVX3m4cz3jwb X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2001:4860:4864::/48, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000225b9c05f851c063 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Apr 1, 2023 at 9:16=E2=80=AFPM Aleksandr Miroslav wrote: > Observe the following: > > $ pkg info|grep -q cowsay && echo installed || echo not installed > not installed > $ sudo pkg upgrade -q -y cowsay > $ pkg info|grep -q cowsay && echo installed || echo not installed > installed > > It looks like when "pkg upgrade" is given an uninstalled package to > upgrade, it installs it. > > (This is on 13.1-RELEASE.) > > I would think the expected behavior would be to throw an error because th= e > package does not exist, or at least have a switch to control it. > > Am I misunderstanding how "pkg upgrade" should work, or was this > behavior changed recently? > > (I quickly looked through bugzilla, the pkg src tree, and the GitHub > issues for pkg and didn't find anything, but it's possible I may have > missed something.) > > pkg upgrade IS package install w/ the exception that pkg upgrade tries to upgrade dependencies of packages matched. Any packages listed on the command line are added to the list of packages to ensure are available. pkg-upgrade(8) has these details spelt out. ~Paul --=20 __________________ :(){ :|:& };: --000000000000225b9c05f851c063 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Sat, Apr 1, 2023 at 9:16=E2= =80=AFPM Aleksandr Miroslav <a= lexmiroslav@gmail.com> wrote:
Observe the following:

=C2=A0 =C2=A0 $ pkg info|grep -q cowsay && echo installed || echo n= ot installed
=C2=A0 =C2=A0 not installed
=C2=A0 =C2=A0 $ sudo pkg upgrade -q -y cowsay
=C2=A0 =C2=A0 $ pkg info|grep -q cowsay && echo installed || echo n= ot installed
=C2=A0 =C2=A0 installed

It looks like when "pkg upgrade" is given an uninstalled package = to
upgrade, it installs it.

(This is on 13.1-RELEASE.)

I would think the expected behavior would be to throw an error because the<= br> package does not exist, or at least have a switch to control it.

Am I misunderstanding how "pkg upgrade" should work, or was this<= br> behavior changed recently?

(I quickly looked through bugzilla, the pkg src tree, and the GitHub
issues for pkg and didn't find anything, but it's possible I may ha= ve
missed something.)


pkg upgrade IS package inst= all w/ the exception that pkg upgrade tries to upgrade dependencies of pack= ages matched.
Any packages listed on the command line are added t= o the list of packages to ensure are available.

pkg-upgrade(8) has these details spelt out.

~Paul

--
__________________

:(){ :|:&a= mp; };:
--000000000000225b9c05f851c063--