Smart fails to run 'clean' command

Bug #249990 reported by netmask
2
Affects Status Importance Assigned to Milestone
Smart Package Manager
Invalid
Low
Gustavo Niemeyer

Bug Description

On a clean system, with a freshly installed Smart, if user runs 'smart clean' before any other command, an error throws.

# smart clean -o loglevel=debug
error: Directory not found: /var/lib/smart/packages/

Revision history for this message
Jonathan R (linux-learner) wrote : Re: [Bug 249990] [NEW] Smart fails to run 'clean' command

I don't see this as a bug. On a freshly installed smart, the packages dir
hasn't been created yet.

Maybe what we could do is add to the clean.py file is something where it
checks to see of the packages dir is created. If not, then create it and
return message that there are no packages to clean. Something like that.

On Fri, Jul 18, 2008 at 4:06 PM, netmask <email address hidden> wrote:

> Public bug reported:
>
> On a clean system, with a freshly installed Smart, if user runs 'smart
> clean' before any other command, an error throws.
>
> # smart clean -o loglevel=debug
> error: Directory not found: /var/lib/smart/packages/
>
> ** Affects: smart
> Importance: Undecided
> Status: New
>
> --
> Smart fails to run 'clean' command
> https://bugs.launchpad.net/bugs/249990
> You received this bug notification because you are a member of Smart
> Package Manager Team, which is the registrant for Smart Package Manager.
>
> Status in Smart Package Manager: New
>
> Bug description:
> On a clean system, with a freshly installed Smart, if user runs 'smart
> clean' before any other command, an error throws.
>
> # smart clean -o loglevel=debug
> error: Directory not found: /var/lib/smart/packages/
>

Revision history for this message
netmask (netmask) wrote :

Fix in sandbox revno 828.

# smart -o log-level=debug clean
debug: Directory not found: /var/lib/smart/packages/
Removing cached package files...

Changed in smart:
assignee: nobody → netmask
importance: Undecided → Low
status: New → Fix Committed
netmask (netmask)
Changed in smart:
status: Fix Committed → In Progress
Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

As Jonathan points out, I don't see the reason why this would be a bug.

The packages/ directory is part of the expected structure. If it's not present, there's nothing for this command to do at the moment.

Changed in smart:
assignee: netmask → nobody
status: In Progress → Invalid
Revision history for this message
netmask (netmask) wrote :

Sorry I was not clear.

I noticed that the 'clean' command simply does nothing, because when it detects the packages directory does not exist, it throws an exception. With that, the cache files remain intact.

With the fix, it ignores the packages directory and really clean the cache.

Changed in smart:
assignee: nobody → niemeyer
status: Invalid → In Progress
Revision history for this message
Rehan Khan (rasker) wrote :

I'm a little confused. The clean command is only supposed to remove old packages from the packages directory. It is not supposed to do anything else according to the help. If the packages directory does not exist it should display an error (to std_err as this is a program error). Right?

So is the displayed error already doing the right thing?

Revision history for this message
netmask (netmask) wrote :

Sorry I mixed up some patches. This is an invalid report.

Changed in smart:
status: In Progress → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.