Main page I Packages I Help I Forum

SvarDOS community forum

a place to talk about SvarDOS and other DOS-related things

jump to end reply list of threads

One can run 'pkg update PACKAGE' multiple times. Bug or feature?

aa23a6c4b2c12ce9 5293d7dd5c2e3994 352c1076588a3d54 b0a123df50cd5aa0 a83fa45a6763865f 7ee5b98b3a9b6080 a94232d4849d48c6 b025711ecd4619bf
I wonder why 'pkg update PACKAGE' doesn't complain about the new version being already installed.
aa23a6c4b2c12ce9 5293d7dd5c2e3994 352c1076588a3d54 b0a123df50cd5aa0 a83fa45a6763865f 7ee5b98b3a9b6080 a94232d4849d48c6 b025711ecd4619bf
I can even use 'pkg update PACKAGE' to downgrade to an earlier version.
078ac416e4811d4f ac7134fc6c34222e e676a6b143232a57 f638c349b414e0e6 b25cc1129ce8293c bc9a49b88c1ea9f5 a8d5c26e0797bc6f 2eba886e5c7e366b
Yes, that's on purpose - the "update" action is really "remove and install" (but with some extra steps to ensure the installation will succeed before removing the current package). It is useful for downgrading a package, or simply reinstalling it in case it got broken for whatever reason. Making pkg to complain about the same version being already installed could be possible, but then it would imply adding some "--force" argument. More logic, more code, more translations... and at the end of the day I'm not sure there would be a real (practical) added value. Maybe the "update" action could be renamed to something else, but I have no idea what. "reinstall" would probably be even more confusing. Mateusz
aa23a6c4b2c12ce9 5293d7dd5c2e3994 352c1076588a3d54 b0a123df50cd5aa0 a83fa45a6763865f 7ee5b98b3a9b6080 a94232d4849d48c6 b025711ecd4619bf
I see. So, it just works different than other systems do.
> Maybe the "update" action could be renamed to something else, but I have no idea what. "reinstall" would probably be even more confusing.
Why do we need a different action at all? Why not integrate this function into the normal "install" action?
078ac416e4811d4f ac7134fc6c34222e e676a6b143232a57 f638c349b414e0e6 b25cc1129ce8293c bc9a49b88c1ea9f5 a8d5c26e0797bc6f 2eba886e5c7e366b
> Why do we need a different action at all? Why not integrate this function into the normal "install" action?
The only reason I see is that the user might overwrite an already installed application without expecting it and be surprised/angry when he realizes what happened. When we do an "install" action I suppose we usually expect to add something to our system - that is, not loosing something we have already. Let's imagine the user is not aware that he has some package-1.0 installed (because he installed it a long time ago). He downloads package-0.9, tries to install it, and only then he sees that he just lost his previous (potentially precious) package-1.0. While if the user does an "update" action, he is evidently informed that the package already exists on his system, thus his action will lead to the package being overwritten. So it's basically about the assumption we make as how much awareness the user has of what he is about to do. I may be doing kindergarten-level psychology here, but that's how I see it. :-) Still, I agree that "updating" a package to same version or lower does sound odd and not very intuitive. I briefly thought about adding a new "reinstall" action that would be the same as "update" but explicitly checking that the packages are in the exact same version, but dropped the idea because I do not think there is a practical advantage of doing this because ultimately updating a package to the same version is unlikely to do any harm. Plus, it would not solve the issue of a package being "updated" to an older version anyway. Comparing version strings in pkg is not exactly realistic because of how unorganized the version strings are in the DOS world, so the only thing I can think of is renaming "pkg update" to something else.... maybe "pkg replace". It sounds quite weird (to me at least), but it would better reflect what actually happens. And it would just as well make sense for same-version packages - after all, if user decides to "replace" a package, he likely checked already what his current package is and knows what is about to be replaced. So I think it all boils down to nomenclature and the assumption users will make for any given action: - "update / upgrade": suggests that an older version of the package will be replaced with a newer version - "reinstall": suggests exact same package to be reinstalled - "replace": package x (whatever version) is about to be replaced by package y (whatever version) Given the above, "replace" is probably much better fitting than "update". Mateusz
aa23a6c4b2c12ce9 5293d7dd5c2e3994 352c1076588a3d54 b0a123df50cd5aa0 a83fa45a6763865f 7ee5b98b3a9b6080 a94232d4849d48c6 b025711ecd4619bf
> When we do an "install" action I suppose we usually expect to add something to our system
Why is the action called "install" then but not "add"? ;-)
> Given the above, "replace" is probably much better fitting than "update".
I would be fine with "replace".

your name or nick

password (optional)


check the MIDDLE box: