[aur-dev] Handling deletion through the web interface.

2010-09-11 Thread Peter Lewis
Hi folks,

As I said in my TU application, I want to get involved in trying to grease the 
wheels of the AUR a little. So, I'm proposing as a first step that we allow 
(prefer? require?) deletion requests to be handled through the web interface.

The main aim of this is to try to standardise the process and information 
available in the messages (and therefore archived on aur-general) concerning 
AUR deletion requests. For example, messages like this are now somewhat 
meaningless (no offence to the author or anyone else intended):


Subject: [aur-general] Delete and orphan request
   
Hi, can somebody delete the following packages:

1) http://aur.archlinux.org/packages.php?ID=38923 - my mistake, error in
package name, replacement here
http://aur.archlinux.org/packages.php?ID=39067

2) http://aur.archlinux.org/packages.php?ID=17379 and
http://aur.archlinux.org/packages.php?ID=36306 - they duplicate this package
http://aur.archlinux.org/packages.php?ID=5790

3) http://aur.archlinux.org/packages.php?ID=28544 - this is version from
previous developer of Onscripter-en

4) http://aur.archlinux.org/packages.php?ID=8242 - already included in
community

etc. etc.




The basic idea is this:

1) Any user can click a button to propose a package for deletion. This flags 
that package as having been proposed, and triggers an email to aur-general and 
the package maintainer, containing the name of the package and a link to it.

2) TUs and others can discuss the deletion request on aur-general as before.

3) When a decision is made, a TU can then either delete the package, or else 
cancel the deletion proposal, also on the web interface.

Once a package is proposed for deletion, no-one else can also propose it 
(until / unless the request is cancelled by a TU), so aur-general doesn't get 
more than one email.

I'll forward the patches to this list for review.

