summaryrefslogtreecommitdiffstats
path: root/src/oh-gencontrol
diff options
context:
space:
mode:
Diffstat (limited to 'src/oh-gencontrol')
-rw-r--r--src/oh-gencontrol9
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