Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Unsupported Software
  • Search

Re: Yet Another Cleaner - v3 (yacleaner-0.3) UPDATED AGAIN!

This forum covers all Gentoo-related software not officially supported by Gentoo. Ebuilds/software posted here might harm the health and stability of your system(s), and are not supported by Gentoo developers. Bugs/errors caused by ebuilds from overlays.gentoo.org are covered by this forum, too.
Post Reply
Advanced search
132 posts
  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • Next
Author
Message
Pseud
Apprentice
Apprentice
Posts: 273
Joined: Fri Mar 19, 2004 9:58 pm
Location: Bangalore, India

  • Quote

Post by Pseud » Sat Jul 09, 2005 4:27 am

Just a small issue you might want to fix up:
When run as a non-root user, since /var/log/portage is denied access, the following doesn't work right:

Code: Select all

# ./yacleaner -p log
[...]

* /var/log/portage is already clean.
Great script otherwise, thanks!
eschew obfuscation
Top
tacvbo
n00b
n00b
User avatar
Posts: 39
Joined: Wed May 28, 2003 5:36 pm
Location: México City
Contact:
Contact tacvbo
Website

  • Quote

Post by tacvbo » Sat Jul 09, 2005 5:55 am

Pseud wrote:Just a small issue you might want to fix up:
When run as a non-root user, since /var/log/portage is denied access, the following doesn't work right:
Could you post the output of a:

Code: Select all

ls -lda /var/log/portage
You are in the portage group?
Pseud wrote:Great script otherwise, thanks!
Thanks for using it :-)
Top
Pseud
Apprentice
Apprentice
Posts: 273
Joined: Fri Mar 19, 2004 9:58 pm
Location: Bangalore, India

  • Quote

Post by Pseud » Sat Jul 09, 2005 6:49 am

Ahh! you're right ... its my permissions that are probably wrong:

Code: Select all

$ ls -lda /var/log/portage/
drwxrws---  2 root root 30080 Jul  9 12:56 /var/log/portage/
I wonder where else on my system I (wrongly) have gid=root instead of gid=portage...
Is there a way I can find this out?
eschew obfuscation
Top
tacvbo
n00b
n00b
User avatar
Posts: 39
Joined: Wed May 28, 2003 5:36 pm
Location: México City
Contact:
Contact tacvbo
Website

  • Quote

Post by tacvbo » Sat Jul 09, 2005 7:02 am

Pseud wrote:Ahh! you're right ... its my permissions that are probably wrong:

Code: Select all

$ ls -lda /var/log/portage/
drwxrws---  2 root root 30080 Jul  9 12:56 /var/log/portage/
I wonder where else on my system I (wrongly) have gid=root instead of gid=portage...
Is there a way I can find this out?
Re-download yacleaner-3.0 its fixed now, it shows this msg:

Code: Select all

* You don't have permission to access /var/log/portage.
  Perhaps you are not in 'portage' group?.
Hmm.. maybe you just should have root:portage perms on: /usr/portage/distfiles and /var/log/portage.
Top
radfoj
Guru
Guru
User avatar
Posts: 490
Joined: Fri Dec 31, 2004 12:02 pm
Location: Tísek, Czech Republic
Contact:
Contact radfoj
Website

Re: Version 0.3 "Release early and often" is out!

  • Quote

Post by radfoj » Sat Jul 09, 2005 6:41 pm

tacvbo wrote: * Now just remove old logs and worktmp files rather than clean all the log and tmp dir.
Hi, what do you mean with "remove old worktmp"? I am playing with worktmp module and

Code: Select all

yacleaner-0.3.1 --ask --verbose worktmp
........
  [ total ]              +179 M
About 99 % from /var/tmp/portage was deleted and only 7 directories remain (dirs from interupted or unfinished emerge).

BTW: are my questions posted here redundant, crazy, stupid ... ? :oops:
Top
tacvbo
n00b
n00b
User avatar
Posts: 39
Joined: Wed May 28, 2003 5:36 pm
Location: México City
Contact:
Contact tacvbo
Website

