Skip to content

DSM7: revert var overwrite - #4558

Merged
hgy59 merged 3 commits into
SynoCommunity:masterfrom
hgy59:fix_dsm7_var
Apr 14, 2021
Merged

hgy59 merged 3 commits into
SynoCommunity:masterfrom
hgy59:fix_dsm7_var

Conversation

@hgy59

@hgy59 hgy59 commented Apr 14, 2021

Copy link
Copy Markdown
Contributor

Motivation: Revert a breaking change of #4539

Checklist

  • Build rule all-supported completed successfully
  • Package upgrade completed successfully
  • New installation of package completed successfully

Remarks

Reference: comment on spksrc.service.installer.dsm7 in #4539

As linking into the merged PR is not very good, here is the comment of @publicarray

Dang I missed it, why change it? This is a regression or please let me explain how it was supposed to work.

DSM7:

${SYNOPKG_PKGDEST}/var => /var/packages/{package}/target/var
${SYNOPKG_PKGVAR} => /var/packages/{package}/var

DSM6:
${SYNOPKG_PKGDEST}/var => /var/packages/{package}/target/var
${SYNOPKG_PKGVAR} => /var/packages/{package}/target/var or undefined (need to double-check)

If ${SYNOPKG_PKGDEST}/var exists we want its contents to be coped to ${SYNOPKG_PKGVAR} unless there are already files there. (think new dsm7 installation or upgrading from dsm6 to dsm7)

And we don't want to override the on next install since there are updated database/user files in there.

So please don't publish any DSM7 packages yet.

- revert overwriting files in ${SYNOPKG_PKGVAR} folder from target/var (introduced with SynoCommunity#4539)
@hgy59

hgy59 commented Apr 14, 2021

Copy link
Copy Markdown
Contributor Author

@publicarray just wondering what the -RT is needed for in $CP -RT .

as CP=/bin/cp -rfp the -R is obsolete as equal to -r
and -T means 'treat target as file` (--no-target-directory) that looks strange for me in this context.

@publicarray

publicarray commented Apr 14, 2021 •

Copy link
Copy Markdown
Member

@hgy59 I don't remember why, and I just tried it without the flags, and it still works. So I'm happy if you remove them here and on this line too.

$CP -RT ${SYNOPKG_PKGDEST}/var/. ${SYNOPKG_PKGVAR} 2>&1 | install_log

This one is migrating from DSM6 to DSM7 including userfiles

@publicarray

publicarray commented Apr 14, 2021 •

Copy link
Copy Markdown
Member

If you do want to override files it is possible by just removing the if statement all together.

@hgy59
hgy59 merged commit 72be928 into SynoCommunity:master Apr 14, 2021
@hgy59
hgy59 deleted the fix_dsm7_var branch April 14, 2021 22:11
AlexPresso pushed a commit to AlexPresso/spksrc that referenced this pull request Jan 30, 2025
* DSM7: revert var overwrite
- revert overwriting files in ${SYNOPKG_PKGVAR} folder from target/var (introduced with SynoCommunity#4539)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants