Search

CN-115167888-B - Software package updating method and device and computing equipment

CN115167888BCN 115167888 BCN115167888 BCN 115167888BCN-115167888-B

Abstract

The invention discloses a software package updating method, a software package updating device and computing equipment. The method for updating the software package is suitable for a server side and comprises the steps of responding to the fact that the software package is updated in an original warehouse, generating a target warehouse index file, copying the software package from an original path in the original warehouse to a target path in the target warehouse, modifying the original path of the software package in the target warehouse index file into the target path, obtaining an updated target warehouse index file, and completing the updating of the software package.

Inventors

  • WU RONGJIE

Assignees

  • 统信软件技术有限公司

Dates

Publication Date
20260512
Application Date
20220402

Claims (8)

  1. 1. A software package updating method, suitable for a server, the method comprising the steps of: generating a target warehouse index file in response to detection that the software package is updated in the original warehouse, wherein the content recorded by the target warehouse index file is the same as the content recorded by the original warehouse index file in the original warehouse; positioning the software package to obtain an original path of the software package; Copying the software package from an original path in the original warehouse to a target path in a target warehouse, the target path being obtained from the original path of the software package corresponding thereto, and And modifying the original path of the software package in the target warehouse index file into the target path to obtain an updated target warehouse index file, and finishing the updating of the software package.
  2. 2. The software package updating method of claim 1, wherein the step of copying the software package from the original path in the original repository to the target path in the target repository comprises: Acquiring target paths of all software packages in the target warehouse index file and And copying the software package corresponding to the target path from the original path in the original warehouse to the target path in the target warehouse under the condition that the target path does not store a file.
  3. 3. A software package updating method according to claim 1 or 2, wherein the target path is obtained by concatenating the original path of the software package corresponding thereto and the hash value.
  4. 4. A software package updating method according to claim 1 or 2 and using a hard link to copy said software package from an original path in said original repository to a target path in said target repository.
  5. 5. A software package updating apparatus adapted for use at a server, the apparatus comprising: The initialization unit is suitable for responding to the fact that the software package is updated in the original warehouse, and generating a target warehouse index file, wherein the content recorded by the target warehouse index file is the same as the content recorded by the original warehouse index file in the original warehouse; A file copying unit adapted to copy the software package from an original path in the original repository to a target path in a target repository, wherein the file copying unit comprises a positioning subunit adapted to position the software package to obtain its original path and a second copying subunit adapted to copy the software package from the original path in the original repository to the target path in the target repository, the target path being obtained from the original path of the software package corresponding thereto, and And the path modification unit is suitable for modifying the original path of the software package in the target warehouse index file into the target path to obtain an updated target warehouse index file and complete the update of the software package.
  6. 6. The software package updating apparatus of claim 5, wherein the file copying unit further comprises: a path acquisition subunit adapted to acquire the target path of each software package in the target repository index file, and A first replication subunit adapted to replicate, in a case where the target path does not store a file, a software package corresponding to the target path from an original path in the original repository to a target path in the target repository.
  7. 7. A computing device, comprising: At least one processor and a memory storing program instructions; the program instructions, when read and executed by the processor, cause the computing device to perform the software package update method of any of claims 1-4.
  8. 8. A readable storage medium storing program instructions which, when read and executed by a computing device, cause the computing device to perform the software package updating method of any of claims 1-4.

Description

Software package updating method and device and computing equipment The application is a divisional application of patent application 2022103402843 filed on 02/04/2022. Technical Field The invention relates to the technical field of software warehouse updating, in particular to a software package updating method, a software package updating device and computing equipment. Background With the increasing sophistication of Linux desktop ecology, the demands and requirements of users on software are gradually increased, so that the update frequency of the software is increased, and the update frequency is also a test on a software warehouse for storing and retrieving the software. The Debian repository is a common software repository suitable for Linux systems and is managed using reprepro tools. In the server debian repository, each version of each software includes three parts including repository information release, repository index file packages, and software package deb. Wherein release records the memory addresses of packages for different processor architectures, and packages records the memory addresses of the respective debs. Taking a version of a piece of software in the debian repository shown in fig. 1 as an example, release records the storage address of packages of the amd64 architecture and the storage address of packages of the i386 architecture, packages of the amd64 architecture records the storage address of deb of the amd64 architecture, and packages of the i386 architecture records the storage address of deb of the i386 architecture. As shown in fig. 2, the server imports deb (i.e., debv1) of a certain software v1 version, then records packages storage addresses in release, and records packages storage addresses of deb. When the client downloads and installs the software, firstly, the client downloads release from the server and caches the release to the local, then the client queries packages the storage address from the release, downloads packages from the server according to the address and caches the release to the local, and when the software is installed, the client queries the deb storage address from the local cache packages, and then downloads deb from the server according to the address and installs the deb. When the v2 version of the software appears, the software warehouse needs to be updated, and the update flow is that the deb_v2 is firstly imported into the software warehouse of the server, and since reprepro tools only allow deb with the same package name to exist for one part, reprepro tools delete deb_v1 when the deb_v2 is imported, release and packages are updated, and packages after update records the storage address of deb_v2. After the software repository update is completed, if the client locally cached packages was downloaded packages before the software repository update, i.e., the packages record the storage address of deb_v1, then the client would not be able to download to the deb file while running the packages because deb_v1 was deleted. To solve the problem of the deb download address failing, debian repository format specifications indicate that adding an Acquire-By-Hash option to the release file may direct the client to preferentially Acquire packages according to the Hash value, e.g., acquire failure and Acquire from the default path. When the warehouse management tool supports this approach, packages will also be placed into the hash path. For example, the default path for Packages files is dists/eagle/main/binary-amd64/Packages, and Packages files are copied into the Hash path using the Acquire-By-Hash option dists/eagle/main/binary-amd64/By-Hash/MD5Sum/4d4bd928d09a48c193ac6ec54ad4ccbe. The process of obtaining packages files is shown in fig. 3, after the client obtains the release file, it is determined whether the Acquire-By-Hash is enabled, if the Acquire-By-Hash is not enabled, the packages file is downloaded and cached from the default path, if the Acquire-By-Hash is enabled, the packages file is downloaded and cached packages file from the Hash value path recorded By the release file, and if the download packages file from the Hash value path fails, the packages file is downloaded and cached from the default path. After the Acquire-By-Hash parameter is used, packages is stored under the catalog of the self Hash value, and packages files are not covered when the warehouse is updated, so that unmatched downloaded release and packages can be avoided. However, this method only works for packages files, the old version of deb is deleted, the client cannot download deb when packages expires, and the release file and packages file are downloaded at the same time at the client in general, so this method does not work much. In summary, the above-mentioned existing software repository update techniques cannot solve the problem that the client repository index file is not updated, and thus the software package cannot be downloaded. Disclosure of Invention To