Re: Version 0.3 "Release early and often" is out!

  • Quote

Post by tacvbo » Sat Jul 09, 2005 8:49 pm

radfoj wrote:Hi, what do you mean with "remove old worktmp"?
About 99 % from /var/tmp/portage was deleted and only 7 directories remain (dirs from interupted or unfinished emerge).
+179 M are a good amount of new free space :P

It should delete all dirs inside ${PORTAGE_TMPDIR}/portage which doesn't have a corresponding package installed.

For example:

I have installed rpc-0.98 and xfce4-windowlist-0.1.0-r1.

Code: Select all

$ ls /var/tmp/portage
rpc-0.97  rpc-0.98  xfce4-windowlist-0.1.0-r1  xfce4-windowlist-0.1.0-r4
Then, rpc-0.97 and xfce4-windowlist-0.1.0-r4 will be erased.

In fact all `modules` for yacleaner work in that way (dist, binpkg, log, worktmp). :-)
Top
radfoj
Guru
Guru
User avatar
Posts: 490
Joined: Fri Dec 31, 2004 12:02 pm
Location: Tísek, Czech Republic
Contact:
Contact radfoj
Website

Re: Version 0.3 "Release early and often" is out!

  • Quote

Post by radfoj » Sat Jul 09, 2005 10:05 pm

tacvbo wrote: It should delete all dirs inside ${PORTAGE_TMPDIR}/portage which doesn't have a corresponding package installed.
Thanks for reply. I was worrying about fact, why after I run it, only 7 dirs remained, although I have +-500 packages on system. I am stupid boy, I tried to reemerge one package right now to see what happens in /var/tmp/portage. After succesully merge, everything related to this emerge was deleted by portage itself.

Sorry, I missed how portage behaves these days :oops: Really stupid question from me. :oops:
Top
tacvbo
n00b
n00b
User avatar
Posts: 39
Joined: Wed May 28, 2003 5:36 pm
Location: México City
Contact:
Contact tacvbo
Website

Re: Version 0.3 "Release early and often" is out!

  • Quote

Post by tacvbo » Sun Jul 10, 2005 12:02 am

radfoj wrote: I tried to reemerge one package right now to see what happens in /var/tmp/portage. After succesully merge, everything related to this emerge was deleted by portage itself.
That is the correct Portage behaviour if you don't have set FEATURES="keeptemp", So the worktmp cleaning process of yacleaner is just for users who have that portage's feature enabled. Anyway it seems that there is a little portage bug because dyn_clean() function (where ${T} are cleaned) it's being ran at the wrong time when {up,down}grading, so sometimes you have "orphaned" files inside ${PORTAGE_TMPDIR}/portage even if you dont have FEATURES="keeptemp" set.
Top
Turd Furguson
n00b
n00b
Posts: 49
Joined: Thu Jun 16, 2005 6:34 pm

  • Quote

Post by Turd Furguson » Sun Jul 10, 2005 5:43 am

I am very new to Linux so I do not know how to execute this program. I have it saved as a text file currently but have no clue what to do. :?
Top
whitesouls
Guru
Guru
User avatar
Posts: 358
Joined: Fri Nov 19, 2004 9:02 am
Location: In Front of My Laptop

  • Quote

Post by whitesouls » Sun Jul 10, 2005 11:30 am

:D ...I ran this programme and i got this:

Code: Select all

VaderX Cruft # ./yacleaner.sh --verbose --ask all

These are the old files that I would delete:
[quote]
  [ worktmp ]   Archive-Zip-1.14  72K
  [ worktmp ]   Compress-Zlib-1.33  72K
  [ log ]       3493-spamassassin-3.0.4.log  28K
  [ log ]       3494-spamassassin-3.0.4.log  4.0K
  [ log ]       3614-spamassassin-3.0.4.log  0
  [ log ]       2419-sysfsutils-0.4.0.log  40K
  [ log ]       2420-sysfsutils-0.4.0.log  0K[/quote]


