Re: [aur-dev] AUR Android app
Hi, I'm happy to hear that you wish to contribute to Arch Linux. If you should be interested, there is an Android application for Arch Linux maintainers that could need a few improvements (notifications when packages are out of date, for instance). It could also be expanded to support AUR somehow. It's not a world-class Android application, but if you find it interesting, it may be a starting point. https://github.com/xyproto/archfriend Patches are welcome. :) -- Best regards, Alexander Rødseth xyproto / TU
Re: [aur-dev] cookies + suspended account
Hi, 2013/2/27 Angel Velásquez : > For solving the problem right now -quick and dirty-, we just have to > add a validation (tsk tsk anyone who wants to sum contributions can > code this silly patch), if the user is suspended don't let him flag > the package and actually redirect him to the logout page (to kill > those cookies). Wouldn't he/she/they be able to just register more accounts and continue flagging packages this way? - Alexander
Re: [aur-dev] cookies + suspended account
Captchas can be tiresome. How about letting package maintainers "power-unflag" packages instead, so that it cannot be flagged again by the same people, until the next package+version upgrade. -- Sincerely, Alexander Rødseth xyproto / TU
Re: [aur-dev] [PATCH] Changed 'Dutch' to 'Nederlands'
nb is "Norsk Bokmål" btw, as opposed to nn which is "Norsk Nynorsk". -- Sincerely, Alexander Rødseth xyproto / TU
Re: [aur-dev] AUR 2.0.0 released
Hey, Norwegian is at 100% too. :) -- Sincerely, Alexander Rødseth xyproto / tu
Re: [aur-dev] Drop packages
Beat you to the actual removal, Ike :) Was just about to write the same e-mail. - Alexander
Re: [aur-dev] [PATCH] Remove maxlength on password fields
Sorry, meant to send that message just to Stein Magnus Jodal. :) - Alexander
Re: [aur-dev] [PATCH] Remove maxlength on password fields
Heisann, Bra catch! :) Er du i Oslo om dagen? -- Cordially, Alexander Rødseth Arch Linux Trusted User (xyproto on IRC, trontonic on AUR)
Re: [aur-dev] Added license search (fixed)
Hi, Thanks for the review and tips for the future. I will try to create an amended patch next time the situation should arise. I will also remember to include a rationale. When it comes to the rationale itself, I can add that when finding packages that could be eligible for moving to [community], the license is an important factor. Lacking a license search function, the only available tool I know of would be "aurphan". While I like aurphan, it would be nice to be able to do a similar search through the web interface. In any case, if the feature is not needed, it's understandable. Stability and resistance to introduce new code or features is also a valuable feature for a piece of software. -- Cordially, Alexander Rødseth Arch Linux Trusted User (xyproto on IRC, trontonic on AUR)
[aur-dev] [PATCH 2/2] Fetch possible lic types from the db, use foreach
--- web/lib/pkgfuncs.inc.php | 36 ++-- web/template/pkg_search_form.php | 10 +- 2 files changed, 15 insertions(+), 31 deletions(-) diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php index 9a2074e..83252d7 100644 --- a/web/lib/pkgfuncs.inc.php +++ b/web/lib/pkgfuncs.inc.php @@ -94,34 +94,18 @@ function pkgCategories($dbh=NULL) { # grab the current list of distinct licenses # -# "fromdb" is boolean and decides if the list of licenses -# should be fetched from the available licenses in the database -# or from a predefined list. Set to true or false here to make -# either one the default. Set to false if the database load is too high. -# -function package_licenses($dbh=NULL, $fromdb=true) { +function package_licenses($dbh=NULL) { $lics = array(); -if ($fromdb != false) { - if(!$dbh) { - $dbh = db_connect(); - } - $q = "SELECT DISTINCT License FROM Packages WHERE License != '' "; - $q.= "ORDER BY License ASC"; - $result = db_query($q, $dbh); - if ($result) { - while ($row = mysql_fetch_row($result)) { - $lics[] = $row[0]; - } + if(!$dbh) { + $dbh = db_connect(); + } + $q = "SELECT DISTINCT License FROM Packages WHERE License != '' "; + $q.= "ORDER BY License ASC"; + $result = db_query($q, $dbh); + if ($result) { + while ($row = mysql_fetch_row($result)) { + $lics[] = $row[0]; } -} else { - // All possible licenses from - // https://wiki.archlinux.org/index.php/PKGBUILD#license - $lics = array("AGPL", "AGPL3", "APACHE", "Apache", "Artistic2.0", - "BSD", "CCPL", "CDDL", "CPL", "custom", "EPL", "FDL", - "FDL1.2", "FDL1.3", "GPL", "GPL2", "GPL3", "LGPL", - "LGPL2.1", "LGPL3", "LPPL", "MIT", "MPL", "PHP", "PSF", - "PerlArtistic", "Python", "RUBY", "ZLIB", "ZPL"); - // sort($lics); } return $lics; } diff --git a/web/template/pkg_search_form.php b/web/template/pkg_search_form.php index 8c82859..c197fc3 100644 --- a/web/template/pkg_search_form.php +++ b/web/template/pkg_search_form.php @@ -125,18 +125,18 @@ $lic): // "Any" occupies slot 0 $lid = $id+1; + $license_description = htmlspecialchars($lic); if (isset($_REQUEST['license']) && $_REQUEST['license'] == $lid): ?> - + - + -- 1.7.7
[aur-dev] [PATCH 1/2] Added license search
Signed-off-by: Alexander Rødseth --- web/lib/pkgfuncs.inc.php | 49 ++ web/template/pkg_search_form.php | 21 2 files changed, 70 insertions(+), 0 deletions(-) diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php index 3e89fa3..9a2074e 100644 --- a/web/lib/pkgfuncs.inc.php +++ b/web/lib/pkgfuncs.inc.php @@ -92,6 +92,40 @@ function pkgCategories($dbh=NULL) { return $cats; } +# grab the current list of distinct licenses +# +# "fromdb" is boolean and decides if the list of licenses +# should be fetched from the available licenses in the database +# or from a predefined list. Set to true or false here to make +# either one the default. Set to false if the database load is too high. +# +function package_licenses($dbh=NULL, $fromdb=true) { + $lics = array(); +if ($fromdb != false) { + if(!$dbh) { + $dbh = db_connect(); + } + $q = "SELECT DISTINCT License FROM Packages WHERE License != '' "; + $q.= "ORDER BY License ASC"; + $result = db_query($q, $dbh); + if ($result) { + while ($row = mysql_fetch_row($result)) { + $lics[] = $row[0]; + } + } +} else { + // All possible licenses from + // https://wiki.archlinux.org/index.php/PKGBUILD#license + $lics = array("AGPL", "AGPL3", "APACHE", "Apache", "Artistic2.0", + "BSD", "CCPL", "CDDL", "CPL", "custom", "EPL", "FDL", + "FDL1.2", "FDL1.3", "GPL", "GPL2", "GPL3", "LGPL", + "LGPL2.1", "LGPL3", "LPPL", "MIT", "MPL", "PHP", "PSF", + "PerlArtistic", "Python", "RUBY", "ZLIB", "ZPL"); + // sort($lics); + } + return $lics; +} + # check to see if the package name exists # function pkgid_from_name($name="", $dbh=NULL) { @@ -370,6 +404,9 @@ function package_details($id=0, $SID="", $dbh=NULL) { * s - package submitter's username *do_Orphans- boolean. whether to search packages * without a maintainer + *outdated - if the package is flagged: "on" or "off" + *license - the license ID, where 0 is "Any" + * license ID may change at any time * * *These two are actually handled in packages.php. @@ -396,6 +433,8 @@ function pkg_search_page($SID="", $dbh=NULL) { $myuid = uid_from_sid($SID, $dbh); // get a list of package categories $cats = pkgCategories($dbh); //meow + // get a list of licenses + $lics = package_licenses($dbh); // :-a // sanitize paging variables // @@ -494,6 +533,16 @@ function pkg_search_page($SID="", $dbh=NULL) { $q_where .= "AND OutOfDateTS IS NULL "; } } + + if (isset($_GET['license'])) { + // List ID ($lid) starts with 0 for "Any" and then enumerates the + // licenses from 1, which explains the "-1" below + $lid = intval($_GET["license"]); + if ($lid != 0) { + // Make the query select on licenses too + $q_where .= "AND Packages.License = '".$lics[$lid-1]."' "; + } + } $order = (isset($_GET["SO"]) && $_GET["SO"] == 'd') ? 'DESC' : 'ASC'; diff --git a/web/template/pkg_search_form.php b/web/template/pkg_search_form.php index 53d34fe..8c82859 100644 --- a/web/template/pkg_search_form.php +++ b/web/template/pkg_search_form.php @@ -119,6 +119,27 @@ ?> + + + + + + + + + + + -- 1.7.7
[aur-dev] Added license search (fixed)
Hi, Thanks for the feedback. The rationale is to make it easier to find packages to adopt, or to find packages that can be moved. Best regards, Alexander Rødseth
[aur-dev] [PATCH] Added license search
Signed-off-by: Alexander Rødseth --- web/lib/pkgfuncs.inc.php | 49 ++ web/template/pkg_search_form.php | 21 2 files changed, 70 insertions(+), 0 deletions(-) diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php index 3e89fa3..9a2074e 100644 --- a/web/lib/pkgfuncs.inc.php +++ b/web/lib/pkgfuncs.inc.php @@ -92,6 +92,40 @@ function pkgCategories($dbh=NULL) { return $cats; } +# grab the current list of distinct licenses +# +# "fromdb" is boolean and decides if the list of licenses +# should be fetched from the available licenses in the database +# or from a predefined list. Set to true or false here to make +# either one the default. Set to false if the database load is too high. +# +function package_licenses($dbh=NULL, $fromdb=true) { + $lics = array(); +if ($fromdb != false) { + if(!$dbh) { + $dbh = db_connect(); + } + $q = "SELECT DISTINCT License FROM Packages WHERE License != '' "; + $q.= "ORDER BY License ASC"; + $result = db_query($q, $dbh); + if ($result) { + while ($row = mysql_fetch_row($result)) { + $lics[] = $row[0]; + } + } +} else { + // All possible licenses from + // https://wiki.archlinux.org/index.php/PKGBUILD#license + $lics = array("AGPL", "AGPL3", "APACHE", "Apache", "Artistic2.0", + "BSD", "CCPL", "CDDL", "CPL", "custom", "EPL", "FDL", + "FDL1.2", "FDL1.3", "GPL", "GPL2", "GPL3", "LGPL", + "LGPL2.1", "LGPL3", "LPPL", "MIT", "MPL", "PHP", "PSF", + "PerlArtistic", "Python", "RUBY", "ZLIB", "ZPL"); + // sort($lics); + } + return $lics; +} + # check to see if the package name exists # function pkgid_from_name($name="", $dbh=NULL) { @@ -370,6 +404,9 @@ function package_details($id=0, $SID="", $dbh=NULL) { * s - package submitter's username *do_Orphans- boolean. whether to search packages * without a maintainer + *outdated - if the package is flagged: "on" or "off" + *license - the license ID, where 0 is "Any" + * license ID may change at any time * * *These two are actually handled in packages.php. @@ -396,6 +433,8 @@ function pkg_search_page($SID="", $dbh=NULL) { $myuid = uid_from_sid($SID, $dbh); // get a list of package categories $cats = pkgCategories($dbh); //meow + // get a list of licenses + $lics = package_licenses($dbh); // :-a // sanitize paging variables // @@ -494,6 +533,16 @@ function pkg_search_page($SID="", $dbh=NULL) { $q_where .= "AND OutOfDateTS IS NULL "; } } + + if (isset($_GET['license'])) { + // List ID ($lid) starts with 0 for "Any" and then enumerates the + // licenses from 1, which explains the "-1" below + $lid = intval($_GET["license"]); + if ($lid != 0) { + // Make the query select on licenses too + $q_where .= "AND Packages.License = '".$lics[$lid-1]."' "; + } + } $order = (isset($_GET["SO"]) && $_GET["SO"] == 'd') ? 'DESC' : 'ASC'; diff --git a/web/template/pkg_search_form.php b/web/template/pkg_search_form.php index 53d34fe..8c82859 100644 --- a/web/template/pkg_search_form.php +++ b/web/template/pkg_search_form.php @@ -119,6 +119,27 @@ ?> + + + + + + + + + + + -- 1.7.7
Re: [aur-dev] README patch
2011/10/17 dave reisner : > On Oct 17, 2011 6:51 AM, "Alexander Rødseth" wrote: > Just fyi for the future we tend to prefer patches sent inline via git > send-email rather than as attachments as it makes the review process easier. I will keep that in mind. Thanks. - Alexander
Re: [aur-dev] README patch
Gah, I made a mistake by including two changes that were not related to the README file at the end of the patch. Please disregard that one. Attaching a new 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 ~ ) Servernameaur - 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 @@ -31,6 +33,10 @@ Setup on Arch Linux: + - 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;
[aur-dev] README patch
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 ~ ) Servernameaur - 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 @@ -31,6 +33,10 @@ Setup on Arch Linux: + - 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 @@ ?> + + + + + $cat): +if (isset($_REQUEST['license']) && $_REQUEST['license'] == $id): + ?> + + + + + +