• 10

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191


File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Solaris packaging preserve file timestamps

I have been creating Solaris packages for application deployment for some time, however recently I became aware that deployed files had the same timestamp of when the package was created. Looking through the various manpages (pkgproto, prototype, attributes, etc) I cant seem to find any option to instruct pkgproto/pkgmk to preserve file timestamps.

Anyone know how to ensure file timestamps are preserved within Solaris packages?

      • 1
    • @jiliagre I do a "svn export" of the files before they get packaged, which preserves the file mtime. I would like this to be the timestamp that gets preserved inside the package.
      • 2
    • The timestamp in the package manifest is the timestamp of the file as it was found at package creation. I just tried it again and set the mtime (and atime) of a file with 'touch -t', created a package, and verified that pkgmk picked up the correct timestamp: Jan 1 2009 abc -> 1 f none abc 0644 x x 0 0 1230786310

The timestamps of the files are specified in the pkgmap file within the package. Example:

1 f none man/man1m/sudo.1m 0444 root root 36805 40001 1329918580

The very last column is the timestamp that the file will get. When you create the package, pkgmk uses the timestamp of that file during its run. So, it does preserve the timestamp. If you are saying you want the file to have the timestamp of the time when the package was installed, you have to edit the pkgmap file and replace all timestamps with the current time:

cd <pkg directory>
T=`perl -e 'print time()'`; sed -e 's/ [0-9][0-9]*$/'$T'/' pkgmap > pkgmap.new
mv pkgmap pkgmap.old
mv pkgmap.new pkgmap
cd ..
pkgadd -d . <pkg name>
  • 1
Reply Report

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags