[pacman-dev] [PATCH] pacsysclean: Add new contrib script

Eric Bélanger snowmaniscool at gmail.com
Tue Oct 25 17:50:29 EDT 2011


On Tue, Oct 25, 2011 at 11:22 AM, Dan McGee <dpmcgee at gmail.com> wrote:
> On Thu, Aug 11, 2011 at 5:40 PM, Eric Bélanger <snowmaniscool at gmail.com> wrote:
>> On Mon, Aug 8, 2011 at 9:19 PM, Eric Bélanger <snowmaniscool at gmail.com> wrote:
>>> On Mon, Aug 8, 2011 at 6:30 PM, Dan McGee <dpmcgee at gmail.com> wrote:
>>>> On Sun, Aug 7, 2011 at 4:14 PM, Eric Bélanger <snowmaniscool at gmail.com> wrote:
>>>>> pacsysclean sort installed packages by decreasing installed size. It's
>>>>> useful for finding large unused package when doing system clean-up. This
>>>>> script is an improved version of other similar scripts posted on the
>>>>> forums. Thanks goes to Dave as I reused the size_to_human function from his
>>>>> paccache script.
>>>>>
>>>>> Signed-off-by: Eric Bélanger <snowmaniscool at gmail.com>
>>>>>
>>>>> ---
>>>>>
>>>>> If you can think of a better name, feel free to suggest one.
>>>>> ---
>>>>>  contrib/.gitignore     |    1 +
>>>>>  contrib/Makefile.am    |    5 ++-
>>>>>  contrib/pacsysclean.in |   87 ++++++++++++++++++++++++++++++++++++++++++++++++
>>>>>  3 files changed, 92 insertions(+), 1 deletions(-)
>>>>>  create mode 100755 contrib/pacsysclean.in
>>>>>
>>>>> diff --git a/contrib/.gitignore b/contrib/.gitignore
>>>>> index 1bd145f..19b81e0 100644
>>>>> --- a/contrib/.gitignore
>>>>> +++ b/contrib/.gitignore
>>>>> @@ -6,5 +6,6 @@ paclist
>>>>>  paclog-pkglist
>>>>>  pacscripts
>>>>>  pacsearch
>>>>> +pacsysclean
>>>>>  wget-xdelta.sh
>>>>>  zsh_completion
>>>>> diff --git a/contrib/Makefile.am b/contrib/Makefile.am
>>>>> index 10b03a2..754096d 100644
>>>>> --- a/contrib/Makefile.am
>>>>> +++ b/contrib/Makefile.am
>>>>> @@ -5,7 +5,8 @@ OURSCRIPTS = \
>>>>>        paclist \
>>>>>        paclog-pkglist \
>>>>>        pacscripts \
>>>>> -       pacsearch
>>>>> +       pacsearch \
>>>>> +       pacsysclean
>>>>>
>>>>>  OURFILES = \
>>>>>        bash_completion \
>>>>> @@ -21,6 +22,7 @@ EXTRA_DIST = \
>>>>>        paclist.in \
>>>>>        pacscripts.in \
>>>>>        pacsearch.in \
>>>>> +       pacsysclean.in \
>>>>>        vimprojects \
>>>>>        zsh_completion.in \
>>>>>        README
>>>>> @@ -59,6 +61,7 @@ paclist: $(srcdir)/paclist.in
>>>>>  paclog-pkglist: $(srcdir)/paclog-pkglist.in
>>>>>  pacscripts: $(srcdir)/pacscripts.in
>>>>>  pacsearch: $(srcdir)/pacsearch.in
>>>>> +pacsysclean: $(srcdir)/pacsysclean.in
>>>>>  pactree: $(srcdir)/pactree.in
>>>>>  zsh_completion: $(srcdir)/zsh_completion.in
>>>>>
>>>>> diff --git a/contrib/pacsysclean.in b/contrib/pacsysclean.in
>>>>> new file mode 100755
>>>>> index 0000000..e393e24
>>>>> --- /dev/null
>>>>> +++ b/contrib/pacsysclean.in
>>>>> @@ -0,0 +1,87 @@
>>>>> +#!/bin/bash
>>>>> +
>>>>> +# pacsysclean - Sort installed packages by decreasing installed size. Useful for system clean-up.
>>>>> +#
>>>>> +# Copyright (C) 2011 Eric Bélanger <eric at archlinux.org>
>>>>> +#
>>>>> +# This program is free software; you can redistribute it and/or
>>>>> +# modify it under the terms of the GNU General Public License
>>>>> +# as published by the Free Software Foundation; either version 2
>>>>> +# of the License, or (at your option) any later version.
>>>>> +#
>>>>> +# This program is distributed in the hope that it will be useful,
>>>>> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
>>>>> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>>>>> +# GNU General Public License for more details.
>>>>> +#
>>>>> +# You should have received a copy of the GNU General Public License
>>>>> +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
>>>>> +
>>>> cut from here
>>>>> +export TEXTDOMAIN='pacman'
>>>>> +export TEXTDOMAINDIR='/usr/share/locale'
>>>>> +
>>>>> +# determine whether we have gettext; make it a no-op if we do not
>>>>> +if ! type gettext &>/dev/null; then
>>>>> +       gettext() {
>>>>> +               echo "$@"
>>>>> +       }
>>>>> +fi
>>>> to here. You aren't using gettext() and we don't support it in contrib anyway.
>>>
>>> OK. I saw other scripts with this at their beginning so i thought it
>>> was standard stuff.
>>
>> I've append a new version of the script with the suggested changes at
>> the end of this email. I'll resent a git patch once it's finalized.
>> I'll comment inline how I treated the many issues.
> Did we ever get a resubmit from this? Don't want to see it get dropped.

No. I was waiting for feedback for the new version that I appended at
the end of my last email. Allan was supposed to give it a look but I
guess he was too busy with the pacman 4 release like everyone else. If
that version is OK, let me know and I'll resubmit an updated git
patch.


More information about the pacman-dev mailing list