View Issue Details

IDProjectCategoryView StatusLast Update
0008662mantisbtbugtrackerpublic2008-01-19 04:24
ReportergialluAssigned Togiallu 
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version 
Target VersionFixed in Version1.1.1 
Summary0008662: Unneeded executable bits on mantis modules

From a mantisbt-dev mail:


a few days ago I had problems with mantis, because some files have the
executable bit set, where they should not. That resulted in lintian (a
tool which checks Debian packages for common policy-related problems) to
issue a lot of warnings. I handle this for myself, but it should be
fixed upstream. I don't know if the problem exists in 1.1.
In 1.0.8 this is true for a lot of php files (that are not suitable for
shell execution and therefore don't need executable flags) and even for
images. Those files can be found by executing:

   find -perm -111

in the mantis source base directory. But these output just lists files
with the executable bit set. so it needs further investigation weither
the executable flag is needed or not.

Best Regards,


TagsNo tags attached.




2007-12-15 20:34

manager   ~0016446

Hi giallu, can you put a shell script together that takes a tag and a release name as command line parameters and packs a release based on it?

The script should do the following:

  1. Get the code from SVN (export mode) based on the tag provided. This should be placed under mantis-<release name>/ folder under the current directory.

  2. Adjust the permissions on the files.

  3. Deletes mantis-<release name>/packages/ folder.

  4. Compress the folder into mantis-<release name>.tar.gz



2008-01-11 10:14

reporter   ~0016636

I would add to that:

  1. Create mantis-<release name>.zip package

  2. spit out MD5 sums of the final packages



2008-01-11 10:48

manager   ~0016637

A couple of extra points:

  • When getting the code from SVN we should use unix line feeds.

  • Bonus Point: Extract the release name from the constants file, rather than getting it as a parameter.

  • The script should live in the "dev" part of SVN tree.

Lets go ahead with this functionality as a starting point. We can always improve it later.

2008-01-11 12:36 (2,707 bytes)


2008-01-11 12:36

reporter   ~0016639

Here's a quick script to do just about everything you asked for.



2008-01-11 13:09

reporter   ~0016640

@thansen - I like the script, but I have a couple suggestions, and a question:

  • When generating the MD5 checksums, I think these would be better placed in files named mantis-<>.tgz.md5, mantis-<>.zip.md5, etc, as well as being output to the screen

  • Cleanup of the tagged directory should (?) be a separate step performed by the user. Deleting the directory for him/her is too much IMO. If you leave the folder, it allows the packager to simply re-run the script without needing to re-checkout the entire SVN archive again. In this case, your script should perhaps ignore or prompt for confirmation when the release directory already exists.

  • Would this perhaps be an easier/simpler solution if it were written in a "better" scripting language like Perl/Python, both of which have SVN support built-in?



2008-01-11 18:37

reporter   ~0016642

I tested the script and we are (almost) there.

The "# Retrieve release name." did not work for me, while this fixed it:

  • if [[ -n "${release}" ]]; then
  • if [[ -z "${release}" ]]; then

In the same section, I find the awk command almost unreadable, so I replaced it wit something like:

pushd ${tag_path}
release=$(php -r 'include "core/constant_inc.php"; echo MANTIS_VERSION;')

then I added a -c option to clean up the tagged directory after packages are built (default to keep it)

Thanks a lot for your contribution.



2008-01-11 18:50

reporter   ~0016643


I used .DIGESTS because I had just used that digest function in another script so it was basically copy'n'paste. :)

Downloads and cleanups actually had limited prompting for options but I took it out before submitting because I couldn't get it intuitively right.

I don't think it is worth the time doing this in PERL or Python. You'd probably end up with a nicer script but in this case it isn't really worth the extra time one usually ends up using. imho anyway.


Good catch. :)

I used awk with a regex match because I didn't want to assume people having PHP CLI on their system. But then again, zip isn't always there either.

I'm glad it helped anyway.



2008-01-12 19:23

reporter   ~0016651

The package creation script is now in SVN, and I also took care of removing the execution bit on all files in the 1.1 branch (it seems trunk was already fixed)

Related Changesets

MantisBT: master-1.1.x 5fb20218

2008-01-12 00:04:29


Details Diff
Fix 8662: Unneeded executable bits on mantis modules

git-svn-id: <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9
Affected Issues

Issue History

Date Modified Username Field Change
2007-12-10 04:15 giallu New Issue
2007-12-15 20:34 vboctor Note Added: 0016446
2008-01-11 10:14 giallu Note Added: 0016636
2008-01-11 10:48 vboctor Note Added: 0016637
2008-01-11 12:36 thansen File Added:
2008-01-11 12:36 thansen Note Added: 0016639
2008-01-11 13:09 jreese Note Added: 0016640
2008-01-11 18:37 giallu Note Added: 0016642
2008-01-11 18:50 thansen Note Added: 0016643
2008-01-12 19:23 giallu Status new => resolved
2008-01-12 19:23 giallu Fixed in Version => 1.1.1
2008-01-12 19:23 giallu Resolution open => fixed
2008-01-12 19:23 giallu Assigned To => giallu
2008-01-12 19:23 giallu Note Added: 0016651
2008-01-19 04:24 vboctor Status resolved => closed
2008-10-20 20:20 Changeset attached master-1.1.x 667e1f1e =>
2008-11-11 09:03 giallu Changeset attached master-1.1.x 5fb20218 =>