Opened 3 months ago

Closed 3 months ago

#1424 closed enhancement (fixed)

drivedb.h: Add VERSION information which works without $Id$ expansion

Reported by: Paul Wise Owned by: Christian Franke
Priority: major Milestone: Release 7.3
Component: drivedb Version:
Keywords: Cc: onlyjob

Description

In Debian smartmontools#976696, to avoid the monthly debsums cron job complaining that the files in the Debian smartmontools package had been modified after update-smart-drivedb got run, I requested that the Debian maintainer install the drivedb.h from the smartmontools tarball into /usr and then in the postinstall script run at package install time, copy it to the canonical location in /var. The package maintainer implemented that with unconditional copying of the file, with a TODO item to improve that.

I noticed that the update-smart-drivedb script also does unconditional copying.

The unconditional copying in both the Debian postinstall script and in update-smart-drivedb means that they will both clobber each other's changes.

So there needs to be some more sophisticated mechanism to figure out whether or not to update the drivedb.h file.

Possibly the branch name plus the revision number or date from the $Id$ expansion could be useful for checking if the drivedb.h file should be updated, however...

I noticed that some of the URLs used by the update-smart-drivedb script do not have $Id$ expansion and the drivedb.h on my system downloaded by update-smart-drivedb does not have $Id$ expansion. Also the drivedb.h file within the Debian package does have $Id$ expansion.

So if the URLs with missing $Id$ expansion could be fixed or removed, then the branch name plus the revision number or date from the $Id$ expansion could potentially be removed for a version.

Alternatively, a manually committed revision number could be added to the file.

In addition, I think it would be nice if the Debian package maintainer did not have to re-implement the proposed version checks in the Debian postinstall script, so I suggest that a --local option for update-smart-drivedb could be used to make it look at a local directory for drivedb.h, check the versions and then update the canonical drivedb.h. Then the Debian postinstall script could just run that.

I have CCed onlyjob, the Debian package maintainer.

Change History (4)

comment:1 in reply to:  description Changed 3 months ago by Christian Franke

Keywords: Debian drivedb.h update-smart-drivedb $Id$ removed
Milestone: Release 7.3

I noticed that the update-smart-drivedb script also does unconditional copying.

Of course, as it always installs the most recent version from the configured branch.

Possibly the branch name plus the revision number or date from the $Id$ expansion could be useful for checking if the drivedb.h file should be updated, however...

Makes plenty of sense. I would suggest (sample values from commits r5161 and r5162):
old on all branches: "$Id(: drivedb.h 5162...)?$".
new on branch 7.2: "VERSION: 7.2/5161 2021-01-06 18:24:50 $Id(: drivedb.h 5162...)?$".
new on branch 7.0: "VERSION: 7.0/5161 2021-01-06 18:24:50 $Id(: drivedb.h 5162...)?$".
...

The version number and timestamp could be automatically derived from SVN trunk drivedb.h $Id$ string as part of the local merge steps.

So if the URLs with missing $Id$ expansion could be fixed or removed, then the branch name plus the revision number or date from the $Id$ expansion could potentially be removed for a version.

Sorry no, the URL of the upstream repository should be the default. Relying on keyword expansion from SF or Trac source browser is also not a good idea because this behavior may change without notice. The only reliable way for $Id$ expansion is -t svn but this would require a locally installed subversion package with configured proxy.

Alternatively, a manually committed revision number could be added to the file.

Not needed as long as we use SVN, see above.

In addition, I think it would be nice if the Debian package maintainer did not have to re-implement the proposed version checks in the Debian postinstall script, so I suggest that a --local option for update-smart-drivedb could be used to make it look at a local directory for drivedb.h, check the versions and then update the canonical drivedb.h. Then the Debian postinstall script could just run that.

Please create a new ticket for this related enhancement and propose command line syntax and script behavior.

comment:2 Changed 3 months ago by Paul Wise

Filed the second ticket as #1426.

comment:3 Changed 3 months ago by Christian Franke

Owner: set to Christian Franke
Status: newaccepted
Summary: drivedb.h: Debian postinstall, version checks, missing $Id$ expansion in URLsdrivedb.h: Add VERSION information which works without $Id$ expansion

comment:4 Changed 3 months ago by Christian Franke

Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.