ratt icon indicating copy to clipboard operation
ratt copied to clipboard

Support Different Source Paths

Open MTecknology opened this issue 7 years ago • 6 comments

Right now, there's a dependency on /var/lib/apt/lists/ which means a dependency on the system apt. When I run apt-get on the system, I have to pull down a lot of sources that I probably don't need at the time... unless I'm running "sudo apt-get update" just so I can run ratt without builds failing because sources can't be found.

I can understand why the design decision was made in the first place, but it'd nice if we would extend ratt to read a custom sources.list and maintain (and optionally update) it. If nothing else, an option top point at a separate directory for these files so that I can write a script to maintain them separately.. that also makes sense. :)

MTecknology avatar Apr 20 '17 05:04 MTecknology

Also, for the life o' me, I can't figure out how the heck to make it build for testing/stretch, but it keeps complaining about not finding sources for unstable. I don't have any for unstable... I want to run this for testing. I'm not sure if it's related, something silly I'm doing, or something else entirely.

[edit: I see a new -dist option that I was able to use. That'll suffice for now, but likely a PR later. ]

MTecknology avatar Apr 20 '17 06:04 MTecknology

I think you can tell apt via environment variables where to look. The burden of setting that environment variable and maintaining a separate lists directory would fall on to you; I don’t think we should build that into ratt.

Does that make sense?

stapelberg avatar Apr 20 '17 07:04 stapelberg

Creating the sources my be a job for the calling script, but ratt is hard coded to only look at system paths: https://github.com/Debian/ratt/blob/master/ratt.go#L161 & 182 & 187

I guess if apt can do the rest using environment variables, then turning the directory into another option would be quite easy. If so, then it'd be nice to have some example setup documentation. I might be able to take a look into a PR for that.

MTecknology avatar Apr 20 '17 07:04 MTecknology

You’re looking at the fallback branch. Take a look at https://github.com/Debian/ratt/blob/master/ratt.go#L134 instead. No changes to the code should be necessary.

stapelberg avatar Apr 20 '17 07:04 stapelberg

I ended up using a work-around, but see what you're referring to. When I get some time, I'll plan on writing some documentation that I'm hoping you'd like to include about that that setup looks like. It at least falls like it's within scope to document how that can be done, ya? :)

MTecknology avatar Apr 25 '17 02:04 MTecknology

Sure, documentation improvements are always welcome.

stapelberg avatar May 02 '17 07:05 stapelberg