Merge branch 'master' into logging

Conflicts:
	fdroidserver/common.py
This commit is contained in:
Daniel Martí 2014-01-30 23:58:23 +01:00
commit 430cd42f80
3 changed files with 142 additions and 125 deletions

View file

@ -5,8 +5,7 @@ execute "apt-get-update" do
command "apt-get update"
end
%w{ant ant-contrib autoconf autopoint bison cmake expect libtool libsaxonb-java libssl1.0.0 libssl-dev maven openjdk-7-jdk javacc python python-magic git-core mercurial subversion bzr git-svn make perlmagick pkg-config zip ruby rubygems librmagick-ruby yasm imagemagick gettext realpath transfig texinfo curl
librsvg2-bin xsltproc}.each do |pkg|
%w{ant ant-contrib autoconf autopoint bison cmake expect libtool libsaxonb-java libssl1.0.0 libssl-dev maven openjdk-7-jdk javacc python python-magic git-core mercurial subversion bzr git-svn make perlmagick pkg-config zip ruby rubygems librmagick-ruby yasm imagemagick gettext realpath transfig texinfo curl librsvg2-bin xsltproc vorbis-tools}.each do |pkg|
package pkg do
action :install
end

View file

@ -1212,13 +1212,17 @@ def scan_source(build_dir, root_dir, thisbuild):
def warnproblem(what, fd, fp):
logging.info('Warning: Found %s at %s' % (what, fd))
def insidedir(path, dirname):
return path.endswith('/%s' % dirname) or '/%s/' % dirname in path
# Iterate through all files in the source code
for r,d,f in os.walk(build_dir):
for curfile in f:
if '/.hg' in r or '/.git' in r or '/.svn' in r:
if any(insidedir(r, igndir) for igndir in ('.hg', '.git', '.svn')):
continue
for curfile in f:
# Path (relative) to the file
fp = os.path.join(r, curfile)
fd = fp[len(build_dir):]

View file

@ -79,26 +79,40 @@ class FDroid
}
}
// Santiy check query vars
// Sanity check and standardise all query variables...
if(!isset($query_vars['fdpage']) || !is_numeric($query_vars['fdpage']) || $query_vars['fdpage'] <= 0) {
$query_vars['fdpage'] = 1;
} else {
$query_vars['fdpage'] = strval(intval($query_vars['fdpage']));
}
if(isset($query_vars['fdstyle']) && ($query_vars['fdstyle'] != 'list' && $query_vars['fdstyle'] != 'grid')) {
$query_vars['fdstyle'] = 'list';
}
if(isset($query_vars['fdcategory'])) {
if($query_vars['fdcategory'] == 'All categories') {
unset($query_vars['fdcategory']);
} else {
$query_vars['fdcategory'] = sanitize_text_field($query_vars['fdcategory']);
}
}
if(isset($query_vars['fdfilter'])) {
$query_vars['fdfilter'] = sanitize_text_field($query_vars['fdfilter']);
} else {
if(isset($attribs['search'])) {
$query_vars['fdfilter'] = '';
}
}
if(isset($query_vars['fdid'])) {
$query_vars['fdid'] = sanitize_text_field($query_vars['fdid']);
}
$out = '';
if(isset($attribs['search']) && $query_vars['fdfilter']===null) {
$query_vars['fdfilter'] = '';
}
if($query_vars['fdcategory'] == 'All categories') {
unset($query_vars['fdcategory']);
}
if($query_vars['fdid']!==null) {
$out.=$this->get_app($query_vars);
} else {
$out.='<form name="searchform" action="" method="get">';
$out.='<p><input name="fdfilter" type="text" value="'.sanitize_text_field($query_vars['fdfilter']).'" size="30"> ';
$out.='<p><input name="fdfilter" type="text" value="'.$query_vars['fdfilter'].'" size="30"> ';
$out.='<input type="hidden" name="fdpage" value="1">';
$out.='<input type="submit" value="Search"></p>';
$out.=$this->makeformdata($query_vars);
@ -157,9 +171,6 @@ class FDroid
case "name":
$name=$el;
break;
case "added":
$added=$el;
break;
case "icon":
$icon=$el;
break;
@ -184,10 +195,10 @@ class FDroid
case "web":
$web=$el;
break;
case "antifeatures";
case "antifeatures":
$antifeatures=$el;
break;
case "requirements";
case "requirements":
$requirements=$el;
break;
case "package":
@ -200,6 +211,9 @@ class FDroid
case "vercode":
$thisapk['vercode']=$pel;
break;
case "added":
$thisapk['added']=$el;
break;
case "apkname":
$thisapk['apkname']=$pel;
break;
@ -551,7 +565,7 @@ class FDroid
$out.='</form>'."\n";
}
else {
$out.='Applications matching "'.sanitize_text_field($query_vars['fdfilter']).'"';
$out.='Applications matching "'.$query_vars['fdfilter'].'"';
}
$out.="</div>";