X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id E67C8DC00CB for ; Thu, 29 Nov 2012 12:42:37 +0000 (UTC) Received: from compute6.internal (compute6.nyi.mail.srv.osa [10.202.2.46]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 744EB2165E for ; Thu, 29 Nov 2012 07:42:37 -0500 (EST) Received: from frontend2.nyi.mail.srv.osa ([10.202.2.161]) by compute6.internal (MEProxy); Thu, 29 Nov 2012 07:42:37 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:to:subject:message-id :references:mime-version:content-type:in-reply-to; s=smtpout; bh=QOAqzQbvEAjzpJ07vM7m6kt0fic=; b=Ru3fi+Zab9gLmMDXpW0khdf9OZe8 YTnCaJYQM0kc0kd+60g3ADPG52y5cvoPR9W/NTmiSn7Bz1ulifDw75uD/peC7uOv oz24iWyxBq05/DQrfnZaEHpZy+k/PoiHn8VzrlYgPN9cHBu5nN4MHaGYaa9hgZRR vpXV35ZbMBIFOfk= X-Sasl-enc: GwV2e2PSrpV9VhBYOo/WF4ClGgOkuPtvI6bwMh1nfxxW 1354192957 Received: from localhost (unknown [69.86.161.244]) by mail.messagingengine.com (Postfix) with ESMTPA id 2FEB1482646 for ; Thu, 29 Nov 2012 07:42:37 -0500 (EST) Date: Thu, 29 Nov 2012 07:40:28 -0500 From: Dubiousjim To: alpine-devel@lists.alpinelinux.org Subject: Re: [alpine-devel] Some questions about apk-tools Message-ID: <20121129124028.GE2390@vaio.jimpryor.net> References: <20121128234406.GD2390@vaio.jimpryor.net> <20121129084044.29515fc1@vostro> X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121129084044.29515fc1@vostro> User-Agent: Mutt/1.5.21 (2010-09-15) Hi Timo, thanks for your replies! On Thu, Nov 29, 2012 at 08:40:44AM +0200, Timo Teras wrote: > > > > What exactly is the difference between `apk add ...` and `apk > > fix ...`? > > "add" will record in the '/etc/apk/world' that the package is something > user wanted explicitly to be installed. > > "fix" will just re-install it only if it is already installed. "fix" > will always also re-install the package, "add" will only do things if > it was not installed. > > > What is the difference between `apk add -u ...` and `apk fix -u ...` > > and `apk fix -r ...` and `apk upgrade` (except for the fact that the > > last operates on a broader set of packages)? > > "add -u" will record the package in world. "fix -u" will do almost same > thing except not record the package in world. Ok, but I'm still unclear on the difference between the without "-u" and the with "-u" version of each of these. Suppose I've got these packages installed: alpha-1.0 beta-1.0 And that these packages are available in my repositories: alpha-1.0 beta-2.0 gamma-2.0 The handling of /etc/apk/world aside, will there be any difference in the behavior of "apk add _", "apk add -u _", "apk fix _" and "apk fix -u _", when each of alpha,beta,gamma are substituted for _: Trying to get a handle on why the "-u" option is there. > With "fix -r" will operate on the specified package list, and can > re-install most of the package. So "fix -r foo" reinstalls foo and all of foo's dependencies? I'm not sure if I'm understanding rightly? > "upgrade" works with world - it > upgrades all packages. "upgrade -a" is also notable, and in addition to > regular "upgrade" it also resets all versioned world dependencies, and > tries to make sure all packages come from some active repository. Right, I understand the broad outlines of upgrade and upgrade -a. But let's say that beta is the only installed package I have that's out of date (as in the above examples). In that situation, would "apk upgrade" have the same net effect as "apk add beta"? Or "apk add -u beta"? or some form of "apk fix"? > > What exactly is the effect of `apk add --initdb`? > > It creates the apk databases in /lib/apk/db/. Basically, this is needed > when you are creating a new rootfs, or chroot install. Ok, thanks. > > What exactly is the effect of the "generic options" --clean-protected > > and --purge? I see that they have to do with .apk-new files, but would > > appreciate hearing them explained more fully. > > In /etc/apk/protected_paths.d/*.list you can define which system > directories are treated specially. Generally this is /etc. On these > "protected directories" apk never overwrites modified files. Normally, > if file is modified, the new file will be extracted with .apk-new > extension (e.g. updated sample or default config file). > > --clean-protected will make apk not create those .apk-new files. The > updated config files are just silently discarded and not made available. > > --purge affects only "del" command. If package is deleted, and it has > modified config file, it is normally left intact. With --purge all > config files will be deleted regardless if they are modified or not. Ok, thanks. > > What exactly is the behavior of `apk audit`? Does it work only in > > cooperation with lbu? What is the exact effect of the --backup and > > --recursive options for this command? > > You can use "audit" independently and it can be useful. It was created > for lbu, though. Basically, lbu uses "audit" to figure out which files > need to go into the overlay tarball. > > "audit" requires you to specify --backup or --system to determine mode > of operation. --backup makes it only consider "protected files", that > is the special directories marked as to contain configuration files. > Where as --system makes apk consider all installed files - this can be > used to do security audit that no system binary is changed. > > --recursive option changes audit output. Normally if there is a new > directory inside /etc, apk would just report the directory entry. > --recursive makes apk scan the new directory for all files/subdirs and > report them individually. This was created to help 'lbu' pass the full > filelist to tar. I believe we needed this to properly store minimal set > of changes with tar in case someone modified permissions of > protected directory. Basically it makes output to something which can > be just passed on to "tar --no-recursion". > > > If I do get to understand these things better, I'll try to help make > > sure they're better documented. > > Thanks! > > Please do ask if there's additional things you want to know. Many of > apk's features are not documented well enough. So thank you for helping > in this! Thanks, all of the rest is clear. -- Dubiousjim dubiousjim@gmail.com --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---