View Issue Details

IDProjectCategoryView StatusLast Update
0008662mantisbtbugtrackerpublic2008-01-19 04:24
Reportergiallu Assigned Togiallu  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Fixed in Version1.1.1 
Summary0008662: Unneeded executable bits on mantis modules
Description

From a mantisbt-dev mail:

Hi,

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,

Patrick

TagsNo tags attached.
Attached Files
mantispkg.sh (2,707 bytes)

Activities

vboctor

vboctor

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

giallu

giallu

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

vboctor

vboctor

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.

thansen

thansen

2008-01-11 12:36

reporter   ~0016639

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

jreese

jreese

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?

giallu

giallu

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;')
popd

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.

thansen

thansen

2008-01-11 18:50

reporter   ~0016643

@jreese

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.

@giallu

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.

giallu

giallu

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-11 19:04

giallu


Details Diff
Fix 8662: Unneeded executable bits on mantis modules

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/branches/BRANCH_1_1_0@4876 <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9
Affected Issues
0008662