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

Show local port repository example source with nosync #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mtn88
Copy link

@mtn88 mtn88 commented Dec 22, 2023

I believe it would make sense to change the example for the local port repository to prevent the source from syncing during 'port sync'

@raimue
Copy link
Member

raimue commented Dec 23, 2023

Can you elaborate a bit more why we would want to add the nosync flag? When the directory at the file:// URL is not a subversion working copy or git working tree, port sync should do nothing. Does the example cause any problems for you like this?

@jmroot
Copy link
Member

jmroot commented Dec 24, 2023

It does run portindex but that's almost always desirable.

@mtn88
Copy link
Author

mtn88 commented Dec 24, 2023

Yes, the provided example causes a problem for me. And yes, I do have git enabled for my local repository. When I specify a local file:// URL I get the following error when running port sync:

--->  Updating the ports tree
port sync failed: Synchronization of 1 source failed

Appending [nosync] to my local repository URL fixes the problem.

I quote from the inline documentation in the file ${prefix}/etc/macports/sources.conf

To prevent a source from synchronizing when `port sync` is used,
append "[nosync]" at the end.

  Example: file:///Users/landonf/misc/MacPorts/ports [nosync]

And yes, portindex runs fine with our without [nosync] :-)

@raimue
Copy link
Member

raimue commented Dec 24, 2023

That error probably happens because your local git repository does not have a remote? Can you confirm with port -d sync that this is the problem? Then I would say the correct fix would be in macports-base to run the git pull --rebase command only if a remote is configured.

With nosync, the command port sync will not automatically run portindex on the ports tree. That means you always have to do that manually.

@mtn88
Copy link
Author

mtn88 commented Dec 24, 2023

Thanks for the feedback!

I can confirm that my local repository doesn't have a remote. Here's the output from port -d sync (when [nosync] is not activated):

DEBUG: Copying /Users/julesverne/Library/Preferences/com.apple.dt.Xcode.plist to /opt/local/var/macports/home/Library/Preferences
--->  Updating the ports tree
Synchronizing local ports tree from file:///Users/julesverne/ports
DEBUG: euid/egid changed to: 501/20, env: HOME=/Users/max SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.puZJiZel0J/Listeners
DEBUG: /opt/local/bin/git pull --rebase --autostash
DEBUG: system -W /Users/julesverne/ports: /opt/local/bin/git pull --rebase --autostash
There is no tracking information for the current branch.
Please specify which branch you want to rebase against.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> master

Command failed: /opt/local/bin/git pull --rebase --autostash
Exit code: 1
DEBUG: command execution failed
    while executing
"system -W $dir $cmd"
    (procedure "macports::UpdateVCS" line 1)
    invoked from within
"macports::UpdateVCS $cmd $dir"
Syncing local Git ports tree failed
DEBUG: euid/egid restored to: 0/0, env restored
Synchronizing local ports tree from rsync://rsync.macports.org/macports/release/tarballs/ports.tar
DEBUG: system: /usr/bin/rsync -rtzvl --delete-after --include=/ports.tar --include=/ports.tar.rmd160 --exclude=* rsync://rsync.macports.org/macports/release/tarballs/ /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs

Willkommen auf dem RSYNC-server auf ftp.fau.de.
Nicht all unsere Mirror sind per rsync verfuegbar.

Welcome to the RSYNC daemon on ftp.fau.de.
Not all of our mirrors are available through rsync.


receiving file list ... done
./

sent 68 bytes  received 99 bytes  111.33 bytes/sec
total size is 124192256  speedup is 743666.20
DEBUG: successful verification with key /opt/local/share/macports/macports-pubkey.pem
DEBUG: system: /usr/bin/tar -C /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/tmp -xf /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports.tar
DEBUG: system: chmod -R a+r /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs
DEBUG: system: /opt/local/bin/portindex /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports
Creating port index in /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports

Total number of ports parsed:   0 
Ports successfully parsed:  0 
Ports failed:           0 
Up-to-date ports skipped:   37859

DEBUG: Synchronization of 1 source failed
    while executing
"mportsync [array get global_options]"
port sync failed: Synchronization of 1 source failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants