Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using mirrorbits edit diff incorrect missing values #124

Open
loanfedora opened this issue Mar 8, 2022 · 4 comments
Open

using mirrorbits edit diff incorrect missing values #124

loanfedora opened this issue Mar 8, 2022 · 4 comments
Labels

Comments

@loanfedora
Copy link
Contributor

add test mirror

root@centos:~/mirrorbits# mirrorbits list
Identifier 	STATE	SINCE
root@centos:~/mirrorbits# mirrorbits add -http http://localhost test
Warning: the hostname returned more than one address. Assuming they're sharing the same location.
Warning: unable to guess the geographic location of this mirror

Mirror 'test' added successfully
Enable this mirror using
  $ mirrorbits enable test
root@centos:~/mirrorbits# mirrorbits show test
Name: test
HttpURL: http://localhost/
RsyncURL: ""
FtpURL: ""
SponsorName: ""
SponsorURL: ""
SponsorLogoURL: ""
AdminName: ""
AdminEmail: ""
CustomData: ""
ContinentOnly: false
CountryOnly: false
ASOnly: false
Score: 0
Latitude: 0
Longitude: 0
ContinentCode: ""
CountryCodes: ""
ExcludedCountryCodes: ""
ASNum: 0
Enabled: false
AllowRedirects: null

Comment:

root@centos:~/mirrorbits# export EDITOR=vi
root@centos:~/mirrorbits# mirrorbits edit test

edit mirror

:%s/^Enabled: .*/Enabled: true
:%s/^CountryCodes: .*/CountryCodes: AF AL DZ AS AD AO AI AQ AG AR AM AW AU AT AZ BS BH BD BB BY BE BZ BJ BM BT BO BQ BA BW BV BR IO BN BG BF BI CV KH CM CA KY CF TD CL CN CX CC CO KM CD CG CK CR HR CU CW CY CZ CI DK DJ DM DO EC EG SV GQ ER EE SZ ET FK FO FJ FI FR GF PF TF GA GM GE DE GH GI GR GL GD GP GU GT GG GN GW GY HT HM VA HN HK HU IS IN ID IR IQ IE IM IL IT JM JP JE JO KZ KE KI KP KR KW KG LA LV LB LS LR LY LI LT LU MO MG MW MY MV ML MT MH MQ MR MU YT MX FM MD MC MN ME MS MA MZ MM NA NR NP NL NC NZ NI NE NG NU NF MP NO OM PK PW PS PA PG PY PE PH PN PL PT PR QA MK RO RU RW RE BL SH KN LC MF PM VC WS SM ST SA SN RS SC SL SG SX SK SI SB SO ZA GS SS ES LK SD SR SJ SE CH SY TW TJ TZ TH TL TG TK TO TT TN TR TM TC TV UG UA AE GB UM US UY UZ VU VE VN VG VI WF EH YE ZM ZW AX
:wq

CountryCodes from https://www.iban.com/country-codes

after saving this happens

root@centos:~# mirrorbits edit test
- CountryCodes: ""
+ CountryCodes: AF AL DZ AS AD AO AI AQ AG AR AM AW AU AT AZ BS BH BD BB BY BE BZ BJ
- ExcludedCountryCodes: ""
+   BM BT BO BQ BA BW BV BR IO BN BG BF BI CV KH CM CA KY CF TD CL CN CX CC CO KM CD
- ASNum: 0
+   CG CK CR HR CU CW CY CZ CI DK DJ DM DO EC EG SV GQ ER EE SZ ET FK FO FJ FI FR GF
- Enabled: false
+   PF TF GA GM GE DE GH GI GR GL GD GP GU GT GG GN GW GY HT HM VA HN HK HU IS IN ID
- AllowRedirects: null
+   IR IQ IE IM IL IT JM JP JE JO KZ KE KI KP KR KW KG LA LV LB LS LR LY LI LT LU MO
-
+   MG MW MY MV ML MT MH MQ MR MU YT MX FM MD MC MN ME MS MA MZ MM NA NR NP NL NC NZ

Mirror 'test' edited successfully
root@centos:~# mirrorbits show test
Name: test
HttpURL: http://localhost/
RsyncURL: ""
FtpURL: ""
SponsorName: ""
SponsorURL: ""
SponsorLogoURL: ""
AdminName: ""
AdminEmail: ""
CustomData: ""
ContinentOnly: false
CountryOnly: false
ASOnly: false
Score: 0
Latitude: 0
Longitude: 0
ContinentCode: ""
CountryCodes: AF AL DZ AS AD AO AI AQ AG AR AM AW AU AT AZ BS BH BD BB BY BE BZ BJ
  BM BT BO BQ BA BW BV BR IO BN BG BF BI CV KH CM CA KY CF TD CL CN CX CC CO KM CD
  CG CK CR HR CU CW CY CZ CI DK DJ DM DO EC EG SV GQ ER EE SZ ET FK FO FJ FI FR GF
  PF TF GA GM GE DE GH GI GR GL GD GP GU GT GG GN GW GY HT HM VA HN HK HU IS IN ID
  IR IQ IE IM IL IT JM JP JE JO KZ KE KI KP KR KW KG LA LV LB LS LR LY LI LT LU MO
  MG MW MY MV ML MT MH MQ MR MU YT MX FM MD MC MN ME MS MA MZ MM NA NR NP NL NC NZ
  NI NE NG NU NF MP NO OM PK PW PS PA PG PY PE PH PN PL PT PR QA MK RO RU RW RE BL
  SH KN LC MF PM VC WS SM ST SA SN RS SC SL SG SX SK SI SB SO ZA GS SS ES LK SD SR
  SJ SE CH SY TW TJ TZ TH TL TG TK TO TT TN TR TM TC TV UG UA AE GB UM US UY UZ VU
  VE VN VG VI WF EH YE ZM ZW AX
ExcludedCountryCodes: ""
ASNum: 0
Enabled: true
AllowRedirects: null

Comment:

root@centos:~#

there is no + Enabled: true in output!

@loanfedora
Copy link
Contributor Author

something todo with

func createDiff(mirror1, mirror2 *mirrors.Mirror) (out string) {
@etix ?

@etix
Copy link
Owner

etix commented Mar 8, 2022

Usually, the easiest way to enable (or disable) a mirror is to use mirrorbits enable <mirror> and not edit but I agree this should probably appear in the diff.

@loanfedora
Copy link
Contributor Author

enable was demo
other fields also no show too

it crop output! diff incomplete!!!
diff not easy to read too without grouping!!!

fix disable wordwrap @etix ?

@etix
Copy link
Owner

etix commented Mar 8, 2022

Not sure word wrap is the issue there.

@jbkempf jbkempf added the bug label Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants