flatpak / flatpak-builder

Tool to build flatpaks from source
GNU Lesser General Public License v2.1
139 stars 91 forks source link

Don't require refs/remotes and refs/mirrors when are empty (or automatically create them) #314

Open ThanosApostolou opened 4 years ago

ThanosApostolou commented 4 years ago

Linux distribution and version

Kubuntu 19.10

Flatpak-builder version

flatpak-builder 1.0.8

Flatpak version

Flatpak 1.4.3

Description of the problem

I am experimenting with flatpak and I have created a flatpak repo using gitlab pages (https://gitlab.com/ThanosApostolou/thanos-flatpaks). The repo files are under directory public and I was using if fine to build flatpaks from my pc. The problems started when I cloned the repo from my laptop and tried to build a flatpak there, then I got the error with command

flatpak-builder --force-clean --repo=../public --gpg-sign=thanosapostolou@outlook.com build org.gyunaev.Birdtray.json
Exporting org.gyunaev.Birdtray to repo
error: Listing refs: opendir(refs/remotes): No such file or directory
Export failed: Child process exited with code 1

After a while I figured out that the problem is that empty directories refs/remotes and refs/mirrors hadn't been added by git and I had to add refs/remotes/.gitkeep and refs/mirrors/.gitkeep as a workaround. It is a bit strange that flatpak-builder creates those directories automatically when there isn't any repo but it cannot create them automatically when these don't exist over an already initialized repo. Can you make it so that these folders are treated as empty if they don't exist or that flatpak-builder creates them automatically over an existing repo, so that the procedure is more git friendly?

refi64 commented 4 years ago

I think you can also just run ostree init --mode=archive --repo=../public to re-init everything, want to say that's worked for me before but I'm not entirely sure if it was the same scenario as here.

On Fri, Oct 18, 2019, 10:41 AM Thanos Apostolou notifications@github.com wrote:

Linux distribution and version

Kubuntu 19.10 Flatpak-builder version

flatpak-builder 1.0.8 Flatpak version

Flatpak 1.4.3 Description of the problem

I am experimenting with flatpak and I have created a flatpak repo using gitlab pages (https://gitlab.com/ThanosApostolou/thanos-flatpaks). The repo files are under directory public and I was using if fine to build flatpaks from my pc. The problems started when I cloned the repo from my laptop and tried to build a flatpak there, then I got the error with command

flatpak-builder --force-clean --repo=../public --gpg-sign=thanosapostolou@outlook.com build org.gyunaev.Birdtray.json

Exporting org.gyunaev.Birdtray to repo error: Listing refs: opendir(refs/remotes): No such file or directory Export failed: Child process exited with code 1

After a while I figured out that the problem is that empty directories refs/remotes and refs/mirrors hadn't been added by git and I had to add refs/remotes/.gitkeep and refs/mirrors/.gitkeep as a workaround. It is a bit strange that flatpak-builder creates those directories automatically when there isn't any repo but it cannot create them automatically when these don't exist over an already initialized repo. Can you make it so that these folders are treated as empty if they don't exist or that flatpak-builder creates them automatically over an existing repo, so that the procedure is more git friendly?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/flatpak/flatpak-builder/issues/314?email_source=notifications&email_token=AAM4YSNEDUN2JWYUUZBH5ILQPHKJXA5CNFSM4JCJDSA2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HSZFBHA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM4YSNYSOV7CNI6AHYSZWDQPHKJXANCNFSM4JCJDSAQ .

ThanosApostolou commented 4 years ago

@refi64 That didn't work (the folders didn't get created and same errors appeared). But I think this must be thought as a general idea. In order to keep flatpak repositories git friendly always treat non existent directories as empty in every aspect of every tool (i don't know if these or any other directories are expected to be there in other tools like flatpak, flatpak-builder, flatpak backends in app stores or whatever)