diff options
author | P. J. McDermott <pjm@nac.net> | 2012-01-27 23:34:54 (EST) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2012-01-27 23:34:54 (EST) |
commit | df86f19aa14170892d02f5532e827d146dd651ec (patch) | |
tree | 174fe60fbc53fb1444f30267c7f18b624bbc2a79 /src/oh-gencontrol | |
parent | 0d1eab86a1284385d2119f1080509be2c28d8d60 (diff) |
Handle links to or set mode on maintainer scripts.
Diffstat (limited to 'src/oh-gencontrol')
-rw-r--r-- | src/oh-gencontrol | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/oh-gencontrol b/src/oh-gencontrol index 67bd280..6761e7d 100644 --- a/src/oh-gencontrol +++ b/src/oh-gencontrol @@ -124,10 +124,13 @@ gen_control_bin() # Maintainer scripts. for script in preinst postinst prerm postrm; do - if [ -f ../${binpkg}.pkg/${script} ]; then + if [ -L ../${binpkg}.pkg/${script} ]; then + target=$(ls -l "../${binpkg}.pkg/${script}" | \ + sed 's/^.* -> \(.*\)$/\1/') + ln -s ${target} ${control_dir}/${script} + elif [ -f ../${binpkg}.pkg/${script} ]; then cp ../${binpkg}.pkg/${script} ${control_dir} - # TODO: Set mode? - # TODO: Handle links? + chmod 755 ${control_dir}/${script} fi done |