sugarlabs / sugar

Sugar GTK shell
GNU General Public License v3.0
255 stars 241 forks source link

Adding code for enabling deb-src. #834

Closed Aniket21mathur closed 5 years ago

Aniket21mathur commented 5 years ago

A simple code snippet will make it easy for the new developers to enable deb sources, as compared to the most general approach of manually doing it with a text editor, in which there are chances of missing a line or two.

quozl commented 5 years ago

Thanks. Reviewed. Looks familiar, perhaps you got this from askubuntu.com E: You must put some 'source' URIs in your sources.list?

My comments;

SourcesList on the Debian Wiki is a good explanation.

Is there a better way to enable source lines? @nswarup14, did you hit this too?

nswarup14 commented 5 years ago

@quozl Thanks. You're correct. 1) -E isn't needed. 2) apt is definitely easier, safer and the recommended method. 3) As a solution, we can perhaps write a bash script/python script that would update/enable the #deb-src lines from /etc/apt/sources.list( assuming it hasn't been tampered with already, otherwise we'll have to check and the right packages).

Then we could go around this problem you've pointed out. Please suggest modifications if any.

Thanks Swarup N.

Aniket21mathur commented 5 years ago

Looks familiar, perhaps you got this from askubuntu.com E: You must put some 'source' URIs in your sources.list?

Yes, I got it from this.

@quozl ,Thanks. I agree with your comments and the fact that my changes would not be appropriate for all cases.

3. As a solution, we can perhaps write a bash script/python script that would update/enable the #deb-src lines from /etc/apt/sources.list( assuming it hasn't been tampered with already, otherwise we'll have to check and the right packages).

@nswarup14 . Thanks. But I don't think writing a bash script just for enabling deb-src is a good idea. I made these changes just to make things easier for new developers who even don't know what deb-src are, I also agree that without my changes the doc is self-sufficient(with a bit of googling) to guide through the installation process. :-)

quozl commented 5 years ago

Isn't this simpler?

sudo apt-add-repository --enable-source --update universe

It almost works for me, does it work for you? (Almost, as in it added a deb but not a deb-src!)

nswarup14 commented 5 years ago

I don't think http://dev.laptop.org/~quozl/.us/dists/bionic/main/binary-amd64/Packages will be added to to the /etc/apt/sources.list, (which contains the rsvg.so(python2 static bindings for rsvg lib)and hence may not work on some systems ( especially the later versions of Ubuntu where the rsvg packages were being unmaintained/deprecated).

Thanks

On Fri, 24 May 2019, 13:19 James Cameron, notifications@github.com wrote:

Isn't this simpler?

sudo apt-add-repository --enable-source --update universe

It almost works for me, does it work for you?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/sugarlabs/sugar/pull/834?email_source=notifications&email_token=AIH6YB53FPXBA4OG7MF6T5TPW6MYLA5CNFSM4HPMKHF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWEN6XA#issuecomment-495509340, or mute the thread https://github.com/notifications/unsubscribe-auth/AIH6YB22E6ETOD2QTZEZC7TPW6MYLANCNFSM4HPMKHFQ .

quozl commented 5 years ago

It adds a line;

deb http://archive.ubuntu.com/ubuntu bionic universe

It's a Python script, /usr/bin/add-apt-repository, so I had a look, but it does pass the enable source boolean to another module. So whatever reason it is that it doesn't work will likely be down in that module. Oh well, it was a nice idea.

quozl commented 5 years ago

I've tested. Debian has deb-src lines enabled by default. Having disabled deb-src lines is specific to Ubuntu. Debian users may disable deb-src themselves. I can see the point; as Debian uses pdiffs to fetch updates, but Ubuntu does not.

quozl commented 5 years ago

7aea5d1fb pushed.

Aniket21mathur commented 5 years ago

Thanks.