MantisBT

View Issue Details Jump to Notes ] Wiki ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008662mantisbtbugtrackerpublic2007-12-10 04:152008-01-19 04:24
Reportergiallu 
Assigned Togiallu 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version1.1.1 
Summary0008662: Unneeded executable bits on mantis modules
DescriptionFrom 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? file icon mantispkg.sh [^] (2,707 bytes) 2008-01-11 12:36

- Relationships

-  Notes
User avatar (0016446)
vboctor (administrator)
2007-12-15 20:34

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
User avatar (0016636)
giallu (developer)
2008-01-11 10:14

I would add to that:

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

6. spit out MD5 sums of the final packages
User avatar (0016637)
vboctor (administrator)
2008-01-11 10:48

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.
User avatar (0016639)
thansen (reporter)
2008-01-11 12:36

Here's a quick script to do just about everything you asked for.
User avatar (0016640)
jreese (reporter)
2008-01-11 13:09

@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?
User avatar (0016642)
giallu (developer)
2008-01-11 18:37

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.
User avatar (0016643)
thansen (reporter)
2008-01-11 18:50

@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.
User avatar (0016651)
giallu (developer)
2008-01-12 19:23

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
Timestamp: 2008-01-12 00:04:29
Author: 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 [^] /?p=mantisbt.git;a=object;h=f5dc347c-c33d-0410-90a0-b07cc1902cb9

- 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: mantispkg.sh
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 =>


MantisBT 1.2.17 [^]
Copyright © 2000 - 2014 MantisBT Team
Time: 0.0949 seconds.
memory usage: 3,056 KB
Powered by Mantis Bugtracker