This is just the first bit of this implementation (it's pretty basic). Still 
to do (IMO) is:

- Include a form for the proposer of the deletion to write a few words about 
why it should be deleted.

- Place information about a package's current "proposed for deletion" status 
in prominent places on the web interface.

- Also email everyone who has asked to be notified about the package.

Cheers,

Pete.

PS. Note that it also requires a small database schema change.


[aur-dev] [PATCH 1/3] Add database column DeletionProposed to Packages table, indicating whether or not the package is currently proposed for deletion.

2010-09-11 Thread Peter Lewis
---
 support/schema/aur-schema.sql |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/support/schema/aur-schema.sql b/support/schema/aur-schema.sql
index 250d405..8d49e15 100644
--- a/support/schema/aur-schema.sql
+++ b/support/schema/aur-schema.sql
@@ -120,6 +120,7 @@ CREATE TABLE Packages (
LocationID TINYINT UNSIGNED NOT NULL DEFAULT 1,
NumVotes INTEGER UNSIGNED NOT NULL DEFAULT 0,
OutOfDate TINYINT UNSIGNED DEFAULT 0,
+   DeletionProposed TINYINT UNSIGNED DEFAULT 0,
SubmittedTS BIGINT UNSIGNED NOT NULL,
ModifiedTS BIGINT UNSIGNED NOT NULL,
SubmitterUID INTEGER UNSIGNED NOT NULL DEFAULT 0, -- who submitted 
it?
-- 
1.7.2.3



[aur-dev] [PATCH 2/3] Add function pkg_propose_deletion to web/lib/pkgfuncs.inc, which manages whether or not a package is currently proposed for deletion and emails the maintainer and aur-general whe

2010-09-11 Thread Peter Lewis
---
 web/lib/pkgfuncs.inc |   95 ++
 1 files changed, 95 insertions(+), 0 deletions(-)

diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc
index 5605daa..386662c 100644
--- a/web/lib/pkgfuncs.inc
+++ b/web/lib/pkgfuncs.inc
@@ -678,6 +678,101 @@ function pkg_flag ($atype, $ids, $action = True) {
 }
 
 /**
+ * Propose packages for deletion and cancel proposals
+ *
+ * @param string $atype Account type, output of account_from_sid
+ * @param array $ids Array of package IDs to propose / cancel proposals for
+ * @param boolean $action True proposes deletion, false cancels proposal.
+ * Proposes by default.
+ *
+ * @return string Translated success or error messages
+ */
+function pkg_propose_deletion ($atype, $ids, $action = True) {
+   if (!$atype) {
+   if ($action) {
+   return __("You must be logged in before you can propose 
packages for deletion.");
+   } else {
+   return __("You must be logged in before you can cancel 
deletion proposals.");
+   }
+   }
+
+   if (empty($ids)) {
+   if ($action) {
+   return __("You did not select any packages to 
propose.");
+   } else {
+   return __("You did not select any packages to cancel 
proposals for.");
+   }
+   }
+
+   foreach ($ids as $pid) {
+   if (!is_numeric($pid)) {
+   if ($action) {
+   return __("You did not select any packages to 
propose.");
+   } else {
+   return __("You did not select any packages to 
cancel proposals for.");
+   }
+   }
+   }
+
+   $dbh = db_connect();
+
+   $first = 1;
+   foreach ($ids as $pid) {
+   if ($first) {
+   $first = 0;
+   $propose = $pid;
+   } else {
+   $propose .= ", " . $pid;
+   }
+   }
+
+   $ood = $action ? 1 : 0;
+   $q = "UPDATE Packages SET DeletionProposed = " . $ood;
+   $q.= " WHERE ID IN (" . $propose . ")";
+
+   db_query($q, $dbh);
+
+   if ($action) {
+   # Notify maintainer and aur-general of proposal by email
+   $f_name = username_from_sid($_COOKIE['AURSID']);
+   $f_email = email_from_sid($_COOKIE['AURSID']);
+   $f_uid = uid_from_sid($_COOKIE['AURSID']);
+   $q = "SELECT Packages.Name, Users.Email, Packages.ID ";
+   $q.= "FROM Packages, Users ";
+   $q.= "WHERE Packages.ID IN (" . $propose .") ";
+   $q.= "AND Users.ID = Packages.MaintainerUID ";
+   $q.= "AND Users.ID != " . $f_uid;
+   $result = db_query($q, $dbh);
+   if (mysql_num_rows($result)) {
+   while ($row = mysql_fetch_assoc($result)) {
+   # construct email - maintainer
+   $body = "Your package " . $row['Name'] . " has 
been proposed for deletion by " . $f_name . " [1]. You may view your package 
at:\nhttp://aur.archlinux.org/packages.php?ID="; . $row['ID'] . "\n\n[1] - 
http://aur.archlinux.org/account.php?Action=AccountInfo&ID="; . $f_uid;
+   $body = wordwrap($body, 70);
+   $headers = "Reply-to: 
nob...@archlinux.org\nfrom:aur-not...@archlinux.org\nx-mailer: PHP\nX-MimeOLE: 
Produced By AUR\n";
+   @mail($row['Email'], "AUR Package Deletion 
Proposal for ".$row['Name'], $body, $headers);
+
+   # construct email - aur-general
+   $body = "The AUR package " . $row['Name'] . " 
has been proposed for deletion by " . $f_name . " [1]. You may view the package 
at:\nhttp://aur.archlinux.org/packages.php?ID="; . $row['ID'] . "\n\n[1] - 
http://aur.archlinux.org/account.php?Action=AccountInfo&ID="; . $f_uid;
+   $body = wordwrap($body, 70);
+   $headers = "Reply-to: 
nob...@archlinux.org\nfrom:aur-not...@archlinux.org\nx-mailer: PHP\nX-MimeOLE: 
Produced By AUR\n";
+   @mail('aur-gene...@archlinux.org', "AUR Package 
Deletion Proposal for ".$row['Name'], $body, $headers);
+   
+   }
+   }
+   }
+
+   if ($action) {
+   return __("The selected packages have been proposed for 
deletion.");
+   } else {
+   return __("The deletion proposals have been cancelled for the 
selection packages.");
+   }
+}
+
+/**
  * Delete packages
  *
  * @param string $atype Account type, output of account_from_sid
-- 
1.7.2.3



[aur-dev] [PATCH 3/3] Add functionality to the web interface to enable packages to be proposed for deletion and deletion proposals to be cancelled.

2010-09-11 Thread Peter Lewis
---
 web/html/packages.php   |4 
 web/template/actions_form.php   |   12 +++-
 web/template/pkg_search_results.php |4 
 3 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/web/html/packages.php b/web/html/packages.php
index 472f6a2..48924b6 100644
--- a/web/html/packages.php
+++ b/web/html/packages.php
@@ -45,6 +45,10 @@ if ($_POST['action'] == "do_Flag" || 
isset($_POST['do_Flag'])) {
$output = pkg_vote($atype, $ids, True);
 } elseif ($_POST['action'] == "do_UnVote" || isset($_POST['do_UnVote'])) {
$output = pkg_vote($atype, $ids, False);
+} elseif ($_POST['action'] == "do_ProposeDeletion" || 
isset($_POST['do_ProposeDeletion'])) {
+   $output = pkg_propose_deletion($atype, $ids, True);
+} elseif ($_POST['action'] == "do_UnProposeDeletion" || 
isset($_POST['do_UnProposeDeletion'])) {
+   $output = pkg_propose_deletion($atype, $ids, False);
 } elseif ($_POST['action'] == "do_Delete" || isset($_POST['do_Delete'])) {
if (isset($_POST['confirm_Delete'])) {
$output = pkg_delete($atype, $ids);
diff --git a/web/template/actions_form.php b/web/template/actions_form.php
index d1559f5..006f9ef 100644
--- a/web/template/actions_form.php
+++ b/web/template/actions_form.php
@@ -43,7 +43,17 @@ if ($row["MaintainerUID"] == 0) {
echo "\n";
}
-   
+
+if ($row["DeletionProposed"] == 0) {
+echo "\n";
+} else if ($atype == "Trusted User" || $atype == "Developer") {
+echo "\n";
+} else {
+   echo __("Deletion proposed");
+}
+
if ($atype == "Trusted User" || $atype == "Developer") {
echo "\n";
diff --git a/web/template/pkg_search_results.php 
b/web/template/pkg_search_results.php
index bb898df..f2ce5c0 100644
--- a/web/template/pkg_search_results.php
+++ b/web/template/pkg_search_results.php
@@ -107,6 +107,10 @@ for ($i = 0; $row = mysql_fetch_assoc($result); $i++) {



+   
+   
+   
+   


 
-- 
1.7.2.3



Re: [aur-dev] Handling deletion through the web interface.

2010-09-26 Thread Peter Lewis
Hi Loui,

On Monday 20 September 2010 at 02:23 Loui Chang wrote:
> Hi Peter. Thanks for sending in these patches.
> I really don't know when I'll be able to give these a fair look however.

No problem - so sorry for sending more :-)

I've actually spent today taking another look at how this can be accomplished, 
and since it seems that we should require users to give reasons for deletion 
requests, which then get forwarded to aur-general (otherwise the automated 
emails aren't too useful), I've reimplemented some of it in a slightly 
different way.

Basically I put the bulk of it in pkgedit.php rather than pkgfuncs.inc, 
imitating the way category changes happen. This means that in my 
implementation:

- Users are now required to give a reason when requesting deletion, from a 
list. Hopefully this will make people think / check.

- When a package has a pending deletion request, this is displayed on the 
package page.

- Users can leave a comment (and should in most cases), which gets forwarded 
to the list in the deletion proposal and can start any discussion.

- The maintainer and everyone on the notify list also gets an email, letting 
them know that the package is up for deletion (with the reasons) and this will 
be discussed on aur-general.

- TUs and devs can cancel deletion requests (preferably following discussion 
on the list), ordinary users can't.

- On the downside, bulk deletion proposals aren't possible, since reasons have 
to be given per package on the pkgedit.php page. Bulk cancelations are 
possible though, in case of abuse.

- It should be fairly easy to add and amend valid reasons for proposing 
deletion, since these are just extra variables in the http post, which get 
sent to the mailing list. They're not stored in the database (seemed overkill 
to me).

(Five related) patches to follow shortly (and don't bother with the previous 
ones I sent, these include that stuff).


> The AUR really needs someone to step up to keep it going now.

Well, once I'm a bit more comfortable with the code and processes and stuff, 
I'd be happy to help.

Cheers,

Pete.


PS. There's a bit of duplication of code here, but if the general idea is 
accepted, then I'll work on factoring some of it out later.


[aur-dev] [PATCH] Add database column DeletionProposed to Packages table, indicating whether or not the package is currently proposed for deletion.

2010-09-26 Thread Peter Lewis
---
 support/schema/aur-schema.sql |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/support/schema/aur-schema.sql b/support/schema/aur-schema.sql
index 250d405..8d49e15 100644
--- a/support/schema/aur-schema.sql
+++ b/support/schema/aur-schema.sql
@@ -120,6 +120,7 @@ CREATE TABLE Packages (
LocationID TINYINT UNSIGNED NOT NULL DEFAULT 1,
NumVotes INTEGER UNSIGNED NOT NULL DEFAULT 0,
OutOfDate TINYINT UNSIGNED DEFAULT 0,
+   DeletionProposed TINYINT UNSIGNED DEFAULT 0,
SubmittedTS BIGINT UNSIGNED NOT NULL,
ModifiedTS BIGINT UNSIGNED NOT NULL,
SubmitterUID INTEGER UNSIGNED NOT NULL DEFAULT 0, -- who submitted 
it?
-- 
1.7.3



[aur-dev] [PATCH] Add function pkg_propose_deletion to web/lib/pkgfuncs.inc, which manages whether or not a package is currently proposed for deletion and emails the maintainer and aur-general when a

2010-09-26 Thread Peter Lewis
---
 web/lib/pkgfuncs.inc |   95 ++
 1 files changed, 95 insertions(+), 0 deletions(-)

diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc
index 5605daa..386662c 100644
--- a/web/lib/pkgfuncs.inc
+++ b/web/lib/pkgfuncs.inc
@@ -678,6 +678,101 @@ function pkg_flag ($atype, $ids, $action = True) {
 }
 
 /**
+ * Propose packages for deletion and cancel proposals
+ *
+ * @param string $atype Account type, output of account_from_sid
+ * @param array $ids Array of package IDs to propose / cancel proposals for
+ * @param boolean $action True proposes deletion, false cancels proposal.
+ * Proposes by default.
+ *
+ * @return string Translated success or error messages
+ */
+function pkg_propose_deletion ($atype, $ids, $action = True) {
+   if (!$atype) {
+   if ($action) {
+   return __("You must be logged in before you can propose 
packages for deletion.");
+   } else {
+   return __("You must be logged in before you can cancel 
deletion proposals.");
+   }
+   }
+
+   if (empty($ids)) {
+   if ($action) {
+   return __("You did not select any packages to 
propose.");
+   } else {
+   return __("You did not select any packages to cancel 
proposals for.");
+   }
+   }
+
+   foreach ($ids as $pid) {
+   if (!is_numeric($pid)) {
+   if ($action) {
+   return __("You did not select any packages to 
propose.");
+   } else {
+   return __("You did not select any packages to 
cancel proposals for.");
+   }
+   }
+   }
+
+   $dbh = db_connect();
+
+   $first = 1;
+   foreach ($ids as $pid) {
+   if ($first) {
+   $first = 0;
+   $propose = $pid;
+   } else {
+   $propose .= ", " . $pid;
+   }
+   }
+
+   $ood = $action ? 1 : 0;
+   $q = "UPDATE Packages SET DeletionProposed = " . $ood;
+   $q.= " WHERE ID IN (" . $propose . ")";
+
+   if (!$action) {
+   echo "Undeleting";
+   }
+
+   db_query($q, $dbh);
+
+   if ($action) {
+   # Notify maintainer and aur-general of proposal by email
+   $f_name = username_from_sid($_COOKIE['AURSID']);
+   $f_email = email_from_sid($_COOKIE['AURSID']);
+   $f_uid = uid_from_sid($_COOKIE['AURSID']);
+   $q = "SELECT Packages.Name, Users.Email, Packages.ID ";
+   $q.= "FROM Packages, Users ";
+   $q.= "WHERE Packages.ID IN (" . $propose .") ";
+   $q.= "AND Users.ID = Packages.MaintainerUID ";
+   $q.= "AND Users.ID != " . $f_uid;
+   $result = db_query($q, $dbh);
+   if (mysql_num_rows($result)) {
+   while ($row = mysql_fetch_assoc($result)) {
+   # construct email - maintainer
+   $body = "Your package " . $row['Name'] . " has 
been proposed for deletion by " . $f_name . " [1]. You may view your package 
at:\nhttp://aur.archlinux.org/packages.php?ID="; . $row['ID'] . "\n\n[1] - 
http://aur.archlinux.org/account.php?Action=AccountInfo&ID="; . $f_uid;
+   $body = wordwrap($body, 70);
+   $headers = "Reply-to: 
nob...@archlinux.org\nfrom:aur-not...@archlinux.org\nx-mailer: PHP\nX-MimeOLE: 
Produced By AUR\n";
+   @mail($row['Email'], "AUR Package Deletion 
Proposal for ".$row['Name'], $body, $headers);
+
+   # construct email - aur-general
+   $body = "The AUR package " . $row['Name'] . " 
has been proposed for deletion by " . $f_name . " [1]. You may view the package 
at:\nhttp://aur.archlinux.org/packages.php?ID="; . $row['ID'] . "\n\n[1] - 
http://aur.archlinux.org/account.php?Action=AccountInfo&ID="; . $f_uid;
+   $body = wordwrap($body, 70);
+   $headers = "Reply-to: 
nob...@archlinux.org\nfrom:aur-not...@archlinux.org\nx-mailer: PHP\nX-MimeOLE: 
Produced By AUR\n";
+   @mail('aur-gene...@archlinux.org', "AUR Package 
Deletion Proposal for ".$row['Name'], $body, $headers);
+   
+   }
+   }
+   }
+
+   if ($action) {
+   return __("The selected packages have been proposed for 
deletion.");
+   } else {
+   return __("The deletion proposals have been cancelled for the 
selection packages.");
+   }
+}
+
+/**
  * Delete packages
  *
  * @param string $atype Account type, output of account_from_sid
-- 
1.7.3



[aur-dev] [PATCH] Add functionality to the web interface to enable packages to be proposed for deletion and deletion proposals to be cancelled.

2010-09-26 Thread Peter Lewis
---
 web/html/packages.php   |4 
 web/template/actions_form.php   |   12 +++-
 web/template/pkg_search_results.php |4 
 3 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/web/html/packages.php b/web/html/packages.php
index 472f6a2..48924b6 100644
--- a/web/html/packages.php
+++ b/web/html/packages.php
@@ -45,6 +45,10 @@ if ($_POST['action'] == "do_Flag" || 
isset($_POST['do_Flag'])) {
$output = pkg_vote($atype, $ids, True);
 } elseif ($_POST['action'] == "do_UnVote" || isset($_POST['do_UnVote'])) {
$output = pkg_vote($atype, $ids, False);
+} elseif ($_POST['action'] == "do_ProposeDeletion" || 
isset($_POST['do_ProposeDeletion'])) {
+   $output = pkg_propose_deletion($atype, $ids, True);
+} elseif ($_POST['action'] == "do_UnProposeDeletion" || 
isset($_POST['do_UnProposeDeletion'])) {
+   $output = pkg_propose_deletion($atype, $ids, False);
 } elseif ($_POST['action'] == "do_Delete" || isset($_POST['do_Delete'])) {
if (isset($_POST['confirm_Delete'])) {
$output = pkg_delete($atype, $ids);
diff --git a/web/template/actions_form.php b/web/template/actions_form.php
index d1559f5..006f9ef 100644
--- a/web/template/actions_form.php
+++ b/web/template/actions_form.php
@@ -43,7 +43,17 @@ if ($row["MaintainerUID"] == 0) {
echo "\n";
}
-   
+
+if ($row["DeletionProposed"] == 0) {
+echo "\n";
+} else if ($atype == "Trusted User" || $atype == "Developer") {
+echo "\n";
+} else {
+   echo __("Deletion proposed");
+}
+
if ($atype == "Trusted User" || $atype == "Developer") {
echo "\n";
diff --git a/web/template/pkg_search_results.php 
b/web/template/pkg_search_results.php
index bb898df..f2ce5c0 100644
--- a/web/template/pkg_search_results.php
+++ b/web/template/pkg_search_results.php
@@ -107,6 +107,10 @@ for ($i = 0; $row = mysql_fetch_assoc($result); $i++) {



+   
+   
+   
+   


 
-- 
1.7.3



[aur-dev] [PATCH] Move deletion proposal code from pkgfuncs.inc to pkgedit.php and add mechanism for dealing with reasons for deletion.

2010-09-26 Thread Peter Lewis
---
 web/html/pkgedit.php |  210 ++
 web/lib/pkgfuncs.inc |   42 ++
 2 files changed, 218 insertions(+), 34 deletions(-)

diff --git a/web/html/pkgedit.php b/web/html/pkgedit.php
index 0339d00..f04e816 100644
--- a/web/html/pkgedit.php
+++ b/web/html/pkgedit.php
@@ -103,6 +103,216 @@ if ($_REQUEST["change_Category"]) {
exit();
 }
 
+# Propose deletion of package
+#
+# valid reasons are:
+#   - sources no longer available [nosource],
+#   - no longer builds on current systems (and cannot reasonably be patched) 
[wontbuild],
+#   - duplicated elsewhere in the repos [dupe],
+#   - name or source control system changed (e.g. from svn to git) [namechange]
+#
+if ($_REQUEST["propose_Deletion"]) {
+
+   if ($_REQUEST["CONFIRM"] && ($_REQUEST["NOSOURCE"] || 
$_REQUEST["WONTBUILD"] || $_REQUEST["DUPE"] || $_REQUEST["NAMECHANGE"]) ) {
+   # The user confirmed and we have at least one reason - go ahead 
and do it
+   
+   $dbh = db_connect();
+
+   # Get details of the user who proposed the deletion
+   $f_name = username_from_sid($_COOKIE['AURSID']);
+   $f_email = email_from_sid($_COOKIE['AURSID']);
+   $f_uid = uid_from_sid($_COOKIE['AURSID']);
+   
+   # Get package name
+   $q = "SELECT Packages.Name ";
+   $q.= "FROM Packages ";
+   $q.= "WHERE Packages.ID = " . $_REQUEST['ID'];
+
+   $result = db_query($q, $dbh);
+
+   # If this is false, then something has gone wrong (i.e. the 
package got deleted while you were doing this)
+   if (!mysql_num_rows($result)) {
+   print __("Oops, something went wrong and the package no 
longer seems to exist!");
+   exit();
+   }
+   
+   $row = mysql_fetch_assoc($result);
+
+   # Send a message to aur-general
+   $body = "The AUR package " . $row['Name'] . " has been proposed 
for deletion by " . $f_name . " [1].\n\n";
+   $body.= "You may view the package 
at:\nhttp://aur.archlinux.org/packages.php?ID="; . $_REQUEST['ID'] . "\n\n";
+   
+   $body.= "The reason(s) given were:\n";
+   if ($_REQUEST['NOSOURCE']) {
+   $body.= "  - The sources are no longer available.\n";
+   }
+   if ($_REQUEST['WONTBUILD']) {
+   $body.= "  - The package no longer builds on current 
systems.\n";
+   }
+   if ($_REQUEST['DUPE']) {
+   $body.= "  - The package is duplicated elsewhere.\n";
+   }
+   if ($_REQUEST['NAMECHANGE']) {
+   $body.= "  - The package's name has changed, and a new 
package replaces it.\n";
+   }
+
+   $body.= "\nThe proposer added the following details:\n";
+   $body.= $_REQUEST['REASONTEXT']."\n\n";
+
+   
+   $body.= "[1] - 
http://aur.archlinux.org/account.php?Action=AccountInfo&ID="; . $f_uid;
+   
+   
+   $body = wordwrap($body, 70);
+   $headers = "Reply-to: 
nob...@archlinux.org\nfrom:aur-not...@archlinux.org\nx-mailer: PHP\nX-MimeOLE: 
Produced By AUR\n";
+
+   # TODO: add the real aur-gene...@archlinux.org address here 
when done with testing
+   @mail('aur-gene...@__remove_me__archlinux.org', "AUR Package 
Deletion Proposal for ".$row['Name'], $body, $headers);
+
+
+
+   # Notify maintainer of package by email
+   $q = "SELECT Packages.Name, Users.Email ";
+   $q.= "FROM Packages, Users ";
+   $q.= "WHERE Packages.ID = " . $_REQUEST['ID'] ." ";
+   $q.= "AND Users.ID = Packages.MaintainerUID";
+
+   $result = db_query($q, $dbh);
+
+   # If this is false, then the package has no maintainer, so 
there's no email to send
+   if (mysql_num_rows($result)) {
+   $row = mysql_fetch_assoc($result);
+
+   # construct email - maintainer
+   $body = "Your AUR package " . $row['Name'] . " has been 
proposed for deletion by " . $f_name . " [1].\n\n";
+   $body.= "You may view your package 
at:\nhttp://aur.archlinux.org/packages.php?ID="; . $_REQUEST['ID'] . "\n\n";
+   
+   $body.= "The reason(s) given were:\n";
+   if ($_REQUEST['NOSOURCE']) {
+   $body.= "  - The sources are no longer 
available.\n";
+   }
+   if ($_REQUEST['WONTBUILD']) {
+   $body.= "  - The package no longer builds on 
current systems.\n";
+   }
+ 

[aur-dev] [PATCH] Modify search and package pages to provide interface to deletion functions.

2010-09-26 Thread Peter Lewis
---
 web/template/actions_form.php   |5 +++--
 web/template/pkg_details.php|   15 +++
 web/template/pkg_search_results.php |4 +++-
 3 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/web/template/actions_form.php b/web/template/actions_form.php
index 006f9ef..41b7860 100644
--- a/web/template/actions_form.php
+++ b/web/template/actions_form.php
@@ -45,8 +45,9 @@ if ($row["MaintainerUID"] == 0) {
}
 
 if ($row["DeletionProposed"] == 0) {
-echo "\n";
+   # Disabled, since we require a reason to be given
+   #echo "\n";
 } else if ($atype == "Trusted User" || $atype == "Developer") {
 echo "\n";
diff --git a/web/template/pkg_details.php b/web/template/pkg_details.php
index 9c76ab3..6c52990 100644
--- a/web/template/pkg_details.php
+++ b/web/template/pkg_details.php
@@ -28,6 +28,15 @@ if ($atype == "Developer" or $atype == "Trusted User") {
$votes = "$votes";
 }
 
+# If the package has been proposed for deletion
+if ($row["DeletionProposed"]) {
+   $deletion_status = __("This package has been proposed for 
deletion")."";
+   $deletion_status .= __("You can view and participate in the discussion 
on the aur-general mailing list");
+} else {
+   $deletion_status = "".__("Propose deletion of this 
package")."";
+}  
+
 # In case of wanting to put a custom message
 $msg = __('unknown');
 $license = empty($row['License']) ? $msg : $row['License'];
@@ -53,6 +62,12 @@ $submitted_time = ($row["SubmittedTS"] == 0) ? "(unknown)" : 
gmdate("r", intval(


 
+   
+   
+   
+
+
+

 

diff --git a/web/template/pkg_search_results.php 
b/web/template/pkg_search_results.php
index f2ce5c0..a7810ce 100644
--- a/web/template/pkg_search_results.php
+++ b/web/template/pkg_search_results.php
@@ -107,7 +107,9 @@ for ($i = 0; $row = mysql_fetch_assoc($result); $i++) {



-   
+   



-- 
1.7.3



[aur-dev] Fwd: AUR Package Deletion Proposal for beebem

2010-09-26 Thread Peter Lewis
FYI, an example email which would be sent to aur-general and those on the 
notify list.

(links are duff, just example)

Pete.


On Sunday 26 September 2010 at 20:30 aur-not...@archlinux.org wrote:
> The AUR package beebem has been proposed for deletion by pete [1].
> 
> You may view the package at:
> http://aur.archlinux.org/packages.php?ID=901
> 
> The reason(s) given were:
>   - The package is duplicated elsewhere.
>   - The package's name has changed, and a new package replaces it.
> 
> The proposer added the following details:
> it already exists with -svn suffix. cvs is old skoool!
> 
> [1] - http://aur.archlinux.org/account.php?Action=AccountInfo&ID=305


Re: [aur-dev] AUR migrating to gettext and Transifex

2011-04-10 Thread Peter Lewis
On Sun, 10 Apr 2011, Lukas Fleischer wrote:
> I've just merged my gettext wip branch into master and pushed that to
> gerolde. From now on, AUR translations will be managed via Transifex
> [1]. That removes the need for sending git-formatted patches to aur-dev
> and improves collaboration. It'll hopefully also support cross-project
> work (pacman has been using Transifex for some time already).
> 
> All current translation maintainers are encouraged to sign up for an
> account and request the addition of a new language team. You can find
> our project page on [2].

Can we have a pirate translation? I quite like the idea of downloading PKGBUILDS
from the AUaaargh.

:-)

Pete.


Re: [aur-dev] AUR migrating to gettext and Transifex

2011-04-10 Thread Peter Lewis
On Sun, 10 Apr 2011, Lukas Fleischer wrote:
> On Sun, Apr 10, 2011 at 05:23:27PM +0100, Peter Lewis wrote:
> > On Sun, 10 Apr 2011, Lukas Fleischer wrote:
> > > I've just merged my gettext wip branch into master and pushed that to
> > > gerolde. From now on, AUR translations will be managed via Transifex
> > > [1]. That removes the need for sending git-formatted patches to aur-dev
> > > and improves collaboration. It'll hopefully also support cross-project
> > > work (pacman has been using Transifex for some time already).
> > > 
> > > All current translation maintainers are encouraged to sign up for an
> > > account and request the addition of a new language team. You can find
> > > our project page on [2].
> > 
> > Can we have a pirate translation? I quite like the idea of downloading 
> > PKGBUILDS
> > from the AUaaargh.
> > 
> > :-)
> 
> If you happen to spot an appropriate locale, feel free to request a
> language team addition on Transifex :)

Surely the appropriate locale for pirates would be "C".