[b]EDIT:[/b] Sorry for making this post very long. :D
Last edited by whitesouls on Mon Aug 01, 2005 11:12 am, edited 1 time in total.
whitesouls

Please insert the [SOLVED] tag if your problem is solved in your respective thread.
Top
StringCheesian
l33t
l33t
Posts: 887
Joined: Tue Oct 21, 2003 6:21 am

  • Quote

Post by StringCheesian » Sun Jul 10, 2005 4:01 pm

Turd Furguson wrote:I am very new to Linux so I do not know how to execute this program. I have it saved as a text file currently but have no clue what to do. :?
Most scripts like this have no graphical interface, which means nothing will happen if you just double-click it. You have to run them from a console (translated to Windows-ian: "command prompt window". like xterm, konsole, or gnome-terminal) to see the text they print out.

First open a console, then type:

Code: Select all

cd the_directory_that_you_saved_the_file_in
This will make the script executable:

Code: Select all

chmod +x ./whatever_filename_you_saved_it_as
And then you can run it like this:

Code: Select all

./whatever_filename_you_saved_it_as
And that goes for just about any linux script. You just have to make it executable after you download it.

BTW, this paticular script needs root permission in order to delete files. To become root type "su", enter your root password, and then run the script.
Top
Turd Furguson
n00b
n00b
Posts: 49
Joined: Thu Jun 16, 2005 6:34 pm

  • Quote

Post by Turd Furguson » Mon Jul 11, 2005 3:46 am

Thank you for explaining.

Here is the error I am receiving now:

laptop nate # ./yacleaner.sh
./yacleaner.sh: line 1: !/bin/bash: No such file or directory
./yacleaner.sh: line 312: syntax error near unexpected token `newline'
./yacleaner.sh: line 312: ` echo eval rm -rf \"`eval_this portage ${1}` files\" >> '

I did a dir command at the prompt and it is showing the yacleaner.sh script being present in my home folder.

laptop nate # dir
Desktop cedega_4.3.2-1.i386.tgz
c yacleaner.sh
cannon.gif
Top
tacvbo
n00b
n00b
User avatar
Posts: 39
Joined: Wed May 28, 2003 5:36 pm
Location: México City
Contact:
Contact tacvbo
Website

  • Quote

Post by tacvbo » Mon Jul 11, 2005 4:05 am

Lord Vader wrote::D ...I ran this programme and i got this:

Code: Select all

VaderX Cruft # ./yacleaner.sh --verbose --ask all

These are the old files that I would delete:

  [ worktmp ]   Archive-Zip-1.14  72K
  [ worktmp ]   Compress-Zlib-1.33  72K
  [/quote]

And what's the problem? All of them are old files, so.. don't worry they could be deleted.
Top
Turd Furguson
n00b
n00b
Posts: 49
Joined: Thu Jun 16, 2005 6:34 pm

  • Quote

Post by Turd Furguson » Tue Jul 12, 2005 6:33 am

I am trying your 0.4 alpha build and am receiving a few odd things....

>>> Deleting old files...

* /var/tmp/portage cleaned.
* The $PORT_LOGDIR variable is not set.
* /usr/portage/distfiles was already clean.
* The directory /usr/portage/packages do not exist.

I don't know if that is how it is supposed to react or not.
Top
whitesouls
Guru
Guru
User avatar
Posts: 358
Joined: Fri Nov 19, 2004 9:02 am
Location: In Front of My Laptop

  • Quote

Post by whitesouls » Tue Jul 12, 2005 7:41 pm

tacvbo wrote:
Lord Vader wrote::D ...I ran this programme and i got this:

Code: Select all

VaderX Cruft # ./yacleaner.sh --verbose --ask all

These are the old files that I would delete:

  [ worktmp ]   Archive-Zip-1.14  72K
  [ worktmp ]   Compress-Zlib-1.33  72K
  [/quote]

And what's the problem? All of them are old files, so.. don't worry they could be deleted.[/quote]

[b]3GB[/b] went off??8O .. thank you tacvbo..i've managed to save 3GB juz like that...:D ... 2 thumbs up for this program!!!
whitesouls

Please insert the [SOLVED] tag if your problem is solved in your respective thread.
Top
tacvbo
n00b
n00b
User avatar
Posts: 39
Joined: Wed May 28, 2003 5:36 pm
Location: México City
Contact:
Contact tacvbo
Website

  • Quote

Post by tacvbo » Tue Jul 12, 2005 11:48 pm

Turd Furguson wrote:I am trying your 0.4 alpha build and am receiving a few odd things....

>>> Deleting old files...

* /var/tmp/portage cleaned.
* The $PORT_LOGDIR variable is not set.
* /usr/portage/distfiles was already clean.
* The directory /usr/portage/packages do not exist.

I don't know if that is how it is supposed to react or not.
That's OK, :-)
Top
gwolf
Guru
Guru
User avatar
Posts: 374
Joined: Thu May 05, 2005 9:07 am
Location: Estonia

Re: Version 0.3 "Release early and often" is out!

  • Quote

Post by gwolf » Wed Jul 13, 2005 6:59 am

tacvbo wrote: Grab it here: yacleaner-0.3 and please post your comments, patches and suggestions. :-)
Big thanks, it really has all the features I need atm :-)
Only one suggestion: create an ebuild and add it into portage ;-)
War is peace. Freedom is slavery. Ketchup is a vegetable.
Top
Bodri
n00b
n00b
User avatar
Posts: 26
Joined: Wed May 04, 2005 4:18 pm

  • Quote

Post by Bodri » Sun Jul 17, 2005 12:58 am

I think move (with destination folder) would be a nice new action.

THX
Top
neworld
n00b
n00b
Posts: 1
Joined: Sun Jul 17, 2005 1:06 am
Location: Mass

Small suggestion

  • Quote

Post by neworld » Sun Jul 17, 2005 1:21 am

Works well the only thing about it is that it doesn't support multiple options together
ie: yacleaner -av dist
here is one solution to change the parsing of the options in the script to:

Code: Select all

while getopts adhpvVc o
  do case "$o" in
      a ) ask_pretend="ask";;
      d ) action_delete="yes";;
      h ) option_help="yes";;
      c ) option_color="no";;
      p ) verb="is"; ask_pretend="pretend";;
      v ) option_verbose="yes";;
      V ) option_version="yes";;
      * ) OPTIND=$i; should_exit="yes" ; show_help "${!i} is an invalid option"; break ;;
  esac
done

for ((i=$OPTIND; i<=$#; ++i)); do
  case ${!i} in
      --ask ) ask_pretend="ask";;
      --delete ) action_delete="yes";;
      --help ) option_help="yes";;
      --nocolor ) option_color="no";;
      --pretend ) verb="is"; ask_pretend="pretend";;
      --verbose ) option_verbose="yes";;
      --version ) option_version="yes";;
      binpkg ) delete_argument="binpkg ${delete_argument}" ;;
      dist ) delete_argument="dist ${delete_argument}" ;;
      log ) delete_argument="log ${delete_argument}" ;;
      worktmp ) delete_argument="worktmp ${delete_argument}" ;;
      all ) delete_argument="binpkg dist log worktmp" ;;
      -* ) ;;
      * ) OPTIND=$i; should_exit="yes" ; show_help "${!i} is an invalid option"; break ;;
  esac
done
this works all i had to do was make the short option for --nocolor be -c
-neworld
Top
whitesouls
Guru
Guru
User avatar
Posts: 358
Joined: Fri Nov 19, 2004 9:02 am
Location: In Front of My Laptop

  • Quote

Post by whitesouls » Sun Jul 17, 2005 4:27 pm

:D Good luck for the great job. just a suggestion only. Why dont you maintain a ebuild like conky? That would be cool, dude. I knw the program is only 16kb but having an ebuild would be betteri guess :P
whitesouls

Please insert the [SOLVED] tag if your problem is solved in your respective thread.
Top
tacvbo
n00b
n00b
User avatar
Posts: 39
Joined: Wed May 28, 2003 5:36 pm
Location: México City
Contact:
Contact tacvbo
Website

Re: Small suggestion

  • Quote

Post by tacvbo » Wed Jul 20, 2005 10:42 pm

Bodri wrote:I think move (with destination folder) would be a nice new action.
I like the idea, most probably will be in v4. I will work on it on yacleaner-0.4.1alpha :-)
neworld wrote:Works well the only thing about it is that it doesn't support multiple options together
ie: yacleaner -av dist
yacleaner-0.4.1alpha now support multiple short options together, so the next stable version, will have that support. :-)
Lord Vader wrote::D Good luck for the great job. just a suggestion only. Why dont you maintain a ebuild like conky? That would be cool, dude. I knw the program is only 16kb but having an ebuild would be betteri guess :P
Humm, I will think about it, but I beleive that is better that some tool like this is get inside gentoolkit.

Thanks to all for your comments and suggestions! :-)

PD: If you use yacleaner-0.4.1alpha see the ToDo List and dropme a line (here or in my mail) with you comments and rembember that is alpha code, so take care.
Top
lefou
Apprentice
Apprentice
Posts: 207
Joined: Wed Feb 18, 2004 10:11 pm
Location: Germany, Lusatia
Contact:
Contact lefou
Website

  • Quote

Post by lefou » Thu Jul 21, 2005 7:44 am

This is my small but working ebuild :)

Code: Select all

# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit eutils
DESCRIPTION="Yet Another Cleaner - unsupported portage file cleaner."
HOMEPAGE="http://gentoo.org.mx/yacleaner/"
LICENSE="GPL"
SLOT="0"
KEYWORDS="~x86"
IUSE=""
DEPEND="sys-apps/portage"

MY_P=${P/_alpha1/alpha}

SRC_URI="http://gentoo.org.mx/yacleaner/${MY_P}"

src_unpack() { :; }

src_compile() { :; }

src_install() {
        newbin ${DISTDIR}/${MY_P} ${PN} || die "failed to copy ${P}"
}
lefou
Top
tacvbo
n00b
n00b
User avatar
Posts: 39
Joined: Wed May 28, 2003 5:36 pm
Location: México City
Contact:
Contact tacvbo
Website

  • Quote

Post by tacvbo » Thu Jul 21, 2005 7:51 am

lefou wrote:This is my small but working ebuild :)
:o Cool! Thanks :-D
Top
Pseud
Apprentice
Apprentice
Posts: 273
Joined: Fri Mar 19, 2004 9:58 pm
Location: Bangalore, India

  • Quote

Post by Pseud » Fri Jul 22, 2005 6:06 am

@Lord Vader:
Could you kindly edit that huge post of yours (somewhere up in the middle of this page) and shorten it? It fills up a lot of space and doesn't provide much information to others browsing through the pages. Thanks.
eschew obfuscation
Top
Smoothhound
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 149
Joined: Tue Sep 23, 2003 4:42 pm

  • Quote

Post by Smoothhound » Fri Jul 22, 2005 11:19 am

I think I have found a buglet:

Code: Select all

[root@haggis util]\$ ./yacleaner-0.4.1alpha --pretend --delete worktmp

These are the old worktmp files that I would delete:

  [ worktmp ]              B
./yacleaner-0.4.1alpha: line 353: 0 + 0 + 0 +  : syntax error: operand expected (error token is " ")
[root@haggis util]\$ ./yacleaner-0.3 --pretend --delete worktmp

These are the old worktmp files that I would delete:

  [ worktmp ]              B
./yacleaner-0.3: line 335: 0 + 0 + 0 +  : syntax error: operand expected (error token is " ")
Works for all other options. Note that I've got no idea what "worktmp" is and whether indeed I have one but it probably ought to fail a bit more gracefully :)

Apart from that, cheers! I cleared out ~0.8G of stuff with it 8)
Top
Post Reply

132 posts
  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • Next

Return to “Unsupported Software”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic