Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 547388 - app-portage/layman should never delete an overlay without asking confirmation
Summary: app-portage/layman should never delete an overlay without asking confirmation
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Layman Overlay Manager project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-22 09:46 UTC by Mike Auty (RETIRED)
Modified: 2016-05-10 04:35 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Auty (RETIRED) gentoo-dev 2015-04-22 09:46:11 UTC
Hiya,

I just had my uncommitted changes to my overlay and several in-progress ebuilds wiped out by what seems to be a new feature:

 * Syncing selected overlay(s)...
 * Running Git... # ( cd /var/lib/layman/ikelos  && /usr/bin/git remote set-url origin git+ssh://git@git.gentoo.org/dev/ikelos.git git://git.overlays.gentoo.org/dev/ikelos.git )
fatal: No such URL found: git://git.overlays.gentoo.org/dev/ikelos.git
 * Failure result returned from Git
 * Running Git... # ( cd /var/lib/layman/ikelos  && /usr/bin/git remote set-url origin git://anongit.gentoo.org/dev/ikelos.git git://git.overlays.gentoo.org/dev/ikelos.git )
fatal: No such URL found: git://git.overlays.gentoo.org/dev/ikelos.git
 * Failure result returned from Git
 * Running Git... # ( cd /var/lib/layman/ikelos  && /usr/bin/git remote set-url origin https://anongit.gentoo.org/git/dev/ikelos.git git://git.overlays.gentoo.org/dev/ikelos.git )
fatal: No such URL found: git://git.overlays.gentoo.org/dev/ikelos.git
 * Failure result returned from Git
 * Failed to update repo...readding
 * Deleting directory "/var/lib/layman/ikelos"

I guess the main layman repo list got updated to point everyone to anongit, but however it happened, it was quite destructive.  5:\

I suspect a number of developers work directly on the git repository within their layman overlay folder, because it's a very convenient way to keep them synced.  Unfortunately, this functionality will destroy all uncommitted/in-progress commits, as well as branches that were not committed to the public repo, but kept locally for the development history.

Please ensure that layman does not delete an overlay without prompting the user first.
Comment 1 Brian Dolbec (RETIRED) gentoo-dev 2015-04-22 14:59:31 UTC
HMMmm,  layman should not have deleted the repo and re-installed it.  Since it is still a git repo, it should have just swapped out the old remote url for the new one.  Deleting and re-adding the repo is for VCS changes like a svn overlay is now git.

What version of layman is this?
Comment 2 Brian Dolbec (RETIRED) gentoo-dev 2015-04-22 15:12:43 UTC
looking at your output more... It seems that is what it was trying to do originally, but failed all changed remote urls.  Then attempted the re-add.
Yes, it should have paused and asked confirmation

I wonder if you got caught with a bad repositories.xml list.  

Robin, was there an interim list at some point during the mass url updates with some bad urls still?
Comment 3 Devan Franchini (RETIRED) gentoo-dev 2015-04-22 17:43:06 UTC
Added fix in layman's git HEAD. Thank you for pointing out that bug and I apologize for the troubles caused by it. In the live version and the next upcoming release it will prompt the user if they wish to re-add the overlay after a failed URL update.
Comment 4 Mike Auty (RETIRED) gentoo-dev 2015-04-23 08:51:29 UTC
Hiya, thanks for getting a fix in so quickly.  It was layman 2.3.0, and I figured I might have been messing with my local repo (since on one box I added the repo in layman and then in git swapped out the URL to point to my local git repo, but this log was from my main box and I didn't think I'd tampered with that one?).

Given that these now sync off of anongit, I may still have to change the repo address so I can push new changes up to it.  Will layman detect that and try and change them back, or does it only detect changes to the repositories XML?
Comment 5 Brian Dolbec (RETIRED) gentoo-dev 2015-04-23 15:13:02 UTC
If the git+ssh is a source listed in the xml, then you can swap it out
and it will not try to reset it.  Until it is no longer part of the xml.

One of the things on our/overlay teams todo list was to make sure all
gentoo hosted/github hosted overlays had all available protocols/urls
listed in their xml definition.  We know many of them did not.

Devan created a utility for creating xml definitions.  It adds all
protocols/urls provided by gentoo/github/???  (I'm sure there was one
more, but don't remember).

Yes, we want to make another release, but both of us have been very
busy this past few weeks.
Comment 6 Devan Franchini (RETIRED) gentoo-dev 2016-05-10 04:35:58 UTC
2.4.1 is out which resolves this issue, therefore, I'm resolving the bug.