这是indexloc提供的服务,不要输入任何密码
Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/dpkg/another-hardlink.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- archives.c 2025-09-22 12:42:56.058534783 +0300
+++ src/src/main/archives.c 2025-09-22 12:43:12.130534772 +0300
@@ -434,7 +434,7 @@
if (linknode->flags & (FNNF_DEFERRED_RENAME | FNNF_NEW_CONFF))
varbuf_add_str(&hardlinkfn, DPKGNEWEXT);
varbuf_end_str(&hardlinkfn);
- if (link(hardlinkfn.buf, path))
+ if (symlink(hardlinkfn.buf, path))
ohshite(_("error creating hard link '%.255s'"), te->name);
Comment on lines +8 to +9
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear to me that this actually solves the error instead of just pretending it doesn't exist.

There is a TAR_FILETYPE_SYMLINK case just below this TAR_FILETYPE_HARDLINK one, and it doesn't do a lot of the extra stuff the HARDLINK case does.

case TAR_FILETYPE_HARDLINK:
  varbuf_set_str(&hardlinkfn, dpkg_fsys_get_dir());
  linknode = fsys_hash_find_node(te->linkname, FHFF_NONE);
  varbuf_add_str(&hardlinkfn,
                 namenodetouse(linknode, tc->pkg, &tc->pkg->available)->name);
  if (linknode->flags & (FNNF_DEFERRED_RENAME | FNNF_NEW_CONFF))
    varbuf_add_str(&hardlinkfn, DPKGNEWEXT);
  varbuf_end_str(&hardlinkfn);
  if (link(hardlinkfn.buf, path))
    ohshite(_("error creating hard link '%.255s'"), te->name);
  namenode->newhash = linknode->newhash;
  debug(dbg_eachfiledetail, "tarobject hardlink digest=%s", namenode->newhash);
  break;
case TAR_FILETYPE_SYMLINK:
  /* We've already checked for an existing directory. */
  if (symlink(te->linkname, path))
    ohshite(_("error creating symbolic link '%.255s'"), te->name);
  debug(dbg_eachfiledetail, "tarobject symlink creating");
  break;
https://salsa.debian.org/dpkg-team/dpkg/-/blob/1.22.6/src/main/archives.c?ref_type=tags#L427-445

namenode->newhash = linknode->newhash;
debug(dbg_eachfiledetail, "tarobject hardlink digest=%s", namenode->newhash);
Loading