Hi,

This is my first patch to aur-dev, hope I'm doing it right. :)

I just set up aur locally and made some minor changes to the README file.

Attaching patch.

-- 
Cordially,
 Alexander Rødseth
 Arch Linux Trusted User
 (xyproto on IRC, trontonic on AUR)
diff --git a/web/README b/web/README
index 37a224e..266f39e 100644
--- a/web/README
+++ b/web/README
@@ -1,7 +1,7 @@
 Setup on Arch Linux:
 ====================
-1) Install Apache, MySQL, PHP, and git
-  # pacman -Syu apache mysql php git
+1) Install Apache, MySQL, PHP, git and php-pear
+  # pacman -Syu apache mysql php git php-pear
 
 2) Set a local 'hostname' of 'aur'
  - Edit /etc/hosts and append 'aur' to loopback address
@@ -16,11 +16,13 @@ Setup on Arch Linux:
    Include conf/extra/php5_module.conf
 
  - Also append the following snippet to enable the aur
-   Virtual Host (Replace MYUSER with your username).
+   Virtual Host in /etc/httpd/conf/extra/httpd-vhosts.conf.
+	 Comment out the example vhosts and replace MYUSER with your username.
+	 (You could put aur in /srv/http/aur and then create a symlink in ~ )
 
    <VirtualHost aur:80>
    Servername    aur
-   DocumentRoot    /home/MYUSER/aur/web/html
+   DocumentRoot  /home/MYUSER/aur/web/html
    ErrorLog    /var/log/httpd/aur-error.log
    CustomLog   /var/log/httpd/aur-access.log combined
      <Directory /home/MYUSER/aur/web/html>
@@ -31,6 +33,10 @@ Setup on Arch Linux:
      </Directory>
    </VirtualHost>
 
+ - In httpd.conf, uncomment this line:
+
+   Include conf/extra/httpd-vhosts.conf
+
 4) Clone the AUR project (using the MYUSER from above)
    $ cd
    $ git clone git://projects.archlinux.org/aur.git
@@ -56,21 +62,17 @@ Setup on Arch Linux:
  - Install the Archive_Tar PEAR package:
    # pear install Archive_Tar
 
- - Put PEAR in your php include_path in php.ini:
-
-   include_path = ".:/usr/share/pear"
-
-   PEAR's path may vary depending on your set up.
-
 6) Configure MySQL
  - Start the MySQL service. Example:
    # /etc/rc.d/mysqld start
 
+ - Create database
+   # mysqladmin -p create AUR
+
  - Connect to the mysql client
-   # mysql -uroot
+   # mysql -uroot -p AUR
 
  - Issue the following commands to the mysql client
-   mysql> CREATE DATABASE AUR;
    mysql> GRANT ALL PRIVILEGES ON AUR.* to aur@localhost
         > identified by 'aur';
    mysql> FLUSH PRIVILEGES;
diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php
index 3e89fa3..b8779c8 100644
--- a/web/lib/pkgfuncs.inc.php
+++ b/web/lib/pkgfuncs.inc.php
@@ -92,6 +92,24 @@ function pkgCategories($dbh=NULL) {
 	return $cats;
 }
 
+# grab the current list of PackageLicenses
+#
+function pkgLicenses($dbh=NULL) {
+	$cats = array();
+	if(!$dbh) {
+		$dbh = db_connect();
+	}
+	$q = "SELECT * FROM PackageLicenses WHERE ID != 1 ";
+	$q.= "ORDER BY Category ASC";
+	$result = db_query($q, $dbh);
+	if ($result) {
+		while ($row = mysql_fetch_row($result)) {
+			$cats[$row[0]] = $row[1];
+		}
+	}
+	return $cats;
+}
+
 # check to see if the package name exists
 #
 function pkgid_from_name($name="", $dbh=NULL) {
diff --git a/web/template/pkg_search_form.php b/web/template/pkg_search_form.php
index 53d34fe..8d5d159 100644
--- a/web/template/pkg_search_form.php
+++ b/web/template/pkg_search_form.php
@@ -119,6 +119,23 @@
 							?>
 						</select>
 					</li>
+					<li>
+						<label><?php print __("License"); ?></label>
+						<select name='license'>
+							<option value='0'><?php print __("Any"); ?></option>
+							<?php
+							foreach (pkgLicenses() as $id => $cat):
+								if (isset($_REQUEST['license']) && $_REQUEST['license'] == $id):
+							?>
+							<option value="<?php print $id ?>" selected="selected"><?php print $cat; ?></option>
+							<?php else: ?>
+							<option value="<?php print $id ?>"><?php print $cat; ?></option>
+							<?php
+								endif;
+							endforeach;
+							?>
+						</select>
+					</li>
 				</ul>
 			</div>
 			<?php endif; ?>

Reply